Read a consent record
GET /v1/consent-records/{consent_record_id}
| Property | Value |
|---|---|
| Operation | get_consent_record |
| Group | Consent |
| Scope | contacts:read |
Scopes of include values | evidence needs contacts:content |
| Route class | read |
| Idempotency | No Idempotency-Key |
| Audit | An audited content read contacts.consent.read, when the request names an include value |
| Released in | 1.62.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
Answers one record of the consent ledger with its source and evidence (1.62.0), never its address; the evidence's reference, the customer's own text, only when the read names include=evidence, which needs contacts:content and is an audited content read. A record of the other environment is not_found.
Request
Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the contacts:read scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.
curl "$VOCAL_API/v1/consent-records/csr_..." \
-H "Authorization: Bearer $VOCAL_API_KEY"const response = await fetch(`${process.env.VOCAL_API}/v1/consent-records/csr_...`, {
headers: {
Authorization: `Bearer ${process.env.VOCAL_API_KEY}`,
},
});
console.log(response.status, await response.text());import os
import requests
response = requests.get(
f"{os.environ['VOCAL_API']}/v1/consent-records/csr_...",
headers={
"Authorization": f"Bearer {os.environ['VOCAL_API_KEY']}",
},
)
print(response.status_code, response.text)Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
consent_record_id | path | ConsentRecordId | yes | The id of a consent record: csr_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log. |
include | query | array of ConsentRecordInclude | no | evidence adds the reference of the evidence (contacts:content). |
Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
200 | application/json | ConsentRecord | |
400 | application/json | ErrorEnvelope | invalid_request |
401 | application/json | ErrorEnvelope | unauthenticated |
403 | application/json | ErrorEnvelope | forbidden |
404 | application/json | ErrorEnvelope | not_found |
429 | application/json | ErrorEnvelope | rate_limited |
500 | application/json | ErrorEnvelope | internal_error |
Fields of the 200 answer
The shape is ConsentRecord.
| Field | Type | Required | Description |
|---|---|---|---|
applied_channels | array of ConsentChannel | yes | The channels whose state the record set: the channel itself, and under revocation_scope: all_channels every address channel of an Organization-scope opt-out. |
basis | ConsentBasis or null | yes | |
channel | ConsentChannel | yes | |
contact_id | ContactId or null | yes | The Contact the record names or whose identity holds the address; or null. |
environment | Environment | yes | |
evidence | ConsentEvidence or null | yes | |
id | ConsentRecordId | yes | |
identity_id | ContactIdentityId or null | yes | The identity of that Contact that holds the address; null for memory. |
object | "consent_record" | yes | |
occurred_at | Timestamp | yes | |
purpose | ConsentPurpose | yes | |
recorded_at | Timestamp | yes | |
recorded_by | ActorRef | yes | |
scope | ConsentScope | yes | |
sender | ConsentSender or null | yes | |
source | ConsentSource | yes | |
state | ConsentStateValue | yes |