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 https://holdyn-fb2e34c7cbae.herokuapp.com/api/v1/b2b/mandates?limit=5 \
-H "Authorization: Bearer $HOLDYN_API_KEY"const res = await fetch("https://holdyn-fb2e34c7cbae.herokuapp.com/api/v1/b2b/mandates?limit=5", {
headers: { Authorization: "Bearer " + process.env.HOLDYN_API_KEY },
});
const { data, has_more } = await res.json();The base is https://holdyn-fb2e34c7cbae.herokuapp.com/api/v1/b2b. Requests without a credential answer 401 missing_credentials.
Keys#
| Prefix | Mode | Use |
|---|---|---|
htst_ | Test | Sandbox work. May carry any scope, including test_helpers:write. |
hlive_ | Live | Production. 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
nullwithsecret_returned: false; the secret is never stored in a form that can be shown again.
Scopes#
| Scope | Allows |
|---|---|
mandates:read | Read mandates, collections, stages, releases and refunds. |
mandates:write | Create and change draft mandates, send them, propose amendments, cancel. |
parties:read, parties:write | Read and manage payers and payees. |
evidence:read, evidence:write | Read evidence; upload evidence and mandate documents. |
disputes:read | Read disputes. |
record:read | Read the record, checkpoints and verification results. |
templates:read | Read templates and presets. |
events:read | Read events. |
receipts:read | Read receipts. |
grants:write | Issue portal links yourself. In live mode this works only if an owner turned on tenant-delivered links. |
test_helpers:write | Use 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_active403 insufficient_scope(the key lacks the scope;required_scopenames 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.
