Consent API
The Consent API is planned for Orion.02. This guide describes the published contract, so that you can build against it ahead of the release.
The Consent API gives a Data Holder's Consumer dashboards and app-to-app flows programmatic access to the consent store for one of its realms. Through it you can list and retrieve the Grants visible to a named User or Principal, revoke a Grant as the User who created it, and read the history of how a Grant reached its current state. It also exposes the account, notification, secondary-user and multi-party-sharing resources a dashboard needs to manage a holder customer's relationships around those Grants.
Every operation that reaches a Grant is anchored to a subject: either a Principal (typically the CDR Consumer) or a User (an actor who can authorise permissions such as CDR data sharing on a Principal's behalf). No Grant on this surface is reachable without naming one of the two. The sole exception is GET /{realmName}/meta/endpoints, which names no subject at all: it reports the current deployment's static capabilities and reaches no Grant.
The caller is the Data Holder's own backend - the same backend behind a Consumer Dashboard or an app-to-app flow - authenticating to the Consent API as a Biza ID machine-to-machine client via the OAuth2 client_credentials grant (see Security Profile). It is never an external party: callers are not CDR participants, and hold no CDR Data Sharing Arrangement token. Naming a User or a Principal declares whose view this call sees, not who is calling; your backend is expected to identify the end user itself and assert the correct Principal or User scope on their behalf. For app2app callers specifically, the handoff that establishes this session is described in the App-to-App Registration runsheet. See API Architecture: Users vs Principals below for what that scoping does and does not protect.
For the full reference see the Consent API specification. For how a caller connects and authenticates, see the Security Profile.
Terminology quick referenceβ
The Consent API uses these terms, defined in Key Terms:
- Grant: a record of the permission a Consumer gave, as an established set of tokens for designated APIs. A Grant typically corresponds to a CDR Data Sharing Arrangement and may be made up of multiple active and historical consents. Its Grant Type (
grantType) says what kind of Grant it is, and its Grant History is the event stream of how it changed. Amending a Grant terminates the current consent and creates a new one. - Principal: the core-system customer the Grant is held against. In the CDR, this is the CDR Consumer: either an Individual (a person) or a Non-Individual (such as a business, trust or non-profit).
- User: an authenticated person who can act on the Principal's behalf: the Consumer themselves, a Nominated Representative of a Non-Individual Consumer, or a Secondary User. A Grant always relates to both a Principal and a User, identified by the same
principalIdanduserIdthat the Data Adapter uses for therealmName. - Realm: the authorisation realm of one Holder Brand, named in every path as
{realmName}. - Profile: a Principal a User can act as, paired with the basis for that access (
profileType), such as their own Principal, a Nominated Representative role, or an Authority To Operate. Calling the Profiles endpoints lists the profiles a User holds. This gives you the valid Principal IDs needed to query their Grants. - DOMS: the Disclosure Option Management Service for joint accounts.
act_token: the one-shot handoff token for an app-to-app authorisation.
How Grants are Filtered for Usersβ
This API represents CDR_SHARING_ARRANGEMENT_V1 grants. In the future, other grant types may be added.
A grant is visible to a specific User if:
- The specified User created the grant.
- The specified User owns an account that is shared by the grant. When a User views a grant created by another User, the accounts shown are filtered to only those the viewing User owns.
Only the original creator of a grant can revoke it via DELETE /{realmName}/user/{userId}/grant/{grantId}).
Vulnerable User Withholdingβ
A Grant that would otherwise qualify is withheld, or completely hidden, if an associated User was vulnerable when the Grant was created. For example, if a joint account holder has been identified as vulnerable, the other account holder cannot see the grants that are created by the vulnerable user.
To strictly maintain privacy, hidden grants behave identically to non-existent grants:
- They are completely omitted from list responses.
- Direct reads return a
404 Not Found. - No "withheld" flags or any other signals are returned, ensuring a consumer with no grants appears in an identical manner to a consumer whose grants are entirely withheld.
API scopeβ
This collection only includes the CDR_SHARING_ARRANGEMENT_V1 grants, which represents a Consumer's Sharing Arrangement (GrantV1.grantType). It explicitly excludes other authorisation artifacts, such as machine-to-machine grants, or consumer dashboard login sessions. Excluded grants are not counted in the totals and return a 404 Not Found if requested directly.
State Changesβ
The only change you can make directly to a grant through this API is revoking it. Grants are otherwise read-only here; the API's other write operations (notification preferences, secondary user access, and DOMS requests) act on related resources, not on the grant itself.
Amending a CDR Data Sharing Arrangement requires the CDR Consumer to reauthorise the data disclosure, which happens outside this API entirely. Other external events can still alter a grant, such as a joint account owner withdrawing their account. These events create a CDR_SHARING_ARRANGEMENT_V1_AMENDED history entry detailing the amendmentCause.
API Architecture: Users vs Principalsβ
To handle different access requirements, the API provides two distinct endpoints rather than a single collection with filters.
/{realmName}/user/{userId}/grant(User View): Displays what a specific User is permitted to see. A grant here may include accounts belonging to other users. If accounts are attached that the specific user cannot see, theaccountWithheldboolean is set totrue./{realmName}/principal/{principalId}/grant(Principal View): Displays all grants held against a specific Principal across all associated users. No data is withheld in this view.
These endpoints solve for different problems: the presentation of Grants for a particular User and the presentation of Grants for a particular Principal.
The endpoint path determines whether a User or Principal ID is required. The API checks the ID against the grant data, not the caller's identity. For instance, a User may be able to view a grant on a joint account that was originally created by a different user and principal, even if they don't own it.
If the requested User or Principal does not match the grant, the API returns 404 Not Found instead of 403 Forbidden. This prevents malicious actors from probing the API to confirm whether a specific grant ID exists. A 403 error is reserved for token scope issues.
Authentication and authorisationβ
The Consent API uses OAuth 2.0 bearer tokens issued by Biza ID through the client credentials grant. Your backend requests a token, then sends it on every call. These are the Consent API's scopes; the Scopes and roles reference lists the operations each one covers, alongside every other scope and role HaaS uses.
| Scope | Allows |
|---|---|
biza-au:haas:consent:read | Read endpoint metadata, Grants, Grant history, accounts and profiles grounded under a named User or Principal |
biza-au:haas:consent:revoke | Revoke a Grant as the User who created it |
biza-au:haas:consent:write | Update a User's own notification preferences |
biza-au:haas:secondary-user:read | Read the secondary users on an account |
biza-au:haas:secondary-user:write | Enable or disable a secondary user's access to an account |
biza-au:haas:doms:read | Read Disclosure Option Management Service (DOMS) requests on an account |
biza-au:haas:doms:write | Propose, approve or deny a DOMS request on an account |
biza-au:haas:consent:exchange | Exchange the holder's own session token for an app2app handoff token. Held by your backend, never by the native app |
A token is bound to the HaaS space it was issued for. A scope does not limit which User or Principal you can name, because you assign those identifiers yourself (see API Architecture: Users vs Principals).
Error handlingβ
The Consent API deliberately limits what it tells an unauthenticated or unauthorised caller:
| Status | Meaning |
|---|---|
400 | A parameter or header is malformed. |
401 | The token is missing or invalid. The WWW-Authenticate header describes why. |
403 | The token is valid but lacks the required scope, and nothing else. The WWW-Authenticate header names the scope needed. |
404 | The Grant does not exist, is not related to the named User or Principal, or the named User is not permitted to see it. |
406 | The requested operation version is not supported. |
A Grant a Consumer cannot see and a Grant that does not exist both return the same 404, never a 403. This prevents
one Consumer from probing for another Consumer's arrangements. A 403 always means insufficient scope, never a hidden Grant.
Versioningβ
Each operation is versioned independently, in both request and response, so a new version of one endpoint never forces you to uplift the others. Send the desired response version in x-haas-v; the served version is echoed in the x-haas-v response header and is also carried in the payload itself as the version discriminator. Call GET /{realmName}/meta/endpoints to discover which versions this deployment supports for each operation. It uses the same path, operationId and x-haas-max-v request header as the Data Adapter's Get Endpoint Meta.
Responses this document does not describeβ
Not every response from this host comes from the API itself. A proxy or load balancer in front of it generates its own responses (for example, on an outage, a route miss, a rate limit, or a TLS or protocol fault). These are deliberately not described here, because this page describes what the application generates. Expect some errors that are not documented.
Endpointsβ
The endpoints are organised by the capability they provide:
- Grants: listing, retrieving and revoking the Grants visible to a named User or Principal, and reading a Grant's history.
- Accounts: reading the accounts visible to a named User or Principal, including account details scoped to a single Grant.
- Notifications: reading and updating a User's notification preferences for one account.
- Secondary Users: reading and updating the secondary users an account owner has authorised.
- DOMS: proposing, reading and resolving DOMS Sharing requests on a joint account.
- Profiles: discovering the profiles a User can act as, and each one's vulnerability status.
- Discovery: what the current deployment supports for each operation.
- App-to-App: exchanging the holder's own session token for a
request_uri-boundact_token, for the app2app consent-flow handoff (RFC 8693).