View link history
GET /api/consent/consent-links/history
Returns all consent links your organization has generated, ordered by creation time (newest first).
Authentication
Section titled “Authentication”This endpoint accepts two authentication methods:
| Method | Header | When to use |
|---|---|---|
| Bearer token | Authorization: Bearer <token> | Dashboard user session token. |
| API key | X-API-Key: <key> | Server-to-server calls. Requires a key with the consent (or admin) scope. |
To generate an API key, go to Settings → API Settings in the truConsent dashboard. See Get API key and org ID for step-by-step instructions.
Bearer token
Section titled “Bearer token”curl -X GET "https://api.truconsent.io/api/consent/consent-links/history?limit=50&offset=0" \ -H "Authorization: Bearer YOUR_SESSION_TOKEN" \ -H "X-Org-Id: YOUR_ORG_ID"const response = await fetch( "https://api.truconsent.io/api/consent/consent-links/history?limit=50&offset=0", { headers: { "Authorization": `Bearer ${sessionToken}`, "X-Org-Id": YOUR_ORG_ID, }, });
const history = await response.json();interface ConsentLinkHistoryItem { event_id: string; request_id: string; phone: string; email: string | null; collection_point_id: string; collection_point_name: string; asset_id: string | null; expires_at: string; is_verified: boolean; is_completed: boolean; created_at: string; consent_link: string;}
const response = await fetch( "https://api.truconsent.io/api/consent/consent-links/history?limit=50&offset=0", { headers: { "Authorization": `Bearer ${sessionToken}`, "X-Org-Id": YOUR_ORG_ID, }, });
const history: ConsentLinkHistoryItem[] = await response.json();import httpx
resp = httpx.get( "https://api.truconsent.io/api/consent/consent-links/history", params={"limit": 50, "offset": 0}, headers={ "Authorization": f"Bearer {session_token}", "X-Org-Id": YOUR_ORG_ID, },)history = resp.json()Invoke-RestMethod -Method Get ` -Uri "https://api.truconsent.io/api/consent/consent-links/history?limit=50&offset=0" ` -Headers @{ "Authorization" = "Bearer $SESSION_TOKEN" "X-Org-Id" = $YOUR_ORG_ID }API key
Section titled “API key”curl -X GET "https://api.truconsent.io/api/consent/consent-links/history?limit=50&offset=0" \ -H "X-API-Key: YOUR_API_KEY" \ -H "X-Org-Id: YOUR_ORG_ID"const response = await fetch( "https://api.truconsent.io/api/consent/consent-links/history?limit=50&offset=0", { headers: { "X-API-Key": API_KEY, "X-Org-Id": YOUR_ORG_ID, }, });
const history = await response.json();interface ConsentLinkHistoryItem { event_id: string; request_id: string; phone: string; email: string | null; collection_point_id: string; collection_point_name: string; asset_id: string | null; expires_at: string; is_verified: boolean; is_completed: boolean; created_at: string; consent_link: string;}
const response = await fetch( "https://api.truconsent.io/api/consent/consent-links/history?limit=50&offset=0", { headers: { "X-API-Key": API_KEY, "X-Org-Id": YOUR_ORG_ID, }, });
const history: ConsentLinkHistoryItem[] = await response.json();import httpx
resp = httpx.get( "https://api.truconsent.io/api/consent/consent-links/history", params={"limit": 50, "offset": 0}, headers={ "X-API-Key": API_KEY, "X-Org-Id": YOUR_ORG_ID, },)history = resp.json()Invoke-RestMethod -Method Get ` -Uri "https://api.truconsent.io/api/consent/consent-links/history?limit=50&offset=0" ` -Headers @{ "X-API-Key" = $API_KEY "X-Org-Id" = $YOUR_ORG_ID }Query parameters
Section titled “Query parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 50 | Number of records to return. |
offset | integer | 0 | Number of records to skip (for pagination). |
Responses
Section titled “Responses”Returns an array of link records ordered by creation time (newest first).
[ { "event_id": "e5f6a7b8-c9d0-1234-efab-567890abcdef", "request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "phone": "+*********210", "email": null, "collection_point_id": "550e8400-e29b-41d4-a716-446655440000", "collection_point_name": "Signup Form", "asset_id": "79bf87f5-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "expires_at": "2025-05-13T10:00:00+00:00", "is_verified": true, "is_completed": true, "created_at": "2025-05-12T10:00:00+00:00", "consent_link": "{COLLECTOR_BASE_URL}/your-subdomain/CP010/e5f6a7b8-..." }]| Field | Description |
|---|---|
event_id | Unique ID for the consent event. Use this to query the audit log. |
request_id | Unique ID for the link request. |
phone | Masked phone number — only the last three digits are visible. |
email | Email address the notification was sent to, or null. |
collection_point_id | UUID of the collection point. |
collection_point_name | Human-readable name of the collection point. |
asset_id | UUID of the asset, or null if not recorded. |
expires_at | When the link expires (ISO 8601 UTC). |
is_verified | true once the data principal verified their identity via OTP. |
is_completed | true once the data principal submitted the consent form. |
created_at | When the link was generated (ISO 8601 UTC). |
consent_link | The full URL of the consent link. |
Returned when X-Org-Id is missing or cannot be resolved to a known organization.
{ "detail": "Tenant context not found" }Returned when no valid credential is provided.
Missing Authorization header (Bearer path):
{ "detail": "Authorization token required" }Invalid or expired Bearer token:
{ "detail": "Invalid or expired auth token" }Invalid or inactive API key:
{ "detail": "Invalid or inactive API key" }Bearer token — user is not a member of the organization:
{ "detail": "User is not a member of this organization in PropelAuth" }Bearer token — user’s role does not have access:
{ "detail": "Role 'viewer' cannot 'read' on module 'collection-points'" }API key — key does not have the consent scope:
{ "detail": "API key does not have the 'consent' scope" }