List consent history
GET
/api/v1/external/consents/historyUse 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.
| Header | Type | Required | Description |
|---|---|---|---|
X-Org-Id | string | Yes | Your organization slug |
X-API-Key | string | Yes | Your tenant API key |
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
asset_id | string | Yes | The asset ID to retrieve consent history for |
collection_point_id | string | No | Filter by collection point UUID or display_id |
source | string | No | Filter by source: consent-collector-portal, consent_link, npm, right_center_npm, sdk |
action | string | No | Filter by action: approved, declined, no_action, partial_consent |
dp_id | string | No | Filter by data principal ID |
from | string | No | ISO 8601 start timestamp. Must be in the past. |
to | string | No | ISO 8601 end timestamp. Defaults to current UTC time. |
limit | integer | No | Number of records to return. Between 1 and 200. Default: 50. |
offset | integer | No | Number of records to skip for pagination. Default: 0. |
Response
200 OK
| Field | Type | Description |
|---|---|---|
data | array | Consent log entries, ordered newest first |
count | integer | Number of records returned |
data[] fields:
| Field | Type | Description |
|---|---|---|
id | string | UUID of the consent log entry |
request_id | string | Request identifier, or null |
data_principal_id | string | The user ID associated with this consent record |
asset_id | string | Asset identifier, or null |
collection_point_id | string | UUID of the collection point, or null |
source | string | Source of the consent event, or null |
action | string | The recorded decision: approved, declined, partial_consent, revoked, or no_action |
timestamp | string | ISO 8601 timestamp of when the consent was recorded |
purpose_consents | array | Per-purpose consent breakdown |
metadata | object | Arbitrary key-value metadata |
Errors
| Status | Description |
|---|---|
400 | asset_id is missing, X-Org-Id could not be resolved, or timestamp format is invalid |
401 | X-API-Key is invalid or missing |
403 | API key lacks the admin scope |
404 | Collection point not found (when collection_point_id is provided) |
500 | Internal server error |
Example
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}