Partner API

Authentication

The v2 partner API supports a single authentication mechanism: OAuth2
client credentials grant.
There is no API key, no session cookie, no JWT-mock, and no password /
authorization_code grant. This is deliberate — other auth styles are easy to
misconfigure and create security or support problems in production.

Endpoint

POST /oauth/token (Content-Type: application/x-www-form-urlencoded)

Param Required Notes
grant_type yes Must be client_credentials.
client_id yes UID shown in the Integrations UI.
client_secret yes A non-revoked secret of the application.
scope optional Space-separated. Defaults to your application's default scopes.

A successful response returns a bearer token valid for 15 minutes
(expires_in: 900; there are no refresh tokens, request a new one):

{
  "access_token": "eyJhbGciOi...",
  "token_type":   "Bearer",
  "expires_in":   900,
  "scope":        "dpps:read templates:read",
  "created_at":   1742480000
}

Use it as Authorization: Bearer <access_token> on every /api/v2/* call.

Scope catalogue

Tokens are scoped per call. A scope is granted if (a) the application was
configured for it AND (b) the token request asks for it. enforce_configured_scopes
is on, so requesting an unknown or undeclared scope fails with 400 invalid_scope.

Scope Purpose Endpoints
templates:read Read product templates and sections GET /api/v2/product_templates*
templates:write Create/update/delete templates, clone POST/PATCH/DELETE /api/v2/product_templates*
dpps:read Read DPPs and their data GET /api/v2/dpps*
dpps:write Create/update/delete DPPs POST/PATCH/DELETE /api/v2/dpps*
dpps:publish Publish/unpublish DPPs POST/DELETE /api/v2/dpps/:id/publication
journey:write Create/update/delete journey steps POST/PATCH/DELETE /api/v2/dpps/:id/journey_steps*
compliance:read Read compliance requirements + documents GET /api/v2/dpps/:id/compliance_requirements*
compliance:write Upload/delete compliance documents POST/DELETE /api/v2/.../compliance_documents*
contacts:read Read contacts GET /api/v2/contacts*
contacts:write Create/update/delete contacts POST/PATCH/DELETE /api/v2/contacts*
organization:read Read your own organisation context GET /api/v2/organization*
imports:write Trigger CSV / spreadsheet / JSON imports POST /api/v2/imports/*
imports:google_drive Use the Google Drive importer POST /api/v2/imports/dpps/google_drive
webhooks:manage Register/rotate/delete webhook endpoints * /api/v2/webhooks*

Default scopes for a new application: templates:read dpps:read. Adjust them in
the application UI before issuing your first token.

EN 18222 note (18222-14): the standard requires that required methods
differ by actor role: creator, main service provider, back-up service
provider. dpps:write/journey:write scopes (plus the administrator,
manager and member human roles) map to the creator actor. Orobo is
always the main service provider for every DPP it hosts (platform-level,
not a per-DPP role) and reads anonymously or via dpps:read. A back-up
service provider
has not been appointed, so no role or scope maps to it
yet (see 18221-10a in the Scope & Exclusions tracker). The canonical
mapping lives in Dpp::EN_18222_ACTOR_ROLES.

Secret rotation (multiple active secrets)

Each application supports any number of active client secrets. The token
endpoint accepts any non-revoked secret. The recommended rotation workflow:

  1. Generate a new secret in the UI (rotate flow). The plaintext is shown once.
  2. Deploy the new secret to every consumer.
  3. Verify all traffic is using the new prefix (prefix…last4 is shown in the UI).
  4. Revoke the old secret. Existing tokens minted with the old secret continue to work until they expire; only new token requests will be refused.

Failure to rotate is your problem, not ours — we will not nag you.

Application revocation

Revoking the whole application from the UI does three things atomically:

  • Stamps revoked_at on the application.
  • Stamps revoked_at on every active access token (existing tokens stop working immediately).
  • Stamps revoked_at on every active secret (no new tokens can be minted).

Use this when a credential is leaked. Then create a new application with fresh
credentials. There is no "un-revoke".

IP allowlist

Each application can carry an optional list of CIDR ranges. When set, the API
only honours bearer tokens issued to that application when the request reaches
us from an IP in the list
. Outside the allowlist you get a 403 with a
problem-details body.

  • Empty list = allow any IP.
  • IPv4 + IPv6 are both supported.
  • The check uses request.remote_ip (Rails' XFF-aware accessor); we do not trust client-supplied headers when running behind our edge.

mTLS roadmap (not implemented)

Mutual TLS is out of scope for v2.0. We will offer it for high-trust partners
in a later minor release; until then, the IP allowlist + bearer token + audit
log is the strongest posture available.

Audit trail

Every authenticated /api/v2/* request writes one row to api_audit_logs
(method, path, status, latency, scope, request_id, oauth application id,
organisation id, IP, user agent, redacted request summary). Public anonymous
endpoints (/api/v2/public/*) are not audited. Authorization, Cookie, and
X-Api-Key headers are stripped before persistence.