API key format
Keys are environment-scoped secrets with a prefix that tells you where they work:
A key only works against its own environment — a
sk_test_ key against the mainnet URL returns 401 INVALID_API_KEY.
Generating a key
- Sign in to the SohoPay Dashboard.
- Go to Settings → API Keys → Create key.
- Name the key after the service that will use it (e.g.
checkout-backend-prod). - Copy the key immediately — the full value is shown once and never again. Only the prefix and last four characters remain visible in the dashboard.
Bearer authentication
Send the key in theAuthorization header on every request:
401 with the standard error envelope:
Webhook signing
Inbound authentication is only half the picture — SohoPay also signs everything it sends to you. Every webhook delivery carries an HMAC-SHA256 signature in theSohopay-Signature header and the send time in Sohopay-Timestamp. Verify the signature before trusting any payload; reject anything unsigned or stale.
The signature is computed over ${timestamp}.${raw_body} using your endpoint’s signing secret. Full verification code in TypeScript and Python lives in Webhook Events, and endpoint setup is covered in the webhooks guide.
Rate-limit headers
Every response includes your current rate-limit state:
When you exceed the limit, the API returns
429 RATE_LIMITED. Respect Retry-After rather than retrying immediately; hammering a 429 only extends the wait. Per-agent transaction limits are separate and enforced by the Policy Service — see Rate Limits for both layers.
Key rotation
Rotate keys on a schedule (quarterly is a reasonable default), when a team member with key access leaves, or immediately on any suspected exposure. Multiple active keys can coexist, so rotation is zero-downtime:1
Create the new key
In the dashboard, create a replacement key (Settings → API Keys → Create key). The old key keeps working — both are valid simultaneously.
2
Deploy the new key
Update the secret in your secrets manager or environment config and roll your services. Verify traffic succeeds with the new key by checking any authenticated call returns
200.3
Revoke the old key
Back in the dashboard, revoke the old key. Requests using it fail from that moment with
401 INVALID_API_KEY — so confirm no service still holds it before revoking.If a key was exposed publicly (committed to git, pasted in a shared doc), skip the graceful order: revoke it first, then deploy a new one. A brief outage beats an open credential.
agent.key_rotated webhook.
Next steps
Webhooks Guide
Register endpoints and verify HMAC-SHA256 signatures.
API Introduction
Base URLs, idempotency, pagination, and versioning.
Key Management
Agent signing keys and the 2-of-3 MPC model.

