PactbasePactbase DocsDocs
APIReference

Consent data

GET
/api/v1/consent-records

The consent ledger: one row per purpose per decision, from every channel. Records never change once written. Page with cursor while has_more is true, keeping the same filters. Days are counted in IST. With no period or from/to, the last 24 hours are returned.

Requires an API key with the consent:read scope.

Authorization

ApiKey
headerAuthorizationBearer <token>

An API key, pb_live_ followed by 43 characters. X-API-Key: <key> is also accepted.

Query Parameters

period?string
Value in"today""yesterday""last_24_hours""last_7_days""last_30_days"
from?string
to?string
email?string
Lengthlength <= 320
subject_id?string
Lengthlength <= 200
subject_type?string
Value in"anonymous""identified"
collection_point?string
Lengthlength <= 200
purpose_id?string
Lengthlength <= 200
source?string
Value in"banner""form""preference_center""api""gpc""parental"
website?string
Lengthlength <= 253
granted?string
Value in"true""false"
order?string
Default"desc"
Value in"asc""desc"
limit?integer
Range1 <= value <= 1000
Default100
cursor?string
Lengthlength <= 500

Response Body

OK

application/json
  1. response
curl -X GET "https://example.com/api/v1/consent-records"
{  "data": [    {      "id": "5f0c2a4e-7d1b-4c1e-9a55-0c3b8e1f2d10",      "consent_event_id": "0b6c2f9e-3d4a-4b7e-8f21-6a9c1d0e5b72",      "recorded_at": "2026-10-10T19:02:11.483201+00:00",      "subject": {        "id": "asha@example.in",        "type": "identified"      },      "purpose": {        "id": "36ff83e5-1a2b-4c3d-9e4f-5a6b7c8d9e0f",        "name": "Newsletter",        "type": "data"      },      "granted": false,      "kind": "decision",      "source": "form",      "collection_point": {        "id": "be88e61c-2b3c-4d5e-8f6a-7b8c9d0e1f2a",        "slug": "newsletter",        "name": "Newsletter signup"      },      "website": "shop.example.in",      "notice_version": "3"    }  ],  "has_more": true,  "next_cursor": "WyIyMDI2LTEwLTEw...",  "period": {    "name": "yesterday",    "from": "2026-10-09T18:30:00.000Z",    "to": "2026-10-10T18:30:00.000Z",    "timezone": "Asia/Kolkata"  }}
GET
/api/v1/consent-state

The newest decision per purpose for one person. Pass email or subject_id.

Requires an API key with the consent:read scope.

Authorization

ApiKey
headerAuthorizationBearer <token>

An API key, pb_live_ followed by 43 characters. X-API-Key: <key> is also accepted.

Query Parameters

email?string
Lengthlength <= 320
subject_id?string
Lengthlength <= 200

Response Body

OK

application/json
  1. response
curl -X GET "https://example.com/api/v1/consent-state"
{  "subject": {    "id": "asha@example.in"  },  "purposes": [    {      "purpose_id": "36ff83e5-1a2b-4c3d-9e4f-5a6b7c8d9e0f",      "purpose": "Newsletter",      "granted": false,      "updated_at": "2026-10-10T19:02:11.483Z",      "consent_event_id": "0b6c2f9e-3d4a-4b7e-8f21-6a9c1d0e5b72",      "source": "preference_center"    }  ]}

List purposes

GET
/api/v1/purposes

Every purpose of the organisation, active and paused: id, name, type, category, lawful basis and description.

Requires an API key with the consent:read scope.

Authorization

ApiKey
headerAuthorizationBearer <token>

An API key, pb_live_ followed by 43 characters. X-API-Key: <key> is also accepted.

Response Body

OK

application/json
  1. response
curl -X GET "https://example.com/api/v1/purposes"
{  "data": [    {      "id": "36ff83e5-1a2b-4c3d-9e4f-5a6b7c8d9e0f",      "name": "Newsletter",      "type": "data",      "category": null,      "lawful_basis": "consent",      "active": true,      "description": "Product news by email"    }  ]}
GET
/api/v1/collection-points/{cp}

The purposes and notice version of a collection point, for an app screen or a form you build yourself. cp is the slug or id. lang returns approved translations. Show an unticked checkbox for basis: consent; show basis: legitimate_use as information only.

Requires an API key with the consent:read scope.

Authorization

ApiKey
headerAuthorizationBearer <token>

An API key, pb_live_ followed by 43 characters. X-API-Key: <key> is also accepted.

Path Parameters

cp*string
Length1 <= length <= 60

Query Parameters

lang?string
Length2 <= length <= 10
Default"en"

Response Body

OK

application/json
  1. response
curl -X GET "https://example.com/api/v1/collection-points/string"
{  "collection_point": {    "id": "be88e61c-2b3c-4d5e-8f6a-7b8c9d0e1f2a",    "slug": "newsletter",    "name": "Newsletter signup"  },  "lang": "hi",  "available_langs": [    "en",    "hi"  ],  "notice_version": "4",  "org_slug": "acme",  "purposes": [    {      "id": "36ff83e5-1a2b-4c3d-9e4f-5a6b7c8d9e0f",      "name": "Newsletter",      "description": "Product news by email",      "basis": "consent"    },    {      "id": "8a1c4d2e-5b6f-4a7b-8c9d-0e1f2a3b4c5d",      "name": "Order delivery",      "description": null,      "basis": "legitimate_use"    }  ]}