Public API · Signing requests · CodeB Wallet

Signing requests API.

Everything behind sign-request.html: upload PDFs, sign them with CodeB Wallet by scanning a QR code, and invite other people by e-mail to sign one after another. The wallet endpoints are capability URLs (128-bit step ids, rate-limited); the requester endpoints need the site’s sign-in.

Honest scope. Advanced electronic signatures with any wallet signature source; “qualified” only when the signer’s signature card states it in its certificate. Designed to follow ETSI TS 119 432 and ARF 3.0 topic 16; not certified. Walkthrough: Sign a PDF with CodeB Wallet.

How a signing request works

  1. A signed-in user creates a request on sign-request.html (or with api=create): 1–10 PDFs, the level (advanced, or qualified = a signature card whose certificate states a qualified signature), optionally “I sign first” and up to 5 invited people (guests: 2) in signing order.
  2. Whose turn it is gets a wallet link eudi-rqes://?client_id=x509_san_dns:<host>&request_uri=<host>/sign-request.ashx?r=<sid>: the requester as a QR code on the page, an invited person by e-mail.
  3. CodeB Wallet fetches the signed request object (?r=), checks it against the pinned CA (?ca), shows who asks and every document (?doc=), signs with the person's signature card (NFC) or the CodeB signing service, and posts the signed PDFs to ?respond= — or declines.
  4. The server checks each signed PDF: an incremental update of exactly the input, one verifying CMS signature, no changes that could hide or replace content; the PAdES level is reported. The next signer is then mailed; when everyone has signed, everyone gets a link to the signed PDF (?final=).

Wallet side designed to follow the OpenID4VP-based signing request of ETSI TS 119 432 and ARF 3.0 topic 16; not certified. “Qualified” is shown only when the signer's certificate states it; there is no trusted-list check. Your own turn stays open 24 hours, an invited person's 72 hours; requests are kept 30 days after they close. Each account sees only its own requests.

CodeB Wallet creates signing requests with this API too: share one or more PDFs to the app and choose who signs – see signing requests from the phone. Visible signature boxes keep a PDF/A-3 e-invoice valid (details).

Wallet and invited people (capability URLs)

GET /sign-request.ashx?ca Open #

The relying-party CA certificate the wallet pins (PEM).

Responses

  • 200 — PEM

GET /sign-request.ashx?r={sid} Open #

Signed request object of the active step (OpenID4VP, ETSI TS 119 432). Fresh ES256 JWT, typ oauth-authz-req+jwt, exp 15 minutes, x5c chain to the CA from ?ca. Claims: client_id x509_san_dns:<host>, response_mode direct_post, response_uri, state, nonce, signatureQualifier (eu_eidas_qes / eu_eidas_aes), documentDigests (label + SHA-256 per document), documentLocations (?doc URLs). The wallet link is eudi-rqes://?client_id=...&request_uri=<this URL>. When the requester placed a visible signature field for this signer: codeb_signature_fields = [{document (index into documentDigests), name (the empty field in the PDF, e.g. CodeB_Signer1), page, rect (hint for a preview; the field in the PDF counts), appearance (allowed: handwritten, id_image, name_only), required_visible, handwritten_image? {uri, hash}}]. handwritten_image is present only when the signer drew a signature on the web page (GET ?sigimg=); hash = SHA-256 of the PNG, base64. The answer must sign into exactly that field; when required_visible the field needs a visible appearance. A wallet that cannot show it answers error=access_denied with error_description=signature_appearance_unavailable.

Parameters

  • sid (path, required) — string

Responses

  • 200 — JWT
  • 404 — Unknown step
  • 409 — not_yet: earlier signers have not signed
  • 410 — request_closed
  • 429 — Rate limit

GET /sign-request.ashx?doc={sid}.{n}.{token} Open #

