Skip to main content
Docs

Authentication

Integrations authenticate with an API key in the Authorization header. People signing in to the dashboard use a session token from the same API; they are covered at the end.

cURL
curl https://holdyn-fb2e34c7cbae.herokuapp.com/api/v1/b2b/mandates?limit=5 \
-H "Authorization: Bearer $HOLDYN_API_KEY"

The base is https://holdyn-fb2e34c7cbae.herokuapp.com/api/v1/b2b. Requests without a credential answer 401 missing_credentials.

Keys#

PrefixModeUse
htst_TestSandbox work. May carry any scope, including test_helpers:write.
hlive_LiveProduction. Created by an owner or admin; scopes are limited by the creator's role.

A key belongs to one mode and only ever sees objects of that mode. Create, roll and revoke keys in the dashboard under Developers, or with POST /api-keys as a signed-in member. The secret is shown once, when the key is created or rolled. If you lose it, roll the key.

  • Rolling issues a new key with the same name, scopes and mode, and keeps the old key working for up to 24 hours (you choose 0 to 24) so you can deploy without downtime.
  • Revoking takes effect immediately.
  • A replayed creation request returns the key as null with secret_returned: false; the secret is never stored in a form that can be shown again.

Scopes#

ScopeAllows
mandates:readRead mandates, collections, stages, releases and refunds.
mandates:writeCreate and change draft mandates, send them, propose amendments, cancel.
parties:read, parties:writeRead and manage payers and payees.
evidence:read, evidence:writeRead evidence; upload evidence and mandate documents.
disputes:readRead disputes.
record:readRead the record, checkpoints and verification results.
templates:readRead templates and presets.
events:readRead events.
receipts:readRead receipts.
grants:writeIssue portal links yourself. In live mode this works only if an owner turned on tenant-delivered links.
test_helpers:writeUse the sandbox helpers. Test keys only.

Legacy scopes (transactions:read, transactions:write, access_tokens:write, webhooks:manage) exist only for the legacy API.

What a key can never do#

No scope grants approvals, overrides, settings, members, Stripe connection, controls, external outcomes, cancellation confirmation, webhooks or billing. Those actions need a signed-in person with the right role, and many need a second person. An API key can prepare and read; it cannot approve a release.

Live keys#

A live key must stay within its creator's role ceiling: a developer can create live keys with read scopes and events:read; an owner or admin can create any scope. A live key with any write scope is created as pending_activation and works only after a different owner or admin approves it. Until then it answers 401 api_key_not_active. Creating a live key needs two-step verification.

Modes#

A key's mode is its prefix. You may send X-Holdyn-Mode, but if it differs from the key's mode the request fails with 400 mode_mismatch. See Test and live mode.

Errors you may see#

  • 401 missing_credentials, invalid_api_key, api_key_expired, api_key_not_active
  • 403 insufficient_scope (the key lacks the scope; required_scope names it), tenant_suspended (writes are refused while an account is suspended)
  • 400 mode_mismatch

See Errors.

Dashboard sessions#

Signing in with POST /auth/login returns a session token (a JWT) that lasts 12 hours by default, plus an MFA challenge first when the member has two-step verification. The dashboard sends the token as Authorization: Bearer <token> with X-Holdyn-Mode. Sessions can be ended one at a time, everywhere for one member, or for the whole tenant. A session token is not a credential for the participant portal, and the portal's credential is not accepted by the tenant API. The routes are in Authentication routes.

Participant portal credentials#

Payers and payees open a link that carries a one-time access token in the part after the #. The portal exchanges it for a short session (30 minutes). Money-moving actions can additionally require a six-digit code emailed to the party. See Party links and email codes.

Authentication · Holdyn Business docs