User banners
GET
/banners/user/{user_id}Use this endpoint to retrieve the consent banners that a specific user has already interacted with. Unlike GET /banners, which returns all banners with a default status of "declined", this endpoint filters to collection points where the user has a recorded consent log entry and overlays each purpose with the user’s actual consent status.
If the user has no consent history, the response is an empty array.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | string | Yes | The identifier of the user whose consent history should be retrieved |
Headers
| Header | Type | Required | Description |
|---|---|---|---|
X-API-Key | string | Yes | Your tenant API key |
Response
200 OK — an array of BannerMeta objects. The structure matches GET /banners with two differences:
- The array contains only collection points where the user has a consent log entry.
- Each purpose’s
consentedfield reflects the user’s actual recorded status instead of the default"declined".
An empty array [] is returned when the user has no consent records — this is not an error.
| Field | Type | Description |
|---|---|---|
banner_id | string | UUID of the collection point |
collection_point | string | UUID of the collection point |
title | string | Display name of the collection point |
asset | object or null | Asset associated with the collection point, or null |
purposes | array | Purposes with the user’s actual consent status applied |
data_elements | array | Data elements linked across all purposes |
legal_entities | array | Legal entities linked across all purposes |
shown_to_principal | boolean | true if the user’s most recent action for this collection point was "approved" |
purposes[] fields:
| Field | Type | Description |
|---|---|---|
id | string | UUID of the purpose |
name | string | Display name |
is_mandatory | boolean | Whether acceptance is mandatory |
expiry_period | string or null | Human-readable expiry period |
consented | string | The user’s recorded consent status: "approved", "declined", or "pending". Defaults to "pending" if no matching entry is found. |
relationships | object | Raw relationship maps to data elements, legal entities, and other entities |
Errors
| Status | Description |
|---|---|
400 | Tenant context could not be resolved from the provided API key |
500 | Unexpected server error |
Example
curl --request GET \ --url https://api.truConsent.io/banners/user/usr_abc123 \ --header "X-API-Key: YOUR_API_KEY"User has consent records:
[ { "banner_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "collection_point": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "title": "Website Sign-up Consent", "asset": { "id": "f1e2d3c4-b5a6-7890-abcd-123456789012", "name": "Marketing Website", "description": null, "asset_type": "website" }, "purposes": [ { "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "name": "Marketing Communications", "is_mandatory": false, "expiry_period": "1 Year", "consented": "approved", "relationships": { "data_elements": ["de-uuid-1"], "legal_entities": ["le-uuid-1"] } } ], "data_elements": [ { "id": "de-uuid-1", "name": "Email Address" } ], "legal_entities": [ { "id": "le-uuid-1", "name": "Acme Corp Ltd" } ], "shown_to_principal": true }]User has no consent records:
[]