Input PDF n of the active step (original or the previous signer's PDF).

Parameters

  • sid (path, required) — string
  • n (path, required) — integer
  • token (path, required) — string

Responses

  • 200 — PDF
  • 404 — Unknown
  • 410 — Closed
  • 429 — Rate limit

POST /sign-request.ashx?respond={sid} Open #

Wallet answer (direct_post): signed PDFs or a decline. Each signed PDF must be an incremental update of the input, byte for byte, with one verifying CMS signature; changes that could hide or replace content are refused; the PAdES level is reported. Idempotent for the same state and body. When an invited signer's answer is accepted, a guest account's signatures for it do not count toward its daily limit. With a visible signature field for this signer the signed PDF must have signed exactly that field (position unchanged, no other field signed; with required_visible a visible appearance); otherwise the answer is refused.

Parameters

  • sid (path, required) — string

Request (application/x-www-form-urlencoded)

{
  "state": "...",
  "documentWithSignature": "...",
  "error": "user_cancelled"
}

Responses

  • 200 — Accepted
  • 400 — invalid_request or invalid_signed_document (with the reason)
  • 404 — Unknown
  • 410 — request_closed

200 example

{}

GET /sign-request.ashx?invite={sid} Open #

Invited person's page data (documents, who asks, own turn, wallet link, downloads). sign_field {width, height (points), drawn} is present on the person's turn when a visible signature field is placed for them and handwritten is allowed: the page offers to draw the signature (POST ?sigimg=).

Parameters

  • sid (path, required) — string

Responses

  • 200 — Page data
  • 404 — Unknown

200 example

{}

POST /sign-request.ashx?sigimg={sid} Open #

Store (or remove) the signature the signer drew on the web page. For the signer of the ACTIVE step when a visible signature field is placed for them and handwritten is allowed. Body: the drawing as a transparent PNG (twice the field size, longest side at most 1200 px, at most 100 KB). It is kept until the step ends (signed, declined, withdrawn or expired) and offered to the wallet as codeb_signature_fields[].handwritten_image. A new drawing replaces the old one; clear=1 (no body) removes it. 20 per minute per IP. The step id is the capability (no sign-in).

Parameters

  • sid (path, required) — string
  • clear (query) — 1 = remove the drawing

Request (image/png)

(the PNG itself)

Responses

  • 200 — Stored or removed
  • 400 — appearance_image_invalid (the PNG is not usable)
  • 404 — Unknown step
  • 409 — no_signature_field
  • 410 — request_closed (the step is not active)
  • 413 — appearance_image_invalid: more than 100 KB
  • 415 — invalid_request: image/png expected
  • 429 — Rate limit

200 example

{
  "drawn": true
}

GET /sign-request.ashx?sigimg={sid}.{token} Open #

The drawn signature (PNG) for the wallet. The URI in codeb_signature_fields[].handwritten_image of the request object. Answers only while the step is active. hash in the claim = SHA-256 of exactly these bytes, base64.

Parameters

  • sid (path, required) — string
  • token (path, required) — string

Responses

  • 200 — PNG
  • 404 — Unknown
  • 410 — request_closed
  • 429 — Rate limit

GET /sign-request.ashx?final={sid}.{n}.{token} Open #

Signed PDF for an invited signer, once everyone has signed.

Parameters

  • sid (path, required) — string
  • n (path, required) — integer
  • token (path, required) — string

Responses

  • 200 — PDF
  • 404 — Unknown or not yet signed

GET /sign-request.ashx?verify={sid}.{n}.{token} Open #

Signature report of the final signed PDF (invited signer). Same token as final=. Every signature in the PDF is checked: integrity of the signed revision, later changes, certificate and timestamp. No check against the EU trusted lists.

Parameters

  • sid (path, required) — string
  • n (path, required) — integer
  • token (path, required) — string

Responses

  • 200 — Report
  • 404 — Unknown or not yet signed
  • 503 — busy (two reports at a time)

200 example

{
  "status": "valid",
  "summary": "...",
  "size": 0,
  "trust_note": "...",
  "signatures": [
    {
      "index": 0,
      "revision_end": 0,
      "covers_whole_file": true,
      "subfilter": "...",
      "kind": "signature",
      "status": "valid",
      "integrity": true,
      "later_changes": "none",
      "later_changes_detail": "...",
      "signer": "..."
    }
  ]
}

Requester API (signed-in user)

Bearer access token of this site’s own sign-in (client codeb-admin). Any account, guests included.

POST /sign-request.ashx?api=create Bearer #

Create a signing request. 1-10 PDFs (40 MB each, 50 MB together), signature level qes (signature card whose certificate states a qualified signature) or aes, optional note, self=1 to sign first, invited e-mails in signing order (up to 5; guests 2; 20 invitations a day). Your own turn stays open 24 h, an invited person's 72 h; requests are kept 30 days after they close. The first invited signer is mailed at once when the requester does not sign first. Visible signature fields (optional): fields = JSON array [{"doc": n, "signer": 1-based signing position, "page": 1-based, "rect": [x1, y1, x2, y2] in PDF points}], at most one field per signer and document, at least 60 x 20 points, inside the page, at most 10 per document. Before the documents are hashed the server adds an empty signature field CodeB_Signer<n> per entry as an incremental update; the wallet signs into that field and draws the appearance. appearance = comma list of what the signer may use (handwritten, id_image, name_only; default all three); required_visible is no longer needed: a signer with a field always signs visibly (no invisible fallback). Without fields nothing changes. AI apps and agents: an access token from the MCP sign-in or from OpenID CIBA (scope sign_requests) works on api=create, list, status, invite, resend, withdraw, download, verify and verify-upload (not on delete, not on the card path); the request records via_agent.

Request (multipart/form-data)

{
  "file": [
    "(the file itself)"
  ],
  "label": [
    "..."
  ],
  "level": "qes",
  "note": "...",
  "self": "0",
  "invite": [
    "person@example.com"
  ],
  "fields": "[{\"doc\":0,\"signer\":1,\"page\":1,\"rect\":[72,90,272,150]}]",
  "appearance": "handwritten,id_image,name_only"
}

Responses

  • 200 — Created
  • 400 — invalid_request (with the reason)
  • 401 — Sign-in required
  • 409 — limit
  • 429 — slow_down

200 example

{
  "id": "...",
  "status": "open",
  "level": "qes",
  "note": "...",
  "created": "2026-10-16T10:00:00Z",
  "expires": "2026-10-16T10:00:00Z",
  "closed_at": "...",
  "keep_until": "...",
  "current": 0,
  "my_turn": true
}

GET /sign-request.ashx?api=list Bearer #

The signed-in user's own signing requests. Each account sees only its own requests.

Responses

  • 200 — List
  • 401 — Sign-in required

200 example

{
  "requests": [
    {
      "id": "...",
      "status": "open",
      "level": "qes",
      "note": "...",
      "created": "2026-10-16T10:00:00Z",
      "expires": "2026-10-16T10:00:00Z",
      "closed_at": "...",
      "keep_until": "...",
      "current": 0,
      "my_turn": true
    }
  ]
}

GET /sign-request.ashx?api=status Bearer #

One request (polled by the page). On the requester's own turn (my_turn) with a visible signature field placed for them: sign_field {width, height, drawn} and sid (the step id for POST ?sigimg=). Each signer also has fields: [{"doc","page","rect"}] - where that signer signs (empty without signature fields).

Parameters

  • id (query, required) — string

Responses

  • 200 — Request
  • 401 — Sign-in required
  • 404 — Not found or another account's

200 example

{
  "id": "...",
  "status": "open",
  "level": "qes",
  "note": "...",
  "created": "2026-10-16T10:00:00Z",
  "expires": "2026-10-16T10:00:00Z",
  "closed_at": "...",
  "keep_until": "...",
  "current": 0,
  "my_turn": true
}

POST /sign-request.ashx?api=invite Bearer #

Add invited signers at the end of an open request.

Request (application/json)

{
  "id": "...",
  "emails": [
    "person@example.com"
  ]
}

Responses

  • 200 — Request
  • 400 — invalid_request
  • 404 — not_found
  • 409 — not_open, already_invited or limit
  • 429 — slow_down

200 example

{
  "id": "...",
  "status": "open",
  "level": "qes",
  "note": "...",
  "created": "2026-10-16T10:00:00Z",
  "expires": "2026-10-16T10:00:00Z",
  "closed_at": "...",
  "keep_until": "...",
  "current": 0,
  "my_turn": true
}

POST /sign-request.ashx?api=resend Bearer #

Send the invitation e-mail again to the invited person whose turn it is. Owner only, open request; at most 3 times per signer, not twice within a minute; counts as an invitation for the daily limit. The summary's mail field says whether the mail was handed to the mail server.

Request (application/json)

{
  "id": "..."
}

Responses

  • 200 — Request
  • 404 — not_found
  • 409 — not_open, not_waiting, resend_limit or limit
  • 429 — slow_down
  • 502 — mail_failed: could not be handed to the mail server

200 example

{
  "id": "...",
  "status": "open",
  "level": "qes",
  "note": "...",
  "created": "2026-10-16T10:00:00Z",
  "expires": "2026-10-16T10:00:00Z",
  "closed_at": "...",
  "keep_until": "...",
  "current": 0,
  "my_turn": true
}

POST /sign-request.ashx?api=withdraw Bearer #

Withdraw an open request (the invited person whose turn it was is told).

Request (application/json)

{
  "id": "..."
}

Responses

  • 200 — Done
  • 404 — not_found
  • 409 — not_open

200 example

{}

POST /sign-request.ashx?api=delete Bearer #

Delete a request and its documents.

Request (application/json)

{
  "id": "..."
}

Responses

  • 200 — Done
  • 404 — not_found
  • 409 — not_open

200 example

{}

GET /sign-request.ashx?api=download Bearer #

Download an original or the (latest) signed PDF of an own request.

Parameters

  • id (query, required) — string
  • n (query, required) — integer
  • kind (query, required) — string

Responses

  • 200 — PDF
  • 400 — invalid_request
  • 404 — Not found or no longer kept

GET /sign-request.ashx?api=verify Bearer #

Signature report of an original or signed PDF of an own request. 30 per minute per account.

Parameters

  • id (query, required) — string
  • n (query, required) — integer
  • kind (query, required) — string

Responses

  • 200 — Report
  • 400 — invalid_request
  • 401 — Not signed in
  • 404 — Not found or no longer kept
  • 429 — slow_down
  • 503 — busy

200 example

{
  "status": "valid",
  "summary": "...",
  "size": 0,
  "trust_note": "...",
  "signatures": [
    {
      "index": 0,
      "revision_end": 0,
      "covers_whole_file": true,
      "subfilter": "...",
      "kind": "signature",
      "status": "valid",
      "integrity": true,
      "later_changes": "none",
      "later_changes_detail": "...",
      "signer": "..."
    }
  ]
}

POST /sign-request.ashx?api=verify-upload Bearer #

Signature report of any PDF (not stored). The body is the PDF itself (at most 40 MB). Nothing is stored. 10 per minute per account. The page sends a local file only when it contains signatures and the user asks for the check.

Request (application/pdf)

"(the file itself)"

Responses

  • 200 — Report
  • 400 — invalid_request (not a PDF)
  • 401 — Not signed in
  • 413 — Larger than 40 MB
  • 429 — slow_down
  • 503 — busy

200 example

{
  "status": "valid",
  "summary": "...",
  "size": 0,
  "trust_note": "...",
  "signatures": [
    {
      "index": 0,
      "revision_end": 0,
      "covers_whole_file": true,
      "subfilter": "...",
      "kind": "signature",
      "status": "valid",
      "integrity": true,
      "later_changes": "none",
      "later_changes_detail": "...",
      "signer": "..."
    }
  ]
}

POST /sign-request.ashx?api=inspect Bearer #

Page sizes and rotation of a PDF, to place signature fields. Body = the PDF (application/pdf, at most 40 MB; nothing is stored). Returns {"pages":[{"page","x1","y1","x2","y2","width","height","rotate"}],"page_count","size","min_field":[60,20],"max_fields_per_document":10}: each page's media box (inherited from the page tree) in PDF points and the page rotation (0/90/180/270), the same values the server uses to check fields in api=create. Place a field rect [x1,y1,x2,y2] inside the box (origin at its lower-left corner in PDF user space; for a rotated page convert from the displayed view). 30 calls a minute per account. Also for AI apps and agents with the permission sign_requests.

Responses

  • 200 — Pages
  • 400 — invalid_request (not a PDF, or it could not be read)
  • 401 — sign_in_required
  • 413 — Larger than 40 MB
  • 429 — slow_down

Signature card in the app: PAdES finished on the server

For a national eID card read by CodeB Wallet over NFC, the server builds the PDF signature and the card signs only one hash: card-prepare returns the SHA-256 of the CMS signed attributes, the card signs it with its signing key (PIN), card-finish embeds the signature and adds a signature time stamp, validation data (OCSP / CRL) and a document time stamp as far as they can be had (PAdES B-T, B-LT, B-LTA). The PDF never leaves the server. The result is checked like every other answer before the request continues. The signature is qualified only when the card’s certificate is a qualified certificate. Overview: National eID card in CodeB Wallet.

POST /sign-request.ashx?op=card-prepare Bearer + DPoP #

Signature card: prepare the PDF signature and get the hash the card signs. Step 1 of 2. For a signature card read by CodeB Wallet over NFC whose signing key cannot produce a PDF signature itself (the national eID card): the server builds the PDF signature, the phone only lets the card sign one hash. The PDF never leaves the server. Both calls need the signer's account access token (Authorization: Bearer, as the requester API) AND a DPoP proof; the session is bound to the account and to the DPoP key. JSON body at most 200 KB (card-finish: 64 KB). Limits: 30 per minute per IP; per hour 60 prepares / 120 finishes per IP and 30 / 60 per account. request_id is the step id from the request object link (?r=) or the request id (when the account is the requester signing its own step, or the invited e-mail address of the active step). certificate = the card's signing certificate (DER, base64url; RSA 2048-4096, keyUsage nonRepudiation, valid now; for a qes request it must state a qualified signature (qcStatements), self-signed is refused); chain = up to 4 issuing CA certificates (DER, base64url). The server adds an incremental update with an invisible signature field (SubFilter ETSI.CAdES.detached) to the PDF of this step and builds the CMS signed attributes (content-type, message-digest, ESS signing-certificate-v2, CMS algorithm protection). hash = SHA-256 of the DER signed attributes: the card signs it with RSASSA-PKCS1-v1_5 (the card adds the DigestInfo). The session lives 600 s; at most 3 open sessions per account. Several documents in one request: one session per document (document = n); the step completes when every document is signed. The DPoP proof must carry ath = base64url(SHA-256(access token)). The card certificate must chain to the national eID card CA certificates installed on the server (see eidmt-status) with keyUsage nonRepudiation and must pass the revocation check (OCSP / CRL, fails closed): otherwise 400 certificate_refused or 503 revocation_unavailable; with no CA installed card-prepare answers 503 not_configured. Visible signature field: when the requester placed a field for this signer, the server signs into that field (no invisible field) and draws the appearance: the image on the left (at most 45 % of the width), right of it "Digitally signed by", the name from the certificate (letters outside WinAnsi without the diacritic) and "<yyyy-MM-dd HH:mm UTC> · CodeB Wallet". appearance = handwritten | id_image | name_only (default: handwritten when an image is sent, else name_only); appearance_image = PNG, base64url, at most 100 KB, longest side at most 1200 px, not interlaced. Without a field both are ignored. 400 appearance_image_invalid (image not usable), 400 invalid_request (appearance not allowed for this request), 422 signature_appearance_unavailable (the request allows only image kinds and no image was sent).

Request (application/json)

{
  "request_id": "Zt3pQ8vK1mWc",
  "certificate": "MIIF...base64url DER...",
  "chain": [
    "MIIG...issuing CA..."
  ],
  "document": 0,
  "appearance": "handwritten",
  "appearance_image": "(PNG, base64url)"
}

Responses

  • 200 — Prepared
  • 400 — invalid_certificate (with the reason) / invalid_request (request_id, document) / certificate_refused (chain to the installed eID CAs, key usage or revocation)
  • 401 — sign_in_required (Bearer) or invalid_dpop_proof (WWW-Authenticate: DPoP)
  • 404 — not_found: unknown request, or the account is not the signer of the active step
  • 405 — method_not_allowed
  • 409 — not_yet: the earlier signers have not signed yet
  • 410 — request_closed
  • 415 — invalid_request: application/json expected
  • 422 — unsupported_document: the PDF cannot take an incremental signature (with the reason)
  • 429 — rate_limited / slow_down
  • 503 — not_configured (no national eID CA certificates installed) / revocation_unavailable (OCSP / CRL could not be checked)

200 example

{
  "session": "q9Wd2LrX7cVb",
  "hash": "x3Jt0k3bTq4Wm2u7lq3l0c9yJ8d1Pz6hV5sG4fE2aB0",
  "algorithm": "RSASSA-PKCS1-v1_5-SHA256",
  "expires_in": 600
}

POST /sign-request.ashx?op=card-finish Bearer + DPoP #

Signature card: send the card's signature; the server finishes and checks the PAdES signature. Step 2 of 2. For a signature card read by CodeB Wallet over NFC whose signing key cannot produce a PDF signature itself (the national eID card): the server builds the PDF signature, the phone only lets the card sign one hash. The PDF never leaves the server. Both calls need the signer's account access token (Authorization: Bearer, as the requester API) AND a DPoP proof; the session is bound to the account and to the DPoP key. JSON body at most 64 KB. Limits: 30 per minute per IP; per hour 60 prepares / 120 finishes per IP and 30 / 60 per account. signature = the raw RSA PKCS#1 v1.5 signature of hash (base64url). The server checks it against the certificate and the prepared hash, builds the CMS and embeds it, then adds what can be had: a signature time stamp (PAdES B-T), OCSP responses / CRLs in a DSS (B-LT) and a document time stamp (B-LTA). Every level reached is validated like a signature from the wallet, the highest one that passes is delivered and the step continues (next signer or completion). level says what was reached; reason says why a higher level was not reached. The signature is qualified only when the card's certificate is a qualified certificate; the PAdES level does not make it qualified. The session is used up by this call, also when it fails. The DPoP proof must carry ath = base64url(SHA-256(access token)). The card certificate must chain to the national eID card CA certificates installed on the server (see eidmt-status) with keyUsage nonRepudiation and must pass the revocation check (OCSP / CRL, fails closed): otherwise 400 certificate_refused or 503 revocation_unavailable; with no CA installed card-prepare answers 503 not_configured.

Request (application/json)

{
  "session": "q9Wd2LrX7cVb",
  "signature": "Vb8...base64url..."
}

Responses

  • 200 — Signed
  • 400 — signature_invalid (prepare again) / invalid_certificate / invalid_signed_document / invalid_request / certificate_refused (chain to the installed eID CAs, key usage or revocation)
  • 401 — sign_in_required or invalid_dpop_proof
  • 409 — session_expired: unknown, used, expired, or of another account or DPoP key - prepare again
  • 410 — request_closed
  • 415 — invalid_request
  • 429 — rate_limited / slow_down
  • 500 — server_error: the signature could not be built
  • 503 — not_configured (no national eID CA certificates installed) / busy / revocation_unavailable (OCSP / CRL could not be checked)

200 example

{
  "status": "signed",
  "level": "B-LTA"
}

AI apps and agents: MCP sign-in, OpenID CIBA and MCP

An AI app connects with one address: the person adds https://phone.codeb.io/mcp to the app, the app finds the sign-in by itself (RFC 9728 → RFC 8414, issuer https://phone.codeb.io/mcp-auth), the person signs in and chooses Allow on mcp-connect.html, and the app receives one-hour access tokens (scope = the permissions the person ticked: sign_requests, age_checks, meetings, cards for administrators; renewed with a rotating refresh token) for the MCP server and, with sign_requests, this API. Agents without a screen use OpenID CIBA instead: the agent asks, the person approves on agent-approvals.html. Apps and agents never sign and cannot delete requests; the person removes them on agent-approvals.html. Guide: AI agents.

Desktop programs and scripts: agents (OpenID CIBA) #

A program without a browser window of its own – an invoicing tool, a PDF editor, a script on a server – signs in to this API as an agent: its own login with OpenID CIBA (poll mode), never the person’s password. An agent prepares, follows, withdraws and downloads signing requests for one person. It can never sign: every signature is made by that person in CodeB Wallet.

1. Create the agent (once per installation)

  • The person signs in on Your agents and, under Agents you added, enters a name they will recognise (for example the PC and program: “Office PC – invoicing”) and chooses Add agent.
  • The page then shows client_id (the agent ID, agent- followed by 32 hex characters), client_secret, login_hint (the person’s user name), the CIBA and token endpoints and two sample requests.
  • The secret is shown only this once and cannot be displayed again or renewed. If it is lost, remove the agent and add a new one (the new agent has a new ID).
  • Use one agent per installation, so removing one PC does not affect the others. At most 10 agents per account.

2. Keep the secret safe

  • Store client_id and secret protected for the Windows user (DPAPI / Windows Credential Manager) or in the secret store of your server – never as text in code samples, shared configuration files, documents or logs.
  • Removing the agent on Your agents ends it: its open approval requests end, and tokens it already holds stop working within a minute.

3. Sign in (each time the program needs access)

  1. POST the backchannel authentication request with client_id + secret, scope=openid sign_requests, login_hint and a short binding_message (at most 64 characters, for example a 4-digit code) – show the same code in your program.
  2. The person gets an e-mail and sees the request with the agent’s name and the code on Your agents; they compare the code and approve or deny. A request is open for 5 minutes by default (requested_expiry 60–600 s); at most 2 open requests per agent.
  3. Poll the token endpoint with grant_type=urn:openid:params:grant-type:ciba and the auth_req_id every interval seconds (5): authorization_pending = keep waiting, slow_down = wait longer, access_denied / expired_token = stop.
  4. After approval the program gets an access token for this API, valid for 1 hour. There is no refresh token: after that hour the program asks again.

4. Use the API

  • Send the token as Authorization: Bearer … to api=create, api=status, api=invite, api=withdraw and api=download. api=delete stays with the person (403 not_for_agents).
  • On the person’s own turn api=status returns my_turn: true and link – show it as a QR code so the person can sign with CodeB Wallet without leaving your program.

Agents do not expire on their own; they stay until the person removes them. Apps connected through the MCP sign-in (no secret) are different: their access ends after 30 days without use.

GET /.well-known/oauth-protected-resource/mcp Open #

Protected Resource Metadata of the MCP server at /mcp (RFC 9728). resource = https://phone.codeb.io/mcp, authorization_servers = [https://phone.codeb.io/mcp-auth], scopes_supported [sign_requests, age_checks, meetings, cards], bearer_methods_supported [header]. The 401 of /mcp points here in WWW-Authenticate resource_metadata. /mcp.ashx has the same document with resource https://phone.codeb.io/mcp.ashx (/.well-known/oauth-protected-resource/mcp.ashx or /mcp.ashx?resource-metadata).

Responses

  • 200 — resource, authorization_servers, scopes_supported, bearer_methods_supported

GET /.well-known/oauth-authorization-server/mcp-auth Open #

OAuth 2.0 Authorization Server Metadata of the MCP sign-in (RFC 8414). Issuer https://phone.codeb.io/mcp-auth (RFC 8414 path insertion). authorization_endpoint /mcp-auth/authorize, token_endpoint /mcp-auth/token, registration_endpoint /mcp-auth/register, revocation_endpoint /mcp-auth/revoke; response_types [code]; grant_types [authorization_code, refresh_token]; code_challenge_methods_supported [S256]; token_endpoint_auth_methods_supported [none] (public clients); scopes_supported [sign_requests, offline_access]; client_id_metadata_document_supported true; authorization_response_iss_parameter_supported true (RFC 9207). Separate from the OpenID provider of the site: the sign-in of people and of CodeB Wallet is unchanged.

Responses

  • 200 — Authorization server metadata

GET /mcp-auth/authorize Open #

MCP sign-in: authorization request of an AI app (OAuth 2.1 authorization code + PKCE). MCP authorization (2026-07-28). client_id = the HTTPS URL of the app's Client ID Metadata Document (fetched by the server: https only, public addresses only, no redirects, at most 5 KB, client_id must equal the URL, no client secret; cached one hour) or a client_id from /mcp-auth/register. redirect_uri must be one of the app's redirect_uris (https, or http on localhost/127.0.0.1/[::1] with any port). response_type=code, code_challenge with code_challenge_method=S256 (required), resource = https://phone.codeb.io/mcp or https://phone.codeb.io/mcp.ashx (RFC 8707; default /mcp), scope: any of sign_requests, age_checks, meetings, cards (none = all four; offline_access and openid are accepted; the consent page shows one checkbox per permission, cards only to administrators). The person is sent to /mcp-connect.html, signs in as usual and sees the app name, its website (for metadata documents), the host it returns to and a warning for localhost apps; Allow redirects back with code, state and iss (RFC 9207), Deny with error=access_denied. An invalid client_id or redirect_uri is never redirected to.

Request

GET /mcp-auth/authorize?response_type=code&client_id=https%3A%2F%2Fapp.example%2Foauth%2Fclient.json&redirect_uri=http%3A%2F%2F127.0.0.1%3A33418%2Fcallback&code_challenge=E9Mel...&code_challenge_method=S256&resource=https%3A%2F%2Fphone.codeb.io%2Fmcp&scope=sign_requests&state=af0ifjsldkj

Responses

  • 302 — To /mcp-connect.html (consent) or back to redirect_uri with error, state and iss

POST /mcp-auth/token Open #

MCP sign-in: token request (authorization_code with PKCE, refresh_token). Public clients only (no client secret). grant_type=authorization_code: code (once, 2 minutes; a second use ends the connection), redirect_uri, client_id, code_verifier (S256), resource optional (must equal the authorization request). grant_type=refresh_token: refresh_token, client_id; the refresh token is rotated on every use (30 days), presenting a rotated-away one ends the connection. Answer: access_token (JWT, 1 hour, aud = the MCP server URL, scope = the permissions the person ticked, act.sub = client_id, role agent - guest for a guest account), token_type Bearer, expires_in, refresh_token, scope. The token works only on the MCP server and the signing requests API, never as a sign-in; it stops working within a minute when the person removes the app.

Request

grant_type=authorization_code&code=...&redirect_uri=http%3A%2F%2F127.0.0.1%3A33418%2Fcallback&client_id=https%3A%2F%2Fapp.example%2Foauth%2Fclient.json&code_verifier=...&resource=https%3A%2F%2Fphone.codeb.io%2Fmcp

Responses

  • 200 — Tokens
  • 400 — invalid_grant, invalid_target, unsupported_grant_type, invalid_request
  • 401 — invalid_client (client authentication sent)
  • 429 — Rate limit

POST /mcp-auth/register Open #

MCP sign-in: dynamic client registration (RFC 7591, for apps without a Client ID Metadata Document). Public clients only: redirect_uris (1-10; https, or http on localhost/127.0.0.1/[::1]), client_name (shown to the person as given, marked as not confirmed by a website), client_uri, grant_types (authorization_code, refresh_token), response_types (code). token_endpoint_auth_method is always none. Rate limited per address.

Request

{"client_name":"My AI app","redirect_uris":["http://127.0.0.1:33418/callback"],"grant_types":["authorization_code","refresh_token"],"token_endpoint_auth_method":"none"}

Responses

  • 201 — client_id, client_id_issued_at, client_name, redirect_uris, grant_types, response_types, token_endpoint_auth_method
  • 400 — invalid_redirect_uri, invalid_client_metadata
  • 429 — Rate limit

POST /mcp-auth/revoke Open #

MCP sign-in: revoke a refresh token (RFC 7009). token = the app's refresh token: the connection ends. Always 200.

Responses

  • 200 — Done

GET /oidc.ashx?action=mcp-request Bearer #

Consent page: what an app asks for. Used by mcp-connect.html. id = the request id from the page fragment. Returns client_name, client_id, client_uri, verified_site (host of the metadata document URL; null for registered apps), redirect_host, localhost, scope (the permissions the app asks for), resource, user, is_admin (whether the page may offer cards), expires_in (seconds; requests last 15 minutes).

Responses

  • 200 — Request details
  • 401 — login_required
  • 404 — not_found (expired)

POST /oidc.ashx?action=mcp-decide Bearer #

Consent page: allow or deny an app. Body {"id","decision":"allow"|"deny","scopes":[permissions the person ticked]} (scopes optional: missing = all the app asked for; cards only for administrators; allow with an empty list gives 400). Returns {"ok":true,"redirect":"<redirect_uri with code, state, iss or error=access_denied>"}; the page navigates there. A request can be decided once.

Responses

  • 200 — ok + redirect
  • 401 — login_required
  • 409 — not_possible (expired or already answered)

GET /oidc.ashx?action=mcp-connections Bearer #

The apps the person connected. Returns {"connections":[{"id","name","client_id","redirect_host","created","last_used"}],"mcp_url":"https://phone.codeb.io/mcp"}. Each connection also has scope (the permissions the person ticked).

Responses

  • 200 — Connections
  • 401 — login_required

POST /oidc.ashx?action=mcp-connection-delete Bearer #

Remove a connected app. Body {"id"}. The app's refresh token ends at once, its access token within a minute.

Responses

  • 200 — ok
  • 401 — login_required
  • 404 — not_found

POST /oidc.ashx?action=bc-authorize Agent client #

OpenID CIBA backchannel authentication request of an agent. OpenID Connect Client-Initiated Backchannel Authentication Core 1.0, poll mode (discovery: backchannel_authentication_endpoint, backchannel_token_delivery_modes_supported [poll]). The agent client (created by the person on agent-approvals.html; client_id agent-<32 hex>) authenticates with client_secret_basic or client_secret_post and asks its owner: login_hint = the owner's user name or e-mail, scope = 'openid sign_requests' (nothing else is available to agents), binding_message = a short code (at most 64 characters) the agent also shows, requested_expiry 60-600 s (default 300). The person gets an e-mail and approves or denies on agent-approvals.html. Then poll the token endpoint with grant_type=urn:openid:params:grant-type:ciba and the auth_req_id every interval seconds. Signed requests (request), login_hint_token, id_token_hint and user_code are not supported. At most 2 open requests per agent and 5 per person (access_denied); the person gets at most one e-mail every five minutes per agent. Rate limits per address and per agent (429 slow_down). Clients other than agent clients get unauthorized_client.

Request

scope=openid sign_requests&login_hint=alice&binding_message=4711  (client_secret_basic)

Responses

  • 200 — Request accepted
  • 400 — invalid_request, invalid_scope, unknown_user_id (not the agent's owner), invalid_binding_message
  • 401 — invalid_client
  • 429 — slow_down: too many open requests

200 example

{
  "auth_req_id": "...",
  "expires_in": 300,
  "interval": 5
}

POST /oauth2/v1/token Agent client #

OpenID CIBA token request of an agent (grant urn:openid:params:grant-type:ciba). CIBA (poll mode): until the person decides the answer is 400 authorization_pending; polling faster than interval gives slow_down (interval +5 s); then access_denied, expired_token, or 200 with access_token (1 hour, aud = the agent client, scope sign_requests, act.sub = the agent, role agent - guest for a guest account -, no auth_time) and id_token; no refresh_token. The auth_req_id can be redeemed once. A token of an agent is accepted only by the signing requests API and the MCP server; every other endpoint (including userinfo and token introspection without resource=sign_requests) treats it as invalid, and it stops working within a minute after the person removes the agent.

Request

grant_type=urn:openid:params:grant-type:ciba&auth_req_id=...  (client_secret_basic)

Responses

  • 200 — Access + optionally id + refresh tokens
  • 400 —

200 example

{
  "access_token": "...",
  "token_type": "Bearer",
  "expires_in": 3600,
  "id_token": "...",
  "scope": "openid sign_requests"
}

GET /oidc.ashx?action=agent-approvals Bearer #

The person's open agent requests (to approve or deny). Bearer = the person's own access token (aud codeb-admin; agent tokens are refused). Used by agent-approvals.html.

Responses

  • 200 — Open requests
  • 401 — login_required

POST /oidc.ashx?action=agent-decide Bearer #

Approve or deny an agent request. Bearer = the person's own access token. An approval lets the agent collect one access token (1 hour, scope sign_requests) at the token endpoint.

Request

{"id": "...", "decision": "approve"}

Responses

  • 200 — Done
  • 400 — invalid_request
  • 401 — login_required
  • 409 — not_possible: unknown, already answered, expired or agent removed

GET /oidc.ashx?action=agent-clients Bearer #

The person's agents and the endpoints they use.

Responses

  • 200 — Agents
  • 401 — login_required

POST /oidc.ashx?action=agent-client-create Bearer #

Add an agent (client_id + client_secret, the secret is shown once). At most 10 agents per person. An agent client may only ask its owner (login_hint).

Request

{"name": "Contracts assistant"}

Responses

  • 200 — Created
  • 400 — invalid_request
  • 401 — login_required

POST /oidc.ashx?action=agent-client-delete Bearer #

Remove an agent. Its open requests end at once; an access token it already holds stops working within a minute.

Request

{"client_id": "agent-..."}

Responses

  • 200 — Removed
  • 401 — login_required
  • 404 — not_found

POST /mcp.ashx Bearer #

MCP server 'CodeB' (Model Context Protocol, Streamable HTTP, JSON responses). JSON-RPC 2.0 messages: initialize (protocol versions 2025-06-18, 2025-03-26, 2024-11-05), ping, tools/list, tools/call; notifications get 202. No server-sent event stream, no session id, no batches. Also at the clean address /mcp, the address people paste into their AI app (same server). Bearer = the access token of an app the person allowed with the MCP sign-in (authorization server https://phone.codeb.io/mcp-auth; aud = this server's URL) or of an agent that received it through OpenID CIBA after the person's approval (oidc.ashx?action=bc-authorize, then the token endpoint with grant_type urn:openid:params:grant-type:ciba). No other token is accepted. Agent tokens are accepted only here and by the signing requests API, and stop working within a minute after the person removes the agent. Without a valid token: 401 with WWW-Authenticate resource_metadata (RFC 9728). Messages that cannot be parsed or are not valid JSON-RPC get HTTP 400; JSON-RPC responses sent by the client get 202. Only for hosts this site serves. Tools: inspect_pdf, create_signing_request (documents, level aes|qes, sign_myself, invite, note, signature_fields with rect or position bottom-left|bottom-center|bottom-right, appearance, required_visible; at most 12 MB of PDFs), list_signing_requests, get_signing_request, invite_signers, resend_invitation, withdraw_signing_request, get_document (at most 8 MB), verify_document. The tools use the signing requests API with the same token, so all its rules apply. Agents cannot sign and cannot delete requests. Requests with a foreign Origin are refused. Permissions (scopes) the person ticks when connecting the app: sign_requests (the signing tools above), age_checks (create_age_check {reference, days 1-30}, get_age_check, list_age_checks, cancel_age_check: a link /check?c=<id> for one customer, who confirms 18+ with an EUDI wallet (proof of age eu.europa.ec.av.1); the app gets only age_over_18 true/false, nobody is signed in), meetings (create_meeting {title, start ISO 8601 with time zone, duration_minutes 5-720, note, invite[] up to 20 e-mail addresses}, list_meetings, get_meeting, invite_to_meeting, cancel_meeting: a browser video meeting room.html?room=mt-..., e-mail invitations with invite.ics; at most 100 invitation e-mails per person and day; guest accounts cannot e-mail invitations), cards (administrators only: list_card_templates, issue_card {template_id, member, delivery email_link|sign_in|wallet, days, given_name + family_name for a new guest}, list_card_offers, revoke_card_offer; existing templates only). tools/list shows only the tools of the token's permissions; other tools answer isError. Agents connected with OpenID CIBA keep sign_requests only.

Request

{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}

Responses

  • 200 — JSON-RPC response
  • 202 — Notification accepted
  • 401 — Authorization required (WWW-Authenticate: Bearer resource_metadata=...)
  • 403 — Origin not allowed
  • 405 — GET/DELETE: no event stream, no sessions
  • 413 — Larger than 20 MB
  • 415 — application/json expected
  • 429 — Rate limit

POST /mcp Bearer #

MCP server 'CodeB' at the clean address /mcp (the address people paste into their AI app). JSON-RPC 2.0 messages: initialize (protocol versions 2025-06-18, 2025-03-26, 2024-11-05), ping, tools/list, tools/call; notifications get 202. No server-sent event stream, no session id, no batches. Also at /mcp.ashx (same server). Bearer = the access token of an app the person allowed with the MCP sign-in (authorization server https://phone.codeb.io/mcp-auth; aud = this server's URL) or of an agent that received it through OpenID CIBA after the person's approval (oidc.ashx?action=bc-authorize, then the token endpoint with grant_type urn:openid:params:grant-type:ciba). No other token is accepted. Agent tokens are accepted only here and by the signing requests API, and stop working within a minute after the person removes the agent. Without a valid token: 401 with WWW-Authenticate resource_metadata (RFC 9728). Messages that cannot be parsed or are not valid JSON-RPC get HTTP 400; JSON-RPC responses sent by the client get 202. Only for hosts this site serves. Tools: inspect_pdf, create_signing_request (documents, level aes|qes, sign_myself, invite, note, signature_fields with rect or position bottom-left|bottom-center|bottom-right, appearance, required_visible; at most 12 MB of PDFs), list_signing_requests, get_signing_request, invite_signers, resend_invitation, withdraw_signing_request, get_document (at most 8 MB), verify_document. The tools use the signing requests API with the same token, so all its rules apply. Agents cannot sign and cannot delete requests. Requests with a foreign Origin are refused. Permissions (scopes) the person ticks when connecting the app: sign_requests (the signing tools above), age_checks (create_age_check {reference, days 1-30}, get_age_check, list_age_checks, cancel_age_check: a link /check?c=<id> for one customer, who confirms 18+ with an EUDI wallet (proof of age eu.europa.ec.av.1); the app gets only age_over_18 true/false, nobody is signed in), meetings (create_meeting {title, start ISO 8601 with time zone, duration_minutes 5-720, note, invite[] up to 20 e-mail addresses}, list_meetings, get_meeting, invite_to_meeting, cancel_meeting: a browser video meeting room.html?room=mt-..., e-mail invitations with invite.ics; at most 100 invitation e-mails per person and day; guest accounts cannot e-mail invitations), cards (administrators only: list_card_templates, issue_card {template_id, member, delivery email_link|sign_in|wallet, days, given_name + family_name for a new guest}, list_card_offers, revoke_card_offer; existing templates only). tools/list shows only the tools of the token's permissions; other tools answer isError. Agents connected with OpenID CIBA keep sign_requests only.

Responses

  • 200 — JSON-RPC response
  • 202 — Notification or JSON-RPC response accepted
  • 401 — Sign-in required: WWW-Authenticate: Bearer resource_metadata="https://<host>/.well-known/oauth-protected-resource/mcp", scope="sign_requests age_checks meetings cards"
  • 403 — Origin not allowed
  • 405 — GET/DELETE: no event stream, no sessions
  • 413 — Larger than 20 MB
  • 415 — application/json expected
  • 429 — Rate limit
  • 400 — Parse error or invalid JSON-RPC message (JSON-RPC error in the body); unsupported MCP-Protocol-Version
  • 404 — Unknown host

GET /check?c=<id> Open #

Age check page for a customer (created by an AI app with the permission age_checks). HTML page (English or German by browser language). c = the age check id from create_age_check (a bearer link: no-store, no-referrer, noindex). The customer starts a wallet request (POST /check.ashx?api=start&c=<id> -> {link: openid4vp://...}, also shown as a QR code) and the page polls GET /check.ashx?api=status&c=<id> -> {status: open|waiting|done|cancelled|expired, age_over_18 when done}. The site's verifier asks only for age_over_18 of a proof of age (eu.europa.ec.av.1); nobody is signed in; the requester learns only yes or no. 60 requests per minute per address; the verifier's own limits apply to the customer's address.

Responses

  • 200 — The page
  • 404 — Unknown age check (page with a message)
  • 429 — Too many requests

GET /mcp.ashx?resource-metadata Open #

OAuth 2.0 Protected Resource Metadata of the MCP server (RFC 9728).

Responses

  • 200 — resource, authorization_servers, scopes_supported, bearer_methods_supported

Frequently asked questions

Can an AI app or agent prepare signing requests?

Yes, after the person allows it. An AI app: add https://phone.codeb.io/mcp as a connector or MCP server, sign in and choose Allow (MCP sign-in, OAuth 2.1 with PKCE). An agent without a screen: OpenID CIBA (oidc.ashx?action=bc-authorize, then the token endpoint with grant_type urn:openid:params:grant-type:ciba). Both get tokens with scope sign_requests for this API and the MCP server. Every signature is still made by a person in CodeB Wallet.

Can a request place visible signature fields?

Yes. api=create takes fields (one box per signer: document, signer position, page, rect in PDF points), appearance (handwritten, id_image, name_only; at least one; the signer chooses one). A signer with a field always signs visibly. The server adds an empty signature field per box before hashing; each signer fills their field in CodeB Wallet with a drawn signature, the signature image from the ID document or their name, plus the PAdES signature. Step-by-step guide: howto-signature-fields.html.

How do I ask several people to sign a PDF with CodeB Wallet?

Open sign-request.html, sign in, upload the PDF, choose whether you sign first and enter the e-mail addresses of the people who should sign, in order. Each person gets an e-mail when it is their turn and signs in CodeB Wallet; at the end everyone gets a link to the signed PDF.

Which signatures can be used?

Advanced: any signature source in CodeB Wallet, the person's signature card or the CodeB signing service. Qualified: only a signature card whose certificate states a qualified signature. CodeB shows 'qualified' only as stated in the certificate; it does not check the EU trusted lists.

What does the server check on a signed PDF?

That it is an incremental update of exactly the PDF the signer received, with one CMS signature that verifies and a certificate valid at the signing time, and that no change could hide or replace content. The PAdES level (B-B, B-T, B-LT, B-LTA) is reported.

Did my invitation e-mail go out?

The request list shows for the invited person whose turn it is whether the e-mail was handed to the mail server or failed, and a 'Send e-mail again' button (at most 3 times, once a minute).

Can I see and check the signatures in a PDF?

Yes. The viewer on sign-request.html lists every signature on the right, like a desktop PDF reader: whether the signed part is unchanged, whether anything was changed afterwards, who signed, the certificate and any timestamp. The same report is available from the API (api=verify, api=verify-upload, verify=). Certificates are not checked against the EU trusted lists.

Do the signatures get a time stamp?

Yes, when a time-stamp server answers: CodeB Wallet asks the CodeB time-stamp service (/rqes/csc/v2/signatures/timestamp, then /rqes/csc/v2/signatures/tsa as fallback) and embeds the token, so the signature is PAdES-B-T. If neither answers, the PDF is signed without a time stamp (PAdES-B-B). The signature report shows which one a signature has.

Do invited signatures count against a guest account's daily limit?

No. A guest account can sign 5 documents per UTC day with the CodeB signing service; signatures given as an invited signer in someone else's request are given back once the request accepts the signed PDF.

Can I sign a PDF with my national eID card?

Yes, when CodeB Wallet reads the card: the server prepares the PDF signature and sends the phone only the hash to sign (card-prepare), the card signs it after you enter its PIN, and the server finishes the PAdES signature with a time stamp and validation data as far as they can be had (card-finish). The PDF stays on the server. The signature is qualified only when the card's certificate is a qualified certificate.

Machine-readable: /openapi.json (OpenAPI 3.1, also at /.well-known/openapi.json) · All public APIs · Questions