Skip to content

Record consent

POST /consent/{collection_point_id}/consent

Use this endpoint to record a user’s consent decision at a specific collection point. Each call appends an immutable entry to the consent log — existing records are never modified or deleted. The collection point may be identified by its UUID or its human-readable display_id.

Path parameters

ParameterTypeRequiredDescription
collection_point_idstringYesUUID or display_id of the collection point where consent is being recorded

Headers

HeaderTypeRequiredDescription
X-API-KeystringYesYour tenant API key

Body

FieldTypeRequiredDescription
userIdstringYesThe ID of the user giving consent. Stored as data_principal_id on the consent log entry.
actionstringYesThe top-level consent decision. One of: approved, declined, partial_consent, revoked, no_action.
purposesarrayNoPer-purpose consent decisions. Omit if the collection point does not have granular purposes.
requestIdstringNoAn external request identifier for idempotency and audit correlation. If omitted, the API generates a UUID.
metadataobjectNoArbitrary key-value pairs stored alongside the consent log entry.

purposes[] fields:

FieldTypeDescription
idstringUUID of the purpose
namestringDisplay name of the purpose
consentedstringPer-purpose decision: approved or declined
is_mandatorybooleanWhether this purpose is mandatory. Informational only.
purpose_typestringOptional purpose classification. May be null.

Response

201 Created

FieldTypeDescription
idstringUUID of the consent log entry
actionstringThe recorded consent action
collection_point_idstringUUID of the collection point
purpose_consentsarrayPer-purpose consent breakdown as stored
timestampstringISO 8601 timestamp of when the consent was recorded
statusstringProcessing status. Always pending on creation.
request_idstringThe request identifier — the value you provided or a server-generated UUID

purpose_consents[] fields:

FieldTypeDescription
purpose_idstringUUID of the purpose
purpose_namestringDisplay name of the purpose
statusstringStored per-purpose status: approved or declined
is_mandatorybooleanWhether the purpose was flagged as mandatory at time of recording
purpose_typestringPurpose classification, or null if not provided
purpose_versionintegerVersion of the purpose at time of recording

Errors

StatusDescription
400userId is missing, or the tenant context could not be resolved
404No collection point found matching collection_point_id
422action is not one of the allowed values, or the request body fails validation
500Internal server error

Example

Terminal window
curl --request POST \
--url 'https://{your-truConsent-endpoint}/consent/cp_signup_form/consent' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: tck_live_xxxxxxxxxxxx' \
--data '{
"userId": "usr_7f3a9b21",
"action": "partial_consent",
"purposes": [
{
"id": "3d6e2f1a-bc74-4e9a-a801-123456789abc",
"name": "Marketing emails",
"consented": "approved",
"is_mandatory": false,
"purpose_type": "marketing"
},
{
"id": "9a1b4c2d-ef56-7890-b234-abcdef012345",
"name": "Analytics",
"consented": "declined",
"is_mandatory": false,
"purpose_type": "analytics"
}
],
"requestId": "req_external_8821",
"metadata": {
"ip_address": "203.0.113.42",
"user_agent": "Mozilla/5.0"
}
}'
{
"id": "c1d2e3f4-aaaa-bbbb-cccc-ddddeeeeeeee",
"action": "partial_consent",
"collection_point_id": "a0b1c2d3-1111-2222-3333-444455556666",
"purpose_consents": [
{
"purpose_id": "3d6e2f1a-bc74-4e9a-a801-123456789abc",
"purpose_name": "Marketing emails",
"status": "approved",
"is_mandatory": false,
"purpose_type": "marketing",
"purpose_version": 1
},
{
"purpose_id": "9a1b4c2d-ef56-7890-b234-abcdef012345",
"purpose_name": "Analytics",
"status": "declined",
"is_mandatory": false,
"purpose_type": "analytics",
"purpose_version": 1
}
],
"timestamp": "2026-04-21T10:34:52.123456",
"status": "pending",
"request_id": "req_external_8821"
}