{
 "openapi": "3.1.0",
 "info": {
  "title": "CodeB Playground API",
  "version": "2026-11-12",
  "description": "TEST ecosystem for EU Digital Identity Wallet projects: test organisations, TEST access certificates (ETSI TS 119 411-8) and TEST registration certificates (ETSI TS 119 475). Built to the EUDI Architecture and Reference Framework 3.0. Nothing here is verified, certified or valid in production. The operation is chosen with the query parameter op; each op has its own request and response schema (Request_<op>, Response_<op>). Documentation with examples: https://phone.codeb.io/playground-api.html"
 },
 "servers": [
  {
   "url": "https://phone.codeb.io"
  }
 ],
 "components": {
  "securitySchemes": {
   "apiKey": {
    "type": "http",
    "scheme": "bearer",
    "description": "API key created on https://phone.codeb.io/playground.html (pgk_...). Valid 90 days, 3 per account."
   }
  },
  "schemas": {
   "Organisation": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "pg- and ten hex digits"
     },
     "official_name": {
      "type": "string"
     },
     "trade_name": {
      "type": "string"
     },
     "org_id": {
      "type": "string"
     },
     "country": {
      "type": "string"
     },
     "roles": {
      "type": "array",
      "items": {
       "type": "string",
       "enum": [
        "verifier",
        "issuer"
       ]
      }
     },
     "entitlements": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "status": {
      "type": "string"
     },
     "certificates": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "serial": {
         "type": "string"
        },
        "subject": {
         "type": "string"
        },
        "not_before": {
         "type": "string"
        },
        "not_after": {
         "type": "string"
        },
        "status": {
         "type": "string"
        },
        "sha256": {
         "type": "string"
        }
       }
      }
     },
     "trust_anchors": {
      "type": "array",
      "items": {
       "type": "object"
      }
     }
    }
   },
   "Error": {
    "type": "object",
    "properties": {
     "error": {
      "type": "string"
     },
     "error_description": {
      "type": "string"
     }
    },
    "required": [
     "error"
    ]
   },
   "Request_org": {
    "type": "object",
    "properties": {
     "official_name": {
      "type": "string",
      "description": "at most 59 characters; stored as \"TEST <name>\""
     },
     "trade_name": {
      "type": "string"
     },
     "org_id": {
      "type": "string",
      "description": "test identifier, for example VATDE-123456789"
     },
     "country": {
      "type": "string",
      "description": "two letters"
     },
     "roles": {
      "type": "array",
      "items": {
       "type": "string",
       "enum": [
        "verifier",
        "issuer"
       ]
      }
     },
     "entitlements": {
      "type": "array",
      "items": {
       "type": "string",
       "enum": [
        "Non_Q_EAA_Provider",
        "PID_Provider",
        "QEAA_Provider",
        "PUB_EAA_Provider"
       ]
      }
     },
     "email": {
      "type": "string"
     },
     "url": {
      "type": "string"
     },
     "support_url": {
      "type": "string"
     },
     "phone": {
      "type": "string"
     },
     "services": {
      "type": "string"
     },
     "intended_use": {
      "type": "string"
     },
     "privacy_policy": {
      "type": "string"
     },
     "info_uri": {
      "type": "string"
     },
     "id": {
      "type": "string",
      "description": "only to change an existing organisation"
     }
    },
    "required": [
     "official_name",
     "org_id",
     "country",
     "roles",
     "email"
    ],
    "title": "op=org",
    "description": "Register a test organisation (step 01). With id: change the contact data of an existing one."
   },
   "Response_org": {
    "type": "object",
    "properties": {
     "ok": {
      "type": "boolean"
     },
     "created": {
      "type": "boolean"
     },
     "id": {
      "type": "string"
     },
     "organisations": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Organisation"
      }
     }
    },
    "title": "op=org"
   },
   "Request_cert": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "csr": {
      "type": "string",
      "description": "PKCS#10, PEM or base64 DER"
     },
     "dns": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "maxItems": 10
     },
     "days": {
      "type": "integer",
      "minimum": 1,
      "maximum": 30
     }
    },
    "required": [
     "id",
     "csr"
    ],
    "title": "op=cert",
    "description": "Get a TEST access certificate for the public key of your PKCS#10 request, ECDSA P-256, at most 30 days (step 02)."
   },
   "Response_cert": {
    "type": "object",
    "properties": {
     "ok": {
      "type": "boolean"
     },
     "test": {
      "type": "boolean"
     },
     "serial": {
      "type": "string"
     },
     "not_after": {
      "type": "string"
     },
     "certificate_pem": {
      "type": "string"
     },
     "ca_pem": {
      "type": "string"
     },
     "x5c": {
      "type": "array",
      "items": {
       "type": "string"
      }
     }
    },
    "title": "op=cert"
   },
   "Request_rc": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "kind": {
      "type": "string",
      "enum": [
       "verifier",
       "issuer"
      ]
     },
     "dcql_query": {
      "type": "object",
      "description": "the DCQL query you send to wallets, at most 8 credential queries"
     },
     "purpose": {
      "type": "string",
      "description": "one line, at most 300 characters"
     },
     "attestations": {
      "type": "array",
      "maxItems": 16,
      "items": {
       "type": "object",
       "properties": {
        "format": {
         "type": "string",
         "enum": [
          "dc+sd-jwt",
          "mso_mdoc"
         ]
        },
        "vct": {
         "type": "string"
        },
        "doctype": {
         "type": "string"
        }
       },
       "required": [
        "format"
       ]
      }
     }
    },
    "required": [
     "id",
     "kind"
    ],
    "title": "op=rc",
    "description": "Get a registration certificate, rc-wrp+jwt per ETSI TS 119 475, valid 30 days (step 03). kind verifier: dcql_query and purpose. kind issuer: attestations."
   },
   "Response_rc": {
    "type": "object",
    "properties": {
     "ok": {
      "type": "boolean"
     },
     "test": {
      "type": "boolean"
     },
     "kind": {
      "type": "string"
     },
     "typ": {
      "type": "string"
     },
     "exp": {
      "type": "integer"
     },
     "registration_certificate": {
      "type": "string"
     }
    },
    "title": "op=rc"
   },
   "Request_revoke": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "serial": {
      "type": "string"
     }
    },
    "required": [
     "id",
     "serial"
    ],
    "title": "op=revoke",
    "description": "Revoke one of your access certificates."
   },
   "Response_revoke": {
    "type": "object",
    "properties": {
     "ok": {
      "type": "boolean"
     },
     "serial": {
      "type": "string"
     },
     "status": {
      "type": "string"
     }
    },
    "title": "op=revoke"
   },
   "Request_delete": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     }
    },
    "required": [
     "id"
    ],
    "title": "op=delete",
    "description": "Remove a test organisation; its certificates are revoked."
   },
   "Response_delete": {
    "type": "object",
    "properties": {
     "ok": {
      "type": "boolean"
     }
    },
    "title": "op=delete"
   },
   "Request_anchor": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "kind": {
      "type": "string",
      "enum": [
       "mdoc-issuers",
       "vc-issuers"
      ]
     },
     "certificate": {
      "type": "string",
      "description": "CA certificate, PEM"
     }
    },
    "required": [
     "id",
     "kind",
     "certificate"
    ],
    "title": "op=anchor",
    "description": "Issuers: store the CA certificate your test issuer signs under. Our verifier then accepts its attestations in sessions started with sandbox=playground."
   },
   "Response_anchor": {
    "type": "object",
    "properties": {
     "ok": {
      "type": "boolean"
     },
     "sha256": {
      "type": "string"
     },
     "kind": {
      "type": "string"
     },
     "sandbox": {
      "type": "string"
     }
    },
    "title": "op=anchor"
   },
   "Request_anchor_remove": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "kind": {
      "type": "string"
     },
     "sha256": {
      "type": "string"
     }
    },
    "required": [
     "id",
     "kind",
     "sha256"
    ],
    "title": "op=anchor-remove",
    "description": "Remove a trust anchor."
   },
   "Response_anchor_remove": {
    "type": "object",
    "properties": {
     "ok": {
      "type": "boolean"
     }
    },
    "title": "op=anchor-remove"
   }
  },
  "responses": {
   "Error": {
    "description": "Error: error and, where it helps, error_description",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   }
  }
 },
 "paths": {
  "/playground.ashx": {
   "get": {
    "tags": [
     "Playground"
    ],
    "summary": "List your test organisations, or (with info) the public facts",
    "description": "Without a query: your test organisations with certificates and trust anchors, and the limits (API key needed). With the valueless query parameter info (GET /playground.ashx?info): addresses of the CA certificate, revocation list, status list and register, the CA fingerprint and the limits; no key needed, open to other origins.",
    "parameters": [
     {
      "name": "info",
      "in": "query",
      "required": false,
      "allowEmptyValue": true,
      "schema": {
       "type": "string"
      },
      "description": "send without a value for the public facts"
     }
    ],
    "security": [
     {
      "apiKey": []
     },
     {}
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "oneOf": [
          {
           "type": "object",
           "properties": {
            "ok": {
             "type": "boolean"
            },
            "organisations": {
             "type": "array",
             "items": {
              "$ref": "#/components/schemas/Organisation"
             }
            },
            "limits": {
             "type": "object"
            },
            "ca": {
             "type": "object"
            }
           },
           "title": "your organisations"
          },
          {
           "type": "object",
           "properties": {
            "name": {
             "type": "string"
            },
            "test": {
             "type": "boolean"
            },
            "ca": {
             "type": "object"
            },
            "limits": {
             "type": "object"
            },
            "note": {
             "type": "string"
            }
           },
           "title": "info"
          }
         ]
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     },
     "403": {
      "$ref": "#/components/responses/Error"
     },
     "404": {
      "$ref": "#/components/responses/Error"
     },
     "409": {
      "$ref": "#/components/responses/Error"
     },
     "429": {
      "$ref": "#/components/responses/Error"
     },
     "503": {
      "$ref": "#/components/responses/Error"
     }
    }
   },
   "post": {
    "tags": [
     "Playground"
    ],
    "summary": "Change something: the query parameter op chooses the operation",
    "description": "- op=org: Register a test organisation (step 01). With id: change the contact data of an existing one.\n- op=cert: Get a TEST access certificate for the public key of your PKCS#10 request, ECDSA P-256, at most 30 days (step 02).\n- op=rc: Get a registration certificate, rc-wrp+jwt per ETSI TS 119 475, valid 30 days (step 03). kind verifier: dcql_query and purpose. kind issuer: attestations.\n- op=revoke: Revoke one of your access certificates.\n- op=delete: Remove a test organisation; its certificates are revoked.\n- op=anchor: Issuers: store the CA certificate your test issuer signs under. Our verifier then accepts its attestations in sessions started with sandbox=playground.\n- op=anchor-remove: Remove a trust anchor.",
    "parameters": [
     {
      "name": "op",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "org",
        "cert",
        "rc",
        "revoke",
        "delete",
        "anchor",
        "anchor-remove"
       ]
      }
     }
    ],
    "security": [
     {
      "apiKey": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "oneOf": [
         {
          "$ref": "#/components/schemas/Request_org"
         },
         {
          "$ref": "#/components/schemas/Request_cert"
         },
         {
          "$ref": "#/components/schemas/Request_rc"
         },
         {
          "$ref": "#/components/schemas/Request_revoke"
         },
         {
          "$ref": "#/components/schemas/Request_delete"
         },
         {
          "$ref": "#/components/schemas/Request_anchor"
         },
         {
          "$ref": "#/components/schemas/Request_anchor_remove"
         }
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "oneOf": [
          {
           "$ref": "#/components/schemas/Response_org"
          },
          {
           "$ref": "#/components/schemas/Response_cert"
          },
          {
           "$ref": "#/components/schemas/Response_rc"
          },
          {
           "$ref": "#/components/schemas/Response_revoke"
          },
          {
           "$ref": "#/components/schemas/Response_delete"
          },
          {
           "$ref": "#/components/schemas/Response_anchor"
          },
          {
           "$ref": "#/components/schemas/Response_anchor_remove"
          }
         ]
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     },
     "403": {
      "$ref": "#/components/responses/Error"
     },
     "404": {
      "$ref": "#/components/responses/Error"
     },
     "409": {
      "$ref": "#/components/responses/Error"
     },
     "429": {
      "$ref": "#/components/responses/Error"
     },
     "503": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/wrpac-ca.ashx": {
   "get": {
    "tags": [
     "Trust anchor"
    ],
    "summary": "The test trust anchor and its lists (step 04)",
    "description": "Exactly one of the valueless query parameters: ca (CA certificate, DER; add format=pem for PEM), crl (revocation list for access certificates), rc-status (status list for registration certificates), or registry=<id> (public register entry of a test organisation, JSON). No key needed.",
    "parameters": [
     {
      "name": "ca",
      "in": "query",
      "allowEmptyValue": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "format",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "pem"
       ]
      }
     },
     {
      "name": "crl",
      "in": "query",
      "allowEmptyValue": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "rc-status",
      "in": "query",
      "allowEmptyValue": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "registry",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "pg- and ten hex digits"
     }
    ],
    "security": [],
    "responses": {
     "200": {
      "description": "The requested object",
      "content": {
       "application/pkix-cert": {},
       "application/x-pem-file": {},
       "application/pkix-crl": {},
       "application/json": {}
      }
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  }
 }
}
