Create an API key
const url = 'https://api.sealpost.app/v1/api-keys';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","mode":"live","scopes":["envelopes:read"],"expires_at":"2026-04-15T12:00:00Z"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.sealpost.app/v1/api-keys \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "mode": "live", "scopes": [ "envelopes:read" ], "expires_at": "2026-04-15T12:00:00Z" }'Scope api_keys:write. The secret is in the response once and never
again. A test key may only create test keys (live_key_required).
Honours Idempotency-Key.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Client-chosen key, 1 to 255 characters, scoped to (tenant, API key,
method, path). The first response is stored for 24 hours and replayed
for repeats with the same body (Idempotent-Replayed: true). A repeat
with a different body is a 422 idempotency_key_reused; a repeat while
the first request is still running is a 409 idempotency_in_flight
(a request that dies mid-flight releases its lock after 60 seconds).
Request Bodyrequired
Section titled “Request Bodyrequired”object
Defaults to every scope the calling key has.
Optional hard expiry, must be in the future.
Responses
Section titled “Responses”The new key with its secret.
object
The visible start of the secret, e.g. sk_test_3f9aQ2Lm, enough to tell keys apart.
The key this one replaced, when minted by a rotation.
Updated at most once a minute.
The full key. Present on the first response only: shown once, never stored, so an idempotent replay of the same request (Idempotent-Replayed: true) omits it.
Example
{ "mode": "live", "scopes": [ "envelopes:read" ], "secret": "sk_test_EXAMPLE"}Headers
Section titled “Headers”Unique id of this request (req_…). Quote it in support requests.
Present and true when the response was replayed from a stored earlier response for the same Idempotency-Key.
The request could not be read (malformed JSON, bad header).
RFC 9457 problem details plus a stable code and the request_id.
object
https://sealpost.app/errors/{code}
Human-readable, safe to show to a developer, never contains secrets or signer data.
The request path.
Stable machine-readable code from the catalogue (docs/errors.md).
Field-level detail on validation_failed.
object
JSON pointer-ish path, e.g. scopes[2].
Example
{ "type": "https://sealpost.app/errors/insufficient_scope", "title": "Forbidden", "status": 403, "detail": "This key lacks the api_keys:write scope.", "code": "insufficient_scope", "request_id": "req_01J9ZK3V8Q4M2XQ7W0E5D1R6TA"}Headers
Section titled “Headers”Unique id of this request (req_…). Quote it in support requests.
No key, an unknown key, or a revoked or expired key.
RFC 9457 problem details plus a stable code and the request_id.
object
https://sealpost.app/errors/{code}
Human-readable, safe to show to a developer, never contains secrets or signer data.
The request path.
Stable machine-readable code from the catalogue (docs/errors.md).
Field-level detail on validation_failed.
object
JSON pointer-ish path, e.g. scopes[2].
Example
{ "type": "https://sealpost.app/errors/insufficient_scope", "title": "Forbidden", "status": 403, "detail": "This key lacks the api_keys:write scope.", "code": "insufficient_scope", "request_id": "req_01J9ZK3V8Q4M2XQ7W0E5D1R6TA"}Headers
Section titled “Headers”Unique id of this request (req_…). Quote it in support requests.
The key is valid but lacks the scope, or a test key tried a live-only action.
RFC 9457 problem details plus a stable code and the request_id.
object
https://sealpost.app/errors/{code}
Human-readable, safe to show to a developer, never contains secrets or signer data.
The request path.
Stable machine-readable code from the catalogue (docs/errors.md).
Field-level detail on validation_failed.
object
JSON pointer-ish path, e.g. scopes[2].
Example
{ "type": "https://sealpost.app/errors/insufficient_scope", "title": "Forbidden", "status": 403, "detail": "This key lacks the api_keys:write scope.", "code": "insufficient_scope", "request_id": "req_01J9ZK3V8Q4M2XQ7W0E5D1R6TA"}Headers
Section titled “Headers”Unique id of this request (req_…). Quote it in support requests.
A request with the same Idempotency-Key is still in flight.
RFC 9457 problem details plus a stable code and the request_id.
object
https://sealpost.app/errors/{code}
Human-readable, safe to show to a developer, never contains secrets or signer data.
The request path.
Stable machine-readable code from the catalogue (docs/errors.md).
Field-level detail on validation_failed.
object
JSON pointer-ish path, e.g. scopes[2].
Example
{ "type": "https://sealpost.app/errors/insufficient_scope", "title": "Forbidden", "status": 403, "detail": "This key lacks the api_keys:write scope.", "code": "insufficient_scope", "request_id": "req_01J9ZK3V8Q4M2XQ7W0E5D1R6TA"}Headers
Section titled “Headers”Unique id of this request (req_…). Quote it in support requests.
The request was read but a value is invalid, or an Idempotency-Key was reused with a different body.
RFC 9457 problem details plus a stable code and the request_id.
object
https://sealpost.app/errors/{code}
Human-readable, safe to show to a developer, never contains secrets or signer data.
The request path.
Stable machine-readable code from the catalogue (docs/errors.md).
Field-level detail on validation_failed.
object
JSON pointer-ish path, e.g. scopes[2].
Example
{ "type": "https://sealpost.app/errors/insufficient_scope", "title": "Forbidden", "status": 403, "detail": "This key lacks the api_keys:write scope.", "code": "insufficient_scope", "request_id": "req_01J9ZK3V8Q4M2XQ7W0E5D1R6TA"}Headers
Section titled “Headers”Unique id of this request (req_…). Quote it in support requests.
The key is over its per-minute budget (600 live, 60 test, sliding window).
RFC 9457 problem details plus a stable code and the request_id.
object
https://sealpost.app/errors/{code}
Human-readable, safe to show to a developer, never contains secrets or signer data.
The request path.
Stable machine-readable code from the catalogue (docs/errors.md).
Field-level detail on validation_failed.
object
JSON pointer-ish path, e.g. scopes[2].
Example
{ "type": "https://sealpost.app/errors/insufficient_scope", "title": "Forbidden", "status": 403, "detail": "This key lacks the api_keys:write scope.", "code": "insufficient_scope", "request_id": "req_01J9ZK3V8Q4M2XQ7W0E5D1R6TA"}Headers
Section titled “Headers”Unique id of this request (req_…). Quote it in support requests.
Seconds to wait before retrying.
Requests allowed per minute for this key (600 live, 60 test).
Requests remaining in the current window.
Seconds until the window has capacity again.
Something failed on our side. The request_id is in our logs.
RFC 9457 problem details plus a stable code and the request_id.
object
https://sealpost.app/errors/{code}
Human-readable, safe to show to a developer, never contains secrets or signer data.
The request path.
Stable machine-readable code from the catalogue (docs/errors.md).
Field-level detail on validation_failed.
object
JSON pointer-ish path, e.g. scopes[2].
Example
{ "type": "https://sealpost.app/errors/insufficient_scope", "title": "Forbidden", "status": 403, "detail": "This key lacks the api_keys:write scope.", "code": "insufficient_scope", "request_id": "req_01J9ZK3V8Q4M2XQ7W0E5D1R6TA"}Headers
Section titled “Headers”Unique id of this request (req_…). Quote it in support requests.