Skip to content

List consent history

GET /api/v1/external/consents/history

Use this endpoint to retrieve all consent log entries recorded for an asset, with optional filtering by collection point, data principal, source, action, and date range. Results are ordered newest first.

Authentication

Both headers are required.

HeaderTypeRequiredDescription
X-Org-IdstringYesYour organization slug
X-API-KeystringYesYour tenant API key

Query parameters

ParameterTypeRequiredDescription
asset_idstringYesThe asset ID to retrieve consent history for
collection_point_idstringNoFilter by collection point UUID or display_id
sourcestringNoFilter by source: consent-collector-portal, consent_link, npm, right_center_npm, sdk
actionstringNoFilter by action: approved, declined, no_action, partial_consent
dp_idstringNoFilter by data principal ID
fromstringNoISO 8601 start timestamp. Must be in the past.
tostringNoISO 8601 end timestamp. Defaults to current UTC time.
limitintegerNoNumber of records to return. Between 1 and 200. Default: 50.
offsetintegerNoNumber of records to skip for pagination. Default: 0.

Response

200 OK

FieldTypeDescription
dataarrayConsent log entries, ordered newest first
countintegerNumber of records returned

data[] fields:

FieldTypeDescription
idstringUUID of the consent log entry
request_idstringRequest identifier, or null
data_principal_idstringThe user ID associated with this consent record
asset_idstringAsset identifier, or null
collection_point_idstringUUID of the collection point, or null
sourcestringSource of the consent event, or null
actionstringThe recorded decision: approved, declined, partial_consent, revoked, or no_action
timestampstringISO 8601 timestamp of when the consent was recorded
purpose_consentsarrayPer-purpose consent breakdown
metadataobjectArbitrary key-value metadata

Errors

StatusDescription
400asset_id is missing, X-Org-Id could not be resolved, or timestamp format is invalid
401X-API-Key is invalid or missing
403API key lacks the admin scope
404Collection point not found (when collection_point_id is provided)
500Internal server error

Example

Terminal window
curl --request GET \
--url 'https://truapi-dev.truconsent.io/api/v1/external/consents/history?asset_id=ast_xxxxxxxxxxxx&limit=10&offset=0' \
--header 'X-Org-Id: acme' \
--header 'X-API-Key: tck_live_xxxxxxxxxxxx'
{
"data": [
{
"id": "c1d2e3f4-aaaa-bbbb-cccc-ddddeeeeeeee",
"request_id": "req_external_8821",
"data_principal_id": "usr_7f3a9b21",
"asset_id": "ast_xxxxxxxxxxxx",
"collection_point_id": "a0b1c2d3-1111-2222-3333-444455556666",
"source": "npm",
"action": "partial_consent",
"timestamp": "2026-04-21T10:34:52.123456+00:00",
"purpose_consents": [
{
"purpose_id": "3d6e2f1a-bc74-4e9a-a801-123456789abc",
"purpose_name": "Marketing emails",
"status": "approved",
"is_mandatory": false,
"purpose_type": "marketing",
"purpose_version": 1
}
],
"metadata": { "ip_address": "203.0.113.42" }
}
],
"count": 1
}