Skip to main content
Sapiom has three surfaces. They share the same keys and data.

Authentication

Send a key in the x-api-key header on every REST request and MCP connection:
In the API, a user is a tenant: tenantId and the sapiom-tenant header carry the user’s ID. Every request made with a user key is limited to that user’s cards and transactions. Keys are shown once, as plainKey in the creation response. A platform key that you create on the Platform keys tab is a versioned key. Versioned keys are platform keys or user keys with the permissions you choose. Live keys start with sk_live_. Sandbox keys start with sk_test_ and use the same addresses. Branding endpoints are the exception. They need a signed-in team member. See Brand hosted pages. Webhook registration needs your platform key or a team member. The platform key uses its org.write permission.

Versioned keys

A versioned key has authorizationVersion: 1 and one of two access types: Of API keys, only a versioned platform key can create versioned keys. A signed-in team member can also create them. A versioned key must send authorizationVersion: 1 when it creates a key.

Check the permissions before you create a key

Each creation endpoint has a list. The list shows the permissions that a new key can have, and which of them your key can grant. Call Get permissions for a new user key before Create a user key, and Get permissions for a new API key before Create an API key.
In each permission, available shows that a user key can have it and that versioned key creation is on. grantable shows that your key can grant it. The result can change before you create the key.

User key permissions

When the request for a fixed user key omits permissions, the key gets these fixed-key defaults: A shared user key also omits permissions, but it gets your organization’s saved default permissions. To see the permissions that a new key has, read effectivePermissions in the response. A user key gets these permissions only when you select them: A user key cannot cancel a card’s budget. A versioned platform key cancels it for one user. See Cancel a budget. To select permissions, send them in permissions to POST /v1/tenants/{tenantId}/api-keys:
Sapiom also adds included permissions. For example, org.transactions.write adds org.transactions.read. A selection replaces the fixed-key defaults, so include each of them that the key needs. Sapiom refuses an empty selection and platform permissions.

Permission modes

permissionMode sets how a versioned user key gets its permissions. The dashboard shows the mode of each user key. If you omit permissionMode, Sapiom creates a fixed key. You set your organization’s default permissions in the dashboard. See Change user key permissions. To create a shared key, send permissionMode: "shared" and authorizationVersion: 1 to POST /v1/tenants/{tenantId}/api-keys. Do not send permissions. Send an Idempotency-Key header, because a shared key requires it.
Save your organization’s default permissions in the dashboard before you create the first shared key in an environment. Until then, Sapiom returns 409 tenant_key_defaults_not_configured.

Key fields

Every key response has these fields: On the API key endpoints, a versioned platform key can act for one user with Sapiom-Scope: tenant:<USER_ID>. With this header, you cannot create a key with accessType: "platform".

Retries and idempotency

Creating, changing and canceling a transaction each take a key. Keep the same idempotency key explains when to resend with it. Creating a versioned API key also takes an Idempotency-Key. See API key errors. Setup links take no key; each call creates a new link.

REST endpoints

Each group has a page per endpoint, with its fields and examples.