All Docs
FeaturesagentOS Direct DebitUpdated March 13, 2026

API Key Scoped Access for DD Resources

API Key Scoped Access for DD Resources

Version 1.0.17 extends the API key authentication system with granular, Direct Debit–specific scopes. Every DD tRPC procedure now enforces both key validity and scope membership before a request is processed.


How It Works

When a request arrives at a DD tRPC procedure, the authentication middleware:

  1. Extracts the API key from the request.
  2. Validates that the key exists and is active.
  3. Checks that the key carries the required scope for the target procedure.
  4. Rejects the request with a 401 Unauthorized or 403 Forbidden response if either check fails.

Keys can hold multiple scopes. A key used for a full agentOS integration would typically carry all relevant scopes, while a reporting-only integration would carry only reports:read.


Available Scopes

ScopeAccess Granted
mandates:readView mandate records, status, and details
mandates:writeCreate, update, cancel, suspend, and reactivate mandates
collections:readView collection records, schedules, and history
alerts:readView system alerts and threshold breach notifications
alerts:writeAcknowledge and manage alerts
reports:readAccess collection success rate reports, clawback history, and mandate activity reports

Scope Requirements by Endpoint

Mandates

ProcedureRequired Scope
Get mandate / list mandatesmandates:read
Send mandate invitemandates:write
Cancel mandatemandates:write
Suspend mandatemandates:write
Reactivate mandatemandates:write

Collections

ProcedureRequired Scope
Get collection / list collectionscollections:read
View upcoming collectionscollections:read

Alerts

ProcedureRequired Scope
List alertsalerts:read
Acknowledge alertalerts:write

Reports

ProcedureRequired Scope
Collection success rate reportreports:read
Clawback history reportreports:read
Mandate activity reportreports:read

agentOS Integration

agentOS integrates with the DD service exclusively via scoped API keys. No session-based or OAuth authentication is used for service-to-service communication. When provisioning an API key for agentOS, assign only the scopes required for the integration's intended functions, following the principle of least privilege.


Error Responses

SituationResponse
Missing or invalid API key401 Unauthorized
Valid key, insufficient scope403 Forbidden