API reference
The OpenSeal API is a JSON REST API over HTTPS. Everything the web app does, it does through this API: 182 public operations, from creating and sending an envelope to reading its sealed documents and audit trail.
Pre-release. The contract is version 1.0.0-alpha and may still change before 1.0. OpenSeal v0.1.0 is for evaluation, not yet for production agreements.
Base URL
Every deployment serves the API at its own address, the OPENSEAL_PUBLIC_URL its operator configures (see Configuration). Operations live under /api/v1; discovery documents under /.well-known/. The examples on these pages use https://sign.example.com.
- Request and response bodies are JSON (
application/json); a JSON body sent as anything else is refused415. - Times are RFC 3339 in UTC; ids are UUIDv7 strings.
- Every response carries
X-Request-Id; quote it when you report a problem. - An object of another account answers exactly as one that does not exist:
404 CS-API-0002.
Your first request
curl https://sign.example.com/api/v1/envelopes?limit=5 \
-H "Authorization: Bearer $OPENSEAL_API_KEY"
Client libraries
Two clients are generated from the same contract as this reference, one method per operation, with the OAuth helpers and webhook verification. Every operation on these pages shows its call in both.
| Language | Package | Method names |
|---|---|---|
| TypeScript and JavaScript (Node 20+, Deno, Bun, browsers) | @openseal/sdk 0.1.0-beta.0, sdk/typescript | The operation id: os.createEnvelope(…) |
| Python 3.9+ | openseal 0.1.0b0, sdk/python | Snake case: client.create_envelope(…) |
Neither is published to npm or PyPI yet; install them from a checkout of the repository:
npm install ./openseal/sdk/typescript # or: pip install ./openseal/sdk/python
Authentication
Every operation except the public ones (sign-in, the token endpoint, discovery) needs a credential. Integrations send it as a bearer token:
Authorization: Bearer <API key or access token>
A credential belongs to one workspace and acts as one member. It holds at most the permissions of that member's profile, narrowed by its own scopes, and it is checked again on every request: a revoked key, an expired token or a removed member is refused on the next call.
| Method | Use it for | Credential |
|---|---|---|
| API key | Scripts and server-side integrations of your own workspace | osk_…, scoped, optionally expiring, shown once |
| OAuth 2.1, authorization code with PKCE | Apps that act for members who sign in and consent | Access token (1 hour) and refresh token (osr_…, 30 days, rotated) |
| OAuth client credentials | A service acting as the OAuth app's owner | Access token (1 hour) |
| JWT bearer grant (RFC 7523) | Server-to-server integrations acting for a member who consented once | Access token (1 hour), no refresh token |
| Staff session | OpenSeal's own web app | A __Host-os_session cookie with a CSRF token; not for integrations |
API keys
An administrator creates a key in the web app (Admin, API) or with Create API client (kind: "api_key"). The key is osk_ followed by 256 random bits; OpenSeal stores only its SHA-256, so it is shown once, in the response that creates it. Keys of a sandbox workspace start osk_test_.
# Create a key (as an administrator), then use it
curl -X POST https://sign.example.com/api/v1/api-clients \
-H "Authorization: Bearer $ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "CRM sync", "kind": "api_key", "scopes": ["envelopes:read", "envelopes:write"], "expires_in_days": 90}'
curl https://sign.example.com/api/v1/envelopes \
-H "Authorization: Bearer osk_3f9a6c1e8b2d4f7a9c0e5b1d3f6a8c2e"
OAuth 2.1: authorization code with PKCE
For an app that acts for members of a workspace. Register it with kind: "oauth_app" and its redirect_uris (https://, or http:// to a loopback address); it gets a client_id and a client_secret. OpenSeal accepts confidential clients only: the app authenticates at the token endpoint with its secret and sends a PKCE verifier (S256).
Send the member to the authorization endpoint with a fresh PKCE challenge and
state. OpenSeal signs them in if needed and asks for consent.https://sign.example.com/api/v1/oauth/authorize?response_type=code &client_id=CLIENT_ID&redirect_uri=https%3A%2F%2Fapp.example.com%2Fcallback &scope=envelopes%3Aread%20envelopes%3Asend&state=STATE &code_challenge=CHALLENGE&code_challenge_method=S256Receive the redirect. On consent the member's browser returns to your redirect URI with
code, yourstate(check it) andiss(RFC 9207). A code lasts ten minutes and works once.Exchange the code with your client credentials and the verifier:
curl -X POST https://sign.example.com/api/v1/oauth/token \ -u "$CLIENT_ID:$CLIENT_SECRET" \ -d grant_type=authorization_code \ -d code="$CODE" \ -d redirect_uri=https://app.example.com/callback \ -d code_verifier="$VERIFIER"{ "access_token": "eyJhbGciOiJFUzI1NiJ9…", "token_type": "Bearer", "expires_in": 3600, "scope": "envelopes:read envelopes:send", "refresh_token": "osr_…" }Refresh before the hour is up with
grant_type=refresh_token. Each refresh token works once and is replaced; one used twice revokes the whole family, so store the new one every time.
The SDKs do steps 1 and 3 for you:
// TypeScript
const { url, verifier, state } = await os.authorizationUrl({ clientId, redirectUri, scope: "envelopes:read envelopes:send" });
// … redirect to url, then on the callback:
await os.token({ clientId, clientSecret, grant_type: "authorization_code", code, redirect_uri: redirectUri, code_verifier: verifier });
# Python
url, verifier, state = client.authorization_url(client_id, redirect_uri, "envelopes:read envelopes:send")
client.token(client_id=client_id, client_secret=client_secret, grant_type="authorization_code",
code=code, redirect_uri=redirect_uri, code_verifier=verifier)
Members see and withdraw the apps they consented to under Connected apps; withdrawing revokes the refresh tokens at once and the access tokens on their next request.
OAuth client credentials
An OAuth app can also take a token for itself, acting as its owner:
curl -X POST https://sign.example.com/api/v1/oauth/token \
-u "$CLIENT_ID:$CLIENT_SECRET" \
-d grant_type=client_credentials \
-d scope="envelopes:read"
JWT bearer grant
For a server that acts for a member without a browser each time, as DocuSign's JWT grant does. Register a kind: "jwt_integration" client with your public_key (PEM, EC P-256 or RSA; never send the private key). The member consents once, through the same authorization URL as above. Then your server signs an assertion with its private key and exchanges it:
{
"iss": "CLIENT_ID", // the integration's client id
"sub": "USER_ID", // the member who consented
"aud": "https://sign.example.com", // the public URL, or the token endpoint's
"iat": 1763631000,
"exp": 1763634600, // in the future, at most an hour after iat
"scope": "envelopes:read envelopes:send" // optional; within the consent
}
# Python, with any JWT library (PyJWT shown) for the assertion
assertion = jwt.encode(claims, private_key_pem, algorithm="ES256")
token = client.token(assertion=assertion) # grant_type is set for you
curl -X POST https://sign.example.com/api/v1/oauth/token \
-d grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer \
-d assertion="$ASSERTION"
A member who has not consented gets invalid_grant with CS-AUTH-0005; a bad signature, audience or lifetime gets invalid_grant with CS-AUTH-0014. No refresh token is issued: sign a new assertion when the hour is up.
Access tokens
Access tokens are ES256 JWTs (issuer the public URL, audience openseal-api) valid for one hour. The keys that verify them are at /.well-known/jwks.json; the server's OAuth metadata (RFC 8414) is at /.well-known/oauth-authorization-server. Token endpoint errors follow RFC 6749 (invalid_client, invalid_grant, invalid_scope, unsupported_grant_type) with OpenSeal's code in error_description.
Scopes and permissions
Each operation names the permission it needs (on its page, under Permission). A key or token holds the permissions its scopes cover, and never more than its member's profile allows:
| Scope | Permissions it covers |
|---|---|
admin:account | settings.sending, settings.signing, ersd.manage, settings.security, brands.manage, retention.manage, api_clients.manage, templates.share_workspace, reports.read, usage.read, admin_audit.read |
admin:users | users.read, users.invite, users.update, users.disable, users.remove, groups.manage, profiles.manage |
audit:read | audit.read |
bulk:send | bulk.send |
envelopes:read | envelopes.read |
envelopes:send | envelopes.send |
envelopes:write | envelopes.write |
templates:read | templates.read |
templates:write | templates.write |
webhooks:manage | webhooks.manage |
No scope covers envelopes.read_all, envelopes.transfer: they are held through a member's permission profile only.
Errors
Every error is an RFC 9457 problem (application/problem+json) with a stable code, never reused, that you can branch on. errors[] points at the members that are wrong with JSON pointers. Messages never contain document text or personal data.
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/problem+json
{
"type": "urn:openseal:problem:CS-API-0001",
"title": "Malformed or invalid request",
"status": 422,
"code": "CS-API-0001",
"detail": "subject is longer than 255 characters",
"request_id": "0193d3a1-5b7c-7e2f-9a41-6c8d2e0f3b15",
"errors": [{ "pointer": "/subject", "code": "CS-API-0001" }]
}
The SDKs raise these as OpenSealError with code, status, requestId (request_id in Python) and errors.
| Status | Meaning |
|---|---|
200 201 202 204 | Done; 202 when the work continues in the background (sending email, sealing) |
400 422 | The request is malformed or breaks a rule; errors[] says where |
401 | No credential, or an expired or revoked one |
403 | The credential lacks the permission, or the action is not allowed (plan limits add meter, limit, used and period_end) |
404 | No such object, or one of another account |
409 | The object's state does not allow it, or an idempotency conflict |
412 428 | Stale or missing If-Match |
413 415 | Body too large, or not JSON |
429 | Rate limited; retry after Retry-After seconds |
500 502 503 | OpenSeal or a service it depends on failed; safe to retry with the same Idempotency-Key |
Request codes (CS-API)
| Code | Meaning |
|---|---|
CS-API-0001 | Malformed request |
CS-API-0002 | Not found (also returned for objects of another tenant) |
CS-API-0003 | Rate limited |
CS-API-0004 | Idempotency key reused with a different body |
CS-API-0005 | Precondition failed (If-Match unreadable); a stale version is CS-WF-0002 |
CS-API-0006 | Request body too large (413) |
CS-API-0007 | Unsupported media type (415); ceremony calls that change state, and every /api/v1 body, must be application/json (ASVS-09; the token endpoint also takes its RFC 6749 form, a document upload a raw PDF) |
CS-API-0008 | Precondition required: If-Match absent where it is required (428) |
CS-API-0009 | Not available in the object's state (409): a sealed document, certificate or PDF audit report before the seal job made it |
CS-API-0010 | Internal error (500); the detail names the failing step, never data (panic for a handler that panicked, ASVS-26) |
CS-API-0011 | A request with this idempotency key is still in progress (409) |
CS-API-0012 | Method not allowed (405) |
CS-API-0013 | Webhook URL refused: not HTTPS to a public address (SEC-W01) |
CS-API-0014 | Recipient authentication method not available: not required of this recipient, not a sent code (email_otp, sms_otp, voice_otp), or nowhere to send it (no address or phone number) |
CS-API-0015 | The user is also a member of another account: only they may change their password or name (403, SEC-ID-01); from the store's CS-DB-0009 with SQLSTATE OS003 |
CS-API-0016 | The recipient's identity provider (sso, RAUTH-01) could not be reached, or answered neither a token nor a refusal (502); not counted as a failed sign-in |
CS-API-0017 | No head of the envelope's audit chain is anchored yet (404, GET /envelopes/{id}/anchor-proof, FG-158): the envelope exists and may be read; the daily anchor job has not covered it |
CS-API-0018 | The member cannot be erased now (409, ASVS-16): the workspace's last enabled administrator, or an administrator of the organization; detail says which (last administrator, organization administrator) |
CS-API-0019 | The envelope is under legal hold, so it is not purged (409, POST /envelopes/{id}/purge, ASVS-18) |
Authentication codes (CS-AUTH)
| Code | Meaning |
|---|---|
CS-AUTH-0001 | Not authenticated |
CS-AUTH-0002 | Token expired or revoked; a staff session past its idle or absolute limit (detail idle or lifetime, ASVS-06) |
CS-AUTH-0003 | Recipient authentication failed |
CS-AUTH-0004 | Recipient locked after too many attempts |
CS-AUTH-0005 | Consent required |
CS-AUTH-0006 | Credential lacks the scope or permission (403) |
CS-AUTH-0007 | Invalid credentials: login or OAuth client (401) |
CS-AUTH-0008 | CSRF token missing or wrong on a session request that changes something (403) |
CS-AUTH-0009 | Ceremony link bound to another browser, or not yet opened in this one (403) |
CS-AUTH-0010 | The API client does not own the embedding it acts for (row WF-05) (403) |
CS-AUTH-0011 | The staff session owes a second factor: it has not passed it (detail verify), or the account's mfa_policy asks for one the user has not enrolled (detail enrol; administrators by default, ASVS-31); only the sign-in steps, GET /auth/session and POST /auth/logout serve it (403, ASVS-01) |
CS-AUTH-0012 | Second factor refused: a wrong TOTP code, one for a step already used, or a recovery code not among the user's unspent ones (401, ASVS-01); a passkey registration or assertion refused: a challenge spent, expired or for another purpose, another origin or RP id, a credential not the user's, a bad signature, or a counter that did not move (CON-13) |
CS-AUTH-0013 | A sensitive action on a staff session that has not proved its holder's password (and second factor) within the last five minutes (detail reauthenticate): the client calls POST /auth/reauthenticate and repeats the request; nothing changed (403, ASVS-07). CS-AUTH-0002 also answers a staff session past its workspace's idle or absolute limit (detail idle or lifetime, ASVS-06) |
CS-AUTH-0014 | OAuth grant refused (400 invalid_grant at POST /oauth/token, the code in error_description; VS-08A, VS-08B): an authorization code unknown, spent, expired, not this client's, or exchanged with another redirect URI or a PKCE verifier that does not match; a refresh token unknown, spent (its whole family is then revoked), expired, revoked or not this client's; a JWT bearer assertion whose signature, issuer, audience or lifetime (expired, or more than an hour after iat) does not hold. A member who has not consented to a JWT integration is CS-AUTH-0005 |
Workflow codes (CS-WF)
| Code | Meaning |
|---|---|
CS-WF-0001 | Command not allowed in the current state |
CS-WF-0002 | Stale version (optimistic concurrency) |
CS-WF-0003 | Actor not permitted to perform the command |
CS-WF-0004 | Envelope invalid for sending (with the list of violations) |
CS-WF-0005 | Routing would leave a required recipient unreachable: no address and nobody earlier to supply one |
CS-WF-0006 | Command id already applied with a different command (re-applying the same command is a replay, not an error) |
CS-WF-0007 | Routing has not reached the recipient yet (for the Inbox's POST …/sign-link, also: has passed them, UXW-01) |
CS-WF-0008 | Unknown envelope, recipient, document or field id |
CS-WF-0009 | Seal result does not prove an independently verified seal of every document as delivered (or names a job not pending) |
CS-WF-0010 | Id already used in the envelope |
CS-WF-0011 | Envelope has applied its most commands (100,000; the idempotency record is bounded) |
CS-WF-0012 | Envelope's signing options do not allow decline, reassign or finish later |
CS-WF-0013 | Signature or initials not adopted before use |
CS-WF-0014 | Viewer has not viewed every document to the end |
CS-WF-0015 | Viewed document does not match the document as fixed (hash or pages) |
CS-WF-0016 | Field not editable by this recipient: another's, read-only, locked, or takes no input |
CS-WF-0017 | A computed time (timer, date stamp) falls outside years 0000 to 9999 |
CS-WF-0018 | A value could not be put in canonical form for hashing |
CS-WF-0019 | The envelope captures location and a recipient action (delivered, viewed, signed, approved, declined) came without one; the server always supplies at least the IP approximation |
CS-WF-0020 | The request's location contradicts the envelope's capture_location: a device location or a declined/unavailable reason when off, not_requested when on |
CS-WF-0021 | A document is hidden from this recipient (WF-02): a field of theirs on it refuses the send (422, a violation); viewing or fetching it as them is refused (the server answers 404 CS-API-0002, as a document that does not exist) |
CS-WF-0022 | The draft is scheduled to send (WF-02): it is not edited until the schedule is cancelled (409) |
CS-WF-0023 | A time out of range (WF-02): a schedule not after now, more than 365 days ahead or not before the expiry; a recipient's routing delay over 720 hours (422) |
CS-WF-0024 | Reserved (ADR-035 Proposed, WF-01; not returned until built): a routing rule refused at send: a condition's label is not a data field of a recipient at a lower routing order, a recipient has more than one rule, or every signer and approver has one (422) |
CS-WF-0025 | Reserved (ADR-035 Proposed, WF-01; not returned until built): another member of the signing group has claimed this recipient (409) |
Other families (documents CS-PDF, fields CS-FLD, bulk send CS-BLK, malware scanning CS-SCAN, plans CS-PLAN and the rest) are listed in the error code registry.
Pagination
Lists are cursor-paginated and stay stable while new objects arrive. Ask for up to limit items (1 to 200, default 50); the answer has items and next_cursor. Pass next_cursor back as cursor until it is null. A cursor belongs to the sort and order it was issued for.
curl "https://sign.example.com/api/v1/envelopes?limit=50&status=sent" -H "Authorization: Bearer $OPENSEAL_API_KEY"
{ "items": [ { "id": "0193…", "status": "sent", "subject": "Please sign: Mutual NDA" } ],
"next_cursor": "eyJpZCI6IjAxOTMifQ" }
curl "https://sign.example.com/api/v1/envelopes?limit=50&status=sent&cursor=eyJpZCI6IjAxOTMifQ" -H "Authorization: Bearer $OPENSEAL_API_KEY"
Idempotency
Every POST accepts an Idempotency-Key (1 to 255 printable ASCII characters). Retrying with the same key and body within 24 hours returns the first response, marked Idempotency-Replayed: true, and does the work once: a network failure while creating or sending an envelope never sends it twice.
- The same key with a different body:
409 CS-API-0004. - The first request still running:
409 CS-API-0011; retry shortly. - A response that held a secret (a new API key) is not stored; its replay answers
409 CS-API-0009.
curl -X POST https://sign.example.com/api/v1/envelopes/$ID/send \
-H "Authorization: Bearer $OPENSEAL_API_KEY" \
-H "Idempotency-Key: send-order-1042"
Versions, ETags and If-Match
Envelopes, and templates, have a version that every change raises. Reads return it as ETag: "v<version>". Changing or deleting a draft envelope, its recipients, fields or documents, and opening a correction, require If-Match with the version you read, so two editors never overwrite each other:
curl -X PATCH https://sign.example.com/api/v1/envelopes/$ID \
-H "Authorization: Bearer $OPENSEAL_API_KEY" \
-H 'If-Match: "v3"' \
-H "Content-Type: application/json" \
-d '{"subject": "Please sign: Mutual NDA (revised)"}'
A stale version answers 412 CS-WF-0002: read the envelope again and reapply your change. No If-Match where one is required answers 428 CS-API-0008.
Rate limits and request limits
Requests are limited per credential, per signing link, per client address and per sign-in name. Responses carry RateLimit and RateLimit-Policy (the IETF draft headers); a refused request answers 429 CS-API-0003 with Retry-After in seconds. Back off and retry after it, keeping the same Idempotency-Key.
| Limit | Value | Code |
|---|---|---|
| JSON request body | 1 MiB | CS-API-0006 |
| Document upload request (base64 of 50 MiB, or the raw PDF) | 70 MiB body; 50 MiB decoded | CS-API-0006, CS-PDF-0001 |
| One-call envelope create | 270 MiB body; 200 MiB of documents decoded | CS-API-0006 |
| Requests per authenticated principal | 1,200 per minute | CS-API-0003 |
| Ceremony requests per token / per client address | 300 / 1,200 per minute | CS-API-0003 |
| Login and token attempts per login name or client / per address | 10 / 100 per minute | CS-API-0003 |
| Idempotency key | 1–255 printable ASCII; replays answered for 24 hours | CS-API-0001, CS-API-0004 |
| Page size of lists | 1–200, default 50 | CS-API-0001 |
Step-up window (ASVS-07); re-authentication attempts per user | 5 minutes after the sign-in or POST /auth/reauthenticate; 10 per minute (the login rate) | CS-AUTH-0013, CS-API-0003 |
Every limit, with its error code, is in the limits register; an operation with limits of its own lists them on its page.
Versioning
The version is in the path: /api/v1. Within a version changes are additive only: new operations, new optional parameters, new members in responses and new event types. Clients must ignore members they do not know. A breaking change gets a new path (/api/v2), and the old version is kept for twelve months alongside it. The changelog records every change. Until 1.0 the contract (1.0.0-alpha) may still change.
Webhooks
Subscribe a URL with Create webhook to receive events such as envelope.completed as they happen. Each delivery is a POST of a small JSON event (ids and status, never names, addresses or documents: fetch those with your credential):
{
"id": "0193b2f4-7c1e-7b3d-8e45-1f2a3b4c5d6e",
"type": "envelope.completed",
"created_at": "2026-11-20T09:30:00Z",
"account_id": "0193a0c2-…",
"data": { "envelope_id": "0193…", "status": "completed", "version": 7 }
}
Deliveries are signed with the Standard Webhooks scheme: webhook-id, webhook-timestamp and webhook-signature (v1, and the base64 HMAC-SHA256 of id.timestamp.body under your whsec_… secret). Verify the raw body before parsing it, and refuse a timestamp more than five minutes away:
// TypeScript
import { verifyWebhook } from "@openseal/sdk";
const event = await verifyWebhook(process.env.OPENSEAL_WEBHOOK_SECRET, request.headers, rawBody);
# Python
from openseal import verify_webhook
event = verify_webhook(os.environ["OPENSEAL_WEBHOOK_SECRET"], request.headers, raw_body)
Delivery is at least once: answer 2xx within 10 seconds, and deduplicate on webhook-id. Failures are retried with exponential back-off for 15 attempts, about three days, and each attempt is in the delivery log. Order is not guaranteed; use data.version to discard stale events. URLs must be HTTPS to a public address. The Webhooks guide lists every event type and covers secret rotation.
Sandbox
Build and test against a sandbox workspace. An organization administrator creates one in Organization settings, Workspaces ("Sandbox workspace"), or with sandbox: true on Create organization workspace; a workspace is a sandbox for good. In a sandbox:
- API keys start
osk_test_and authenticate the same way; - envelopes are sealed with a separate test key whose certificate says it is not for agreements, and the signing page, emails and certificate say it is a test;
- nothing is counted against plan quotas.
Every workspace answers sandbox in Get account, so your integration can check where it is.
Resources
The whole contract is one OpenAPI 3.1 document: download openapi.yaml. A contract test keeps it equal to the server's route table, scope by scope.