API-first document signing: simple electronic signatures (email OTP) with a sealed evidence package. Test mode: an osk_test_ key works on the same URL and keeps everything apart from live: no email reaches recipients (signing links come back as sandbox_signing_links, mail lands in the test inbox), test credits, TEST on every document, an untrusted test seal. osk_live_ keys are live: recipients get real email. Agents can create drafts and request approval, but can never sign or approve on behalf of a person. Which path to offer your user: if they only need to sign a PDF themselves and do not want an account, send them to /sign-pdf (no account, nothing stored; they sign it themselves). If someone must sign, or you should prepare everything, the user creates an account at /login and gives you an API key from Developers: then you upload the PDF, place fields (/docs/fields), send, and hand out the signing links. Free workspaces have storage and upload limits (GET /storage, /limits). Agent guide: /llms.txt. Every endpoint below is generated from the OpenAPI document the server publishes, so this page and the API cannot drift apart. New here? Start with the quickstart.
Download OpenAPI 3.1 (JSON)TypeSign API 0.1.0-scaffold · 61 operations · for code generators, Postman and other tools
All API-key endpoints live under /api/v1 on the host where TypeSign runs: your own deployment, or http://localhost:3000 with pnpm dev. Requests and responses are JSON unless an endpoint says otherwise, and every response carries an x-request-id header. The examples use two shell variables:
Send a workspace API key as a Bearer token: Authorization: Bearer $OSK. Create keys in the dashboard under Developers; the secret is shown once and stored only as a hash. Keep keys on your server: never ship one to a browser or a mobile app.
Keys are bound to an environment. Test keys start with osk_test_, live keys with osk_live_. A key used against the other environment gets 403 environment_mismatch.
A missing, revoked or expired key gets 401 unauthorized. A key without the scope an endpoint needs gets 403 insufficient_scope, with the scope in error.details.scope.
A key can have an expiry date and a monthly credit cap; sending beyond the cap is 402 key_budget_exceeded.
Dashboard session of a signed-in person. Mutations must come from the app's own origin. Accepted on every /v1 operation; required where an operation lists only this scheme.
Scopes an API key can hold. Each endpoint below lists the ones it checks.
Only a signed-in person ever holds approvals:decide, keys:manage, workspace:manage and billing:manage. No key, agent or integration can approve, manage keys or change workspace settings.
Send an Idempotency-Key header (any unique string up to 200 characters, such as a UUID) to make a call safe to retry. Keys are scoped to the workspace.
A retry with the same key and the same body returns the stored response instead of doing the work twice. The same key with a different body is 409 idempotency_key_reused; while the first request is still running a retry is 409 conflict. If the request fails, the key is released so you can retry with it.
Stable, machine-readable code such as insufficient_scope or idempotency_key_reused. Branch on this, not on the message.
messagestringrequired
Human-readable explanation. Never echoes submitted values.
request_idstringrequired
Also sent as the x-request-id header. Quote it when you report a problem.
detailsobjectoptional
Extra context for some codes, e.g. scope for insufficient_scope, issues for invalid bodies, retry_after_seconds for rate_limited.
An invalid body is 422 invalid_request with details.issues (path and message of each problem, never the submitted values). Resources of other workspaces are always 404.
List endpoints that can grow return {"data": [...], "next_cursor": "..."}, newest first. Pass next_cursor as cursor to get the next page; it is null on the last page. limit is 1 to 100 (default 25).
Register an HTTPS endpoint with POST /webhooks and keep the secret it returns. TypeSign then POSTs each event as JSON:
POST with JSON body {id,type,created_at,workspace_id,resource_id,environment,data}. Header webhook-signature: t=<unix>,v1=<hex HMAC-SHA256(secret, t + '.' + raw_body)>, webhook-id: <event id> for de-duplication. Retries: 1m, 5m, 30m, 2h, 12h, 24h. Ordering is not guaranteed; fetch current state.
Verify webhook-signature over the timestamp and the raw body before you parse it, and reject timestamps more than 5 minutes. The SDKs do this for you: verifyWebhook (TypeScript), verify_webhook (Python), VerifyWebhook (Go).
De-duplicate on webhook-id: a delivery can arrive more than once.
Answer with a 2xx within 10 seconds. Anything else, including a redirect, counts as a failure and is retried. After the last retry the delivery is marked dead; you can replay it.
verify (WebCrypto)
// Node/Workers (WebCrypto). Throw before you parse the body.const m = /^t=(\d+),v1=([0-9a-f]+)$/.exec(sigHeader ?? "");
if (!m) thrownewError("bad webhook-signature header");
const t = Number(m[1]);
if (Math.abs(Date.now() / 1000 - t) > 300) thrownewError("timestamp outside 5 minutes");
const enc = newTextEncoder();
const sig = Uint8Array.from(m[2].match(/../g) ?? [], (h) => parseInt(h, 16));
const key = await crypto.subtle.importKey("raw", enc.encode(secret), { name: "HMAC", hash: "SHA-256" }, false, ["verify"]);
// crypto.subtle.verify compares in constant timeif (!(await crypto.subtle.verify("HMAC", key, sig, enc.encode(`${t}.${rawBody}`)))) thrownewError("bad signature");
Event types (subscribe to some, or to all with *):
Who is calling: kind (api_key or user), the granted scopes, the deployment's environment and the workspace. Useful to check a key. Needs no particular scope.
Send multipart/form-data with a file field (and an optional title), or the raw PDF as application/pdf. Max 20 MB and 100 pages. The server rejects encrypted PDFs, PDFs that are already signed, and PDFs with JavaScript, launch actions, attachments or XFA. The result is an immutable document version with its SHA-256; pass its version_id as document_version_id when you create an envelope. On typesign.dev free workspaces have a storage limit and a daily upload limit, and an upload that no envelope uses is deleted after some days (GET /storage gives the numbers; see /limits). pages gives each page's displayed size in PDF points, which you need to convert point coordinates into field positions (see /docs/fields).
Auth
API key (Bearer) or dashboard session
Scopes
documents:write
Parameters
titlestringin queryoptional
Title for a raw application/pdf or application/octet-stream body. With multipart/form-data the title form field wins when it is not empty.
Deletes an uploaded document version that no envelope uses: the row and the stored PDF. 409 invalid_state when an envelope uses it; delete the envelope instead and the document goes with it.
How many bytes the workspace stores (uploaded PDFs plus signed artifacts) and the limits that apply. A limit of null means none is set on this deployment. Uploads fail with 403 storage_limit_exceeded over the storage limit and 429 rate_limited over the daily upload limit; signing and finishing envelopes are never blocked by them. Uploads that no envelope uses are deleted after unused_document_days. The limits may change: see limits_url.
An envelope binds a document version to recipients and fields. Draft, optionally get approval, send, then follow it until it is completed, declined, canceled or expired.
A draft binds one document version to recipients and fields. Nothing is sent and no credits are reserved until you call send. Every recipient needs at least one signature field before the draft can be quoted, put up for approval or sent.
Auth
API key (Bearer) or dashboard session
Scopes
envelopes:write
Parameters
Idempotency-Keystringin headeroptional≤ 200 chars
Optional. With a key, a retry with the same key and body returns the stored response instead of creating a second resource; the same key with a different body is a 409 idempotency_key_reused. Keys are scoped to the workspace.
Request body
application/jsonEnvelopeCreate
document_version_idstringrequired
version_id returned by POST /documents.
titlestringoptional1–200 chars
messagestringoptional≤ 2000 chars
Shown to recipients in the invitation.
signing_orderenumoptionaldefault "parallel"
sequential invites recipients one at a time, in list order.
One ofparallelsequential
signer_network_evidenceenumoptionaldefault "none"
What is recorded about each signer's connection when they sign. none (default) records nothing. ip_user_agent stores the IP address and browser user agent in the evidence package and on the certificate page; the signer is told before signing.
One ofnoneip_user_agent
expires_in_hoursintegeroptional1–1440default 168
Signing must finish within this time after creation. Cannot be changed later.
Your name for this recipient, unique within the envelope. Fields point at it with recipient_role. Default signer_1, signer_2, …
namestringrequired1–120 chars
emailstring<email>required≤ 254 chars
Receives the invitation and the one-time code.
fieldsFieldInput[]optional≤ 200 items
recipient_rolestringrequired≤ 50 chars
role of the recipient who fills in this field. Must match a recipient in the same request (or the envelope).
typeenumrequired
signature: the signer's typed or drawn signature, always required; recommended at least 0.2 × 0.05 of an A4 page. text: a line the signer types, up to 500 characters; long text is shrunk to fit the box. date: filled automatically with the signing date (UTC, YYYY-MM-DD); the signer types nothing. checkbox: a box the signer ticks; when required is true it must be ticked to sign.
One ofsignaturetextdatecheckbox
pageintegerrequired1–100
1-based page number, at most the document's page_count.
xnumberrequired0–1
Left edge, as a fraction of the page width from the left (0 = left edge, 1 = right edge).
ynumberrequired0–1
Top edge, as a fraction of the page height from the top (0 = top edge, 1 = bottom edge). Note: from the top, unlike PDF user space.
widthnumberrequired> 0, ≤ 1
Box width as a fraction of the page width. At least 0.02.
heightnumberrequired> 0, ≤ 1
Box height as a fraction of the page height. At least 0.01.
requiredbooleanoptionaldefault true
Whether the signer must fill it in. Ignored for signature (always required) and date (always filled).
labelstringoptional≤ 80 chars
Shown to the signer next to the field, e.g. "Job title". Recommended for every text and checkbox field.
metadataMetadataoptional
Your own key-value pairs, e.g. an order id or the agent task that created the envelope. Up to 20 keys; keys up to 40 characters of letters, digits, _, . and -; string values up to 500 characters. Returned on the envelope; never shown to signers and not part of the payload hash or the evidence. Do not put personal data or secrets here. On update, the object you send replaces the old one.
Change the title, message, signing order, recipients or fields of a draft. Any change alters the payload hash, so earlier approvals no longer apply.
Auth
API key (Bearer) or dashboard session
Scopes
envelopes:write
Parameters
idstringin pathrequired
Request body (optional)
application/jsonEnvelopeUpdate
All properties are optional; omitted ones keep their value. recipients and fields replace the whole list when given. document_version_id and expires_in_hours cannot be changed after creation. Unknown properties are ignored.
Your name for this recipient, unique within the envelope. Fields point at it with recipient_role. Default signer_1, signer_2, …
namestringrequired1–120 chars
emailstring<email>required≤ 254 chars
Receives the invitation and the one-time code.
fieldsFieldInput[]optional≤ 200 items
recipient_rolestringrequired≤ 50 chars
role of the recipient who fills in this field. Must match a recipient in the same request (or the envelope).
typeenumrequired
signature: the signer's typed or drawn signature, always required; recommended at least 0.2 × 0.05 of an A4 page. text: a line the signer types, up to 500 characters; long text is shrunk to fit the box. date: filled automatically with the signing date (UTC, YYYY-MM-DD); the signer types nothing. checkbox: a box the signer ticks; when required is true it must be ticked to sign.
One ofsignaturetextdatecheckbox
pageintegerrequired1–100
1-based page number, at most the document's page_count.
xnumberrequired0–1
Left edge, as a fraction of the page width from the left (0 = left edge, 1 = right edge).
ynumberrequired0–1
Top edge, as a fraction of the page height from the top (0 = top edge, 1 = bottom edge). Note: from the top, unlike PDF user space.
widthnumberrequired> 0, ≤ 1
Box width as a fraction of the page width. At least 0.02.
heightnumberrequired> 0, ≤ 1
Box height as a fraction of the page height. At least 0.01.
requiredbooleanoptionaldefault true
Whether the signer must fill it in. Ignored for signature (always required) and date (always filled).
labelstringoptional≤ 80 chars
Shown to the signer next to the field, e.g. "Job title". Recommended for every text and checkbox field.
metadataMetadataoptional
Your own key-value pairs, e.g. an order id or the agent task that created the envelope. Up to 20 keys; keys up to 40 characters of letters, digits, _, . and -; string values up to 500 characters. Returned on the envelope; never shown to signers and not part of the payload hash or the evidence. Do not put personal data or secrets here. On update, the object you send replaces the old one.
Permanently deletes the envelope and everything stored for it: recipients, fields, signatures, approvals, the audit trail, the signed PDF and evidence, its mail in the sandbox inbox, and the uploaded document unless another envelope uses it. Possible in draft, pending_approval, approved, completed, declined, canceled and expired; an envelope out for signature must be canceled first (409 invalid_state). Kept: credit ledger entries (amounts and the envelope id, no content) and the evidence hash in the transparency log. Signed files someone downloaded still verify offline. Sends envelope.deleted to webhooks. Cannot be undone. The envelopes:delete scope is not in the Agent preset: agents should not delete signed agreements.
role of the recipient who fills in this field. Must match a recipient in the same request (or the envelope).
typeenumrequired
signature: the signer's typed or drawn signature, always required; recommended at least 0.2 × 0.05 of an A4 page. text: a line the signer types, up to 500 characters; long text is shrunk to fit the box. date: filled automatically with the signing date (UTC, YYYY-MM-DD); the signer types nothing. checkbox: a box the signer ticks; when required is true it must be ticked to sign.
One ofsignaturetextdatecheckbox
pageintegerrequired1–100
1-based page number, at most the document's page_count.
xnumberrequired0–1
Left edge, as a fraction of the page width from the left (0 = left edge, 1 = right edge).
ynumberrequired0–1
Top edge, as a fraction of the page height from the top (0 = top edge, 1 = bottom edge). Note: from the top, unlike PDF user space.
widthnumberrequired> 0, ≤ 1
Box width as a fraction of the page width. At least 0.02.
heightnumberrequired> 0, ≤ 1
Box height as a fraction of the page height. At least 0.01.
requiredbooleanoptionaldefault true
Whether the signer must fill it in. Ignored for signature (always required) and date (always filled).
labelstringoptional≤ 80 chars
Shown to the signer next to the field, e.g. "Job title". Recommended for every text and checkbox field.
The credits sending would reserve (max_credits), what the workspace has (credits_available, sufficient) and the payload hash of the current draft. Reserves nothing.
Locks the document, recipients, fields and quote, and invites the recipients. Requires an Idempotency-Key. If the workspace requires approval for API sends, pass the approval_id of an approved request for the current payload hash. Reserves the quoted credits atomically: 402 insufficient_credits when the workspace lacks available credits, 402 key_budget_exceeded when the API key's monthly cap would be exceeded. In test mode the response includes sandbox_signing_links and emails stay in the test inbox.
Auth
API key (Bearer) or dashboard session
Scopes
envelopes:send
Parameters
idstringin pathrequired
Idempotency-Keystringin headerrequired≤ 200 chars
Request body (optional)
application/json
approval_idstringoptional
Approved approval request for this envelope. Required when the workspace requires approval for API sends.
Responses
200Sent envelope (test mode: includes sandbox_signing_links)application/json
A short-lived (30 minute) signing URL for one recipient whose turn it is, to open in your own app. The signer still verifies their email with a one-time code.
Auth
API key (Bearer) or dashboard session
Scopes
sessions:create
Parameters
idstringin pathrequired
Request body
application/jsonSessionCreate
recipient_idstringrequired
Recipient of this envelope whose turn it is to sign. An unknown or missing id is a 404.
Once the envelope is completed: its stored files, such as the signed PDF, evidence.json (canonical manifest) and evidence.sig.json (Ed25519 platform seal), each with its SHA-256 and a download_url that is valid for 15 minutes.
Asks a person in the workspace to approve sending the current draft. The approval binds to the payload hash and is single-use; changing the draft invalidates it. The requester can never approve their own request.
Auth
API key (Bearer) or dashboard session
Scopes
approvals:request
Parameters
idstringin pathrequired
Request body (optional)
application/jsonApprovalRequestCreate
notestringoptional
Shown to the approver. Truncated to 500 characters; a non-string value is ignored.
TypeSign POSTs signed events to the URL. The signing secret is returned once; keep it to verify the webhook-signature header.
Auth
API key (Bearer) or dashboard session
Scopes
webhooks:manage
Request body
application/jsonWebhookCreate
urlstringrequired≤ 2000 chars
https URL on a public host (port 443 or 8443 when given). Private, loopback and link-local hosts are rejected, except on a local standalone server (typesign serve bound to localhost), which also accepts http and localhost URLs.
eventsenum[]optional≥ 1 itemsdefault ["*"]
Event types to deliver. * means all.
One of*envelope.createdenvelope.sentenvelope.completedenvelope.declinedenvelope.canceledenvelope.expiredenvelope.finalization_failedenvelope.deletedapproval.requestedapproval.approvedapproval.rejectedrecipient.verifiedrecipient.signedrecipient.link_lockedrecipient.declined
Creates a key for the mode you are in (osk_live_… in live mode, osk_test_… in test mode). The secret is returned once and stored only as a hash. Signed-in person only: API keys cannot mint API keys.
Auth
Dashboard session only
Scopes
keys:manage
Dashboard only: the signed-in person's session cookie, from the app's own origin. API keys get 403 forbidden.
Request body
application/jsonApiKeyCreate
namestringrequired1–80 chars
scopesenum[]optional≥ 1 items
One ofdocuments:readdocuments:writeenvelopes:readenvelopes:writeenvelopes:sendenvelopes:cancelenvelopes:remindenvelopes:deletesessions:createartifacts:readapprovals:requestapprovals:readaudit:readwebhooks:managebilling:readseals:write
Seals a self-sign record for a document you keep yourself and returns evidence.json and evidence.sig.json in the standard evidence format (schema typesign.self-sign-evidence/v0.1). Send fingerprints, never the document. Nothing is stored and no credits are charged. The signer's name is self-asserted and not verified, and the record says so. Your application must show the signer intent_text and collect their consent: never request a seal on a person's behalf. 600 per hour per API key. Where the server has Turnstile configured, a browser without an API key may send a Turnstile-Token header instead (only when the server has Turnstile configured, see GET /seals/anonymous; rate limited per address and per day).
Auth
API key (Bearer) or dashboard session
Scopes
seals:write
Request body
application/jsonSealCreate
A self-sign seal for a document you keep yourself (ADR 0012). Send fingerprints, never the document. The signer's name is self-asserted and not verified. Your application must show the signer the intent text and collect their consent itself: never request a seal on a person's behalf. Body at most 16 KB.
documentobjectrequired
The PDF before signing.
sha256stringrequiredpattern ^[0-9a-f]{64}$
sizeintegerrequired≥ 1
page_countintegerrequired≥ 1
signed_documentobjectrequired
The PDF after the signature was stamped into it, as it will be handed out.
sha256stringrequiredpattern ^[0-9a-f]{64}$
sizeintegerrequired≥ 1
signerobjectrequired
namestringrequired1–100 chars
As typed by the signer. Leading and trailing spaces are removed.
signature_kindenumrequired
One oftypeddrawn
fieldsobject[]required≤ 50 items
What was placed and where. At least one signature.
typeenumrequired
One ofsignaturedatetext
pageintegerrequired≥ 1
consentbooleanrequired
Must be true: the signer accepted intent_text.
intent_versionenumrequired
v2 is current. v1 is still accepted.
One ofself-sign-intent/v1self-sign-intent/v2
intent_textstringrequired≤ 2000 chars
Exactly the statement for intent_version. v2: I, {name}, have reviewed this document and agree to sign it electronically. My name is my own statement: my identity has not been checked. v1: I, {name}, have reviewed the document with SHA-256 {document.sha256} and I agree to sign it electronically. I understand that my typed or drawn signature is a visual representation, that my identity has not been verified (the name is my own statement), and that TypeSign receives only fingerprints of the document, never the document itself.
client_timestring<date-time>required
When the signer signed, from their own clock. Recorded as reported.
Public Ed25519 key(s) that seal evidence packages, with their trust status, plus the X.509 seal certificate chain (if configured), the timestamp authority and the transparency log's verifier key. A test key is labelled untrusted_test_key; a sandbox certificate is never trusted. Pin these from an independent channel before trusting them. No authentication.
Latest signed checkpoint of this server's transparency log of evidence manifest hashes (C2SP tlog-checkpoint signed note, text/plain). 404 if the server runs no log. No authentication.
Auth
None
Responses
200Signed notetext/plain
404Not found (also returned for other tenants' resources)Error
Called by the signing page in the recipient's own browser. Listed for completeness: integrations never call these, and there is no API-key path to signing.
Emails a single-use sign-in link. Same-origin browser requests only. Rate limited per email and per client. When the deployment has Turnstile configured (GET /auth/config returns a site key), turnstile_token from a solved widget with action login is required. Accounts are for people: an agent should send its user to /login, not sign in itself.
Auth
None
Called by the dashboard's sign-in page. Same-origin browser requests only.
Request body
application/json
emailstring<email>required≤ 254 chars
turnstile_tokenstringoptional≤ 2048 chars
Responses
200{ok: true}application/json
403Insufficient scope, forbidden or environment mismatchError
Body {"mode": "test" | "live"}. Sets or clears the mode cookie for the signed-in session (ADR 0025). In test mode the dashboard shows only test envelopes, test keys and test credits, and all mail a workspace sends stays in the test inbox. API keys need no switch: an osk_test_ key always works in test mode. 422 (invalid_request) where the deployment has no test mode. Same-origin browser requests only.
Auth
None
Called by the dashboard's sign-in page. Same-origin browser requests only.