Endpoint
Authentication
Requires a developer API key in theAuthorization header.
Request Headers
| Header | Value |
|---|---|
Authorization | Bearer <api_key> |
Content-Type | application/json |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
grantId | string | Yes | The grant to attach the consent record to |
dataPrincipalId | string | Yes | The data principal (end-user) providing consent |
purposes | object[] | Yes | Array of purpose objects ({ code, description }) |
consentNoticeId | string | Yes | ID of the consent notice shown to the principal |
processingExpiresAt | string | Yes | ISO-8601 timestamp when data processing permission expires |
Purpose Object
| Field | Type | Description |
|---|---|---|
code | string | Machine-readable purpose code (e.g., "analytics", "personalization") |
description | string | Human-readable description of the purpose |
Example Request
Response — 201 Created
Response Fields
| Field | Type | Description |
|---|---|---|
recordId | string | Unique consent record ID |
grantId | string | The grant this consent is attached to |
dataPrincipalId | string | The data principal who gave consent |
consentNoticeHash | string | SHA-256 hash of the consent notice content |
consentProof | object | Cryptographic proof of consent (Ed25519 signature or none if key unavailable) |
processingExpiresAt | string | ISO-8601 timestamp when processing permission expires |
retentionUntil | string | ISO-8601 timestamp for data retention limit (30 days after processing expiry) |
status | string | Record status: active |
createdAt | string | ISO-8601 creation timestamp |
Error Responses
| Status | Code | Description |
|---|---|---|
| 400 | BAD_REQUEST | Missing required fields |
| 400 | INVALID_GRANT | Grant not found or not owned by developer |
| 400 | INVALID_NOTICE | Consent notice not found |
| 401 | UNAUTHORIZED | Invalid or missing API key |