API
POST /api/v1/consents
Register a consent record for a subject, data collection purpose, and validity window.
Register consent
Creates a consent record for a subject and purpose, and stores the associated metadata for audit and monitoring workflows.
POST
Request body
| Field | Type | Description |
|---|---|---|
| subjectId | string | Unique external identifier for the data subject or user. |
| purpose | string | Purpose name or purpose code associated with the consent. |
| dataElements | array | Data elements covered by the consent record. |
| consentSource | string | Source of the consent decision such as web, mobile, or backend. |
| validFrom | string | Start timestamp for the consent validity window. |
| validTo | string | Optional end timestamp for consent expiration. |
curl -X POST https://apis.digitalanumati.com/api/v1/consents \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"subjectId": "user_12345",
"purpose": "appointment-communication",
"dataElements": ["mobile_number", "email"],
"consentSource": "web",
"legalBasis": "consent",
"validFrom": "2026-09-28T10:00:00Z",
"validTo": "2027-09-28T10:00:00Z"
}'Example response
{
"consentId": "c_01J7NM6QX9",
"status": "active",
"purpose": "appointment-communication",
"subjectId": "user_12345",
"version": 1,
"grantedAt": "2026-09-28T10:00:00Z"
}Errors
Validation
If the request is missing required fields or the purpose is invalid, the API returns a 400 response with a structured error payload.