Purge a Contact's data
POST /v1/contacts/{contact_id}/purge
| Property | Value |
|---|---|
| Operation | purge_contact |
| Group | Contacts |
| Scope | contacts:write |
| Route class | control |
| Idempotency | Idempotency-Key accepted: a retry with the same key replays the first answer |
| Audit | Audited contacts.contact.purge (mutation) |
| Released in | 1.61.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
Deletes a Contact's profile, identity values and external ids at once (1.61.0; section 5.2), whatever its status, writes contact.purged, and answers what remains and why: consent records keyed by address hash, which survive an erasure request (ADR 0050, OQ-68), Audit events, and Calls whose contact_id no longer resolves.
Request
Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the contacts:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.
curl -X POST "$VOCAL_API/v1/contacts/ctc_.../purge" \
-H "Authorization: Bearer $VOCAL_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"const response = await fetch(`${process.env.VOCAL_API}/v1/contacts/ctc_.../purge`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.VOCAL_API_KEY}`,
'Idempotency-Key': crypto.randomUUID(),
},
});
console.log(response.status, await response.text());import os
import uuid
import requests
response = requests.post(
f"{os.environ['VOCAL_API']}/v1/contacts/ctc_.../purge",
headers={
"Authorization": f"Bearer {os.environ['VOCAL_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
)
print(response.status_code, response.text)Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
contact_id | path | ContactId | yes | The id of a Contact: ctc_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log. |
idempotency-key | header | string | no | A client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response. |
Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
200 | application/json | ContactPurge | |
400 | application/json | ErrorEnvelope | invalid_request |
401 | application/json | ErrorEnvelope | unauthenticated |
403 | application/json | ErrorEnvelope | forbidden, org_suspended |
404 | application/json | ErrorEnvelope | not_found |
409 | application/json | ErrorEnvelope | idempotency_in_progress, idempotency_key_reused |
429 | application/json | ErrorEnvelope | rate_limited |
500 | application/json | ErrorEnvelope | internal_error |
Fields of the 200 answer
The shape is ContactPurge.
| Field | Type | Required | Description |
|---|---|---|---|
contact_id | ContactId | yes | |
object | "contact_purge" | yes | |
purged_at | Timestamp | yes | |
remains | array of ContactPurgeRemainder | yes |