API keys
API keys are created by members, not by other keys. The secret is shown once. A live key with a write scope waits for a different owner or admin to approve it. See Authentication for scopes and the role ceiling.
The base is https://holdyn-fb2e34c7cbae.herokuapp.com/api/v1/b2b. Every endpoint below lists who may call it.
At a glance#
Objects
ApiKey
{
"id": "key_6543a1b2c3d4e5f6a7b8cfc0",
"object": "api_key",
"livemode": false,
"name": "Acme backend (sandbox)",
"key_prefix": "htst_",
"key_last4": "9xQz",
"scopes": ["mandates:read", "mandates:write", "parties:write", "evidence:write", "events:read", "test_helpers:write"],
"status": "active",
"scope_ceiling_role": "admin",
"change_request": null,
"activates_at": null,
"expires_at": null,
"last_used_at": "2026-11-05T10:00:00.000Z",
"created_by": "mem_6543a1b2c3d4e5f6a7b8c9d4",
"revoked_at": null,
"revoked_by": null,
"revoke_reason": null,
"rolled_from": null,
"created_at": "2026-11-02T10:00:00.000Z"
}Endpoints
POST/api-keys
- Credential
- Member session
- Permission
api_keys.manage(test) /api_keys.manage_live(live)- Mode
- both
- Step-up
- live (
mode: live)
Request
name string required (1–120); mode string required (test, live; the legacy boolean livemode is accepted as an alias, deprecated); scopes string[] required (non-empty; new scopes,; test_helpers:write only on test keys; legacy scopes only when tenant.legacy_api_available); expires_at timestamp optional (future, ≤ now + 2 years); reason string optional (10–500; required for a live key with a :write scope: it goes to the change request).
Response
201 ApiKeyWithSecret (key: "htst_…" once; status: active), or 202 ApiKeyWithSecret (status: pending_activation, change_request set; the key authenticates nothing until activated: 401 api_key_not_active).
Errors
400 parameter_invalid (scopes), reason_required; 403 live_not_enabled (live key on a non-live tenant), scope_ceiling_exceeded (+ allowed_scopes).
Record and events
api_key.created (prefix, last4, scopes, mode, scopeCeilingRole) (+ api_key.activation_requested, change_request.opened).
GET/api-keys
- Credential
- Member session
- Permission
api_keys.manage- Mode
- both
- Pagination
- cursor
Request
mode (test, live, all; default the request mode), status (multi).
Response
200 ListResponse<ApiKey>.
GET/api-keys/:id
- Credential
- Member session
- Permission
api_keys.manage- Mode
- both
POST/api-keys/:id/roll
- Credential
- Member session
- Permission
api_keys.manage/api_keys.manage_live- Mode
- both
- Step-up
- live (live key)
- Idempotency
- secret-bearing
Request
expire_old_in_hours integer optional (0–24, default 24).
Response
201 ApiKeyWithSecret (the new key, same name/scopes/mode/status, rolled_from set; key once); the old key gets expires_at. Rolling never widens scopes, so an active live key's successor is active at once. Because of that, an active LIVE key with any :write scope is rolled only by the member who created it (a legacy key with no creator: an owner); any other member gets 403 insufficient_permission and revokes the key and creates a new one, which goes through api_key_live_write dual control.
Errors
403 insufficient_permission (live write key not created by the caller); 409 invalid_state_transition (revoked, expired or still pending key). · Records: api_key.rolled.
DELETE/api-keys/:id
- Credential
- Member session
- Permission
api_keys.manage/api_keys.manage_live- Mode
- both
- Idempotency
- honoured - Request (JSON body, optional):
reasonstring (≤ 500).
Response
200 ApiKey (revoked, revoke_reason: member; immediate; a pending change request is withdrawn). · Records: api_key.revoked.
