doomConsentPurpose
mutation · in the family Consent purpose
What it does
Permanently retire a consent purpose — one named thing customers can allow or refuse (marketing email, data use).
Doom (terminal) a ConsentPurpose: active|inactive → doomed. -GATED by the everReferenced write-once stamp — a purpose ever named by a consent decision refuses CONFLICT/REFERENCED (detail names the ConsentRecord type, id-less — the cardinality forbids listing walks; historical proof blocks forever, pre-purge; deactivate is the retire lane). A virgin purpose dooms freely; its code marker releases with the flip (reissuable — the org-code class). Requires the current revision + the unrestricted capability.
Before you call
A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.
Capability area: Privacy and compliance — Tax and fiscal configuration, certificates and privacy requests.
Roles that may call it:
- Owner
- System Administrator
- An API key whose scope allows
api:doomConsentPurpose
Careful
Doom is forever — a doomed record never comes back into use (its history remains readable). Anything still referencing it live will block the doom.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
id | ID ID! | yes | The id of the record. |
revision | ID ID! | yes | The revision id you read on the record; the change is refused if an edit landed in the meantime. |
reason | String | no |
Concurrency
Send the record’s current revision from your last read as revision. A stale revision is refused as CONFLICT/REVISION_STALE — read the record again and retry with the new value.
Returns
ConsentPurpose ConsentPurpose! — A ConsentPurpose — the merchant-definable registry of what consent can be requested for. Canned + custom as the role model works: the 6 canned baselines are code-virtual versioned templates (cannedConsentPurposes lists them; copyCannedConsentPurpose materializes an ordinary editable group row — bootstrap materializes zero). Per-channel marketing granularity = distinct purposes (GDPR consent is specific, never bundled). consentModel ∈ {opt_in, opt_out} — opt_in: an absent record ⇒ denied (GDPR) · opt_out: an absent record ⇒ allowed until withdrawn (CCPA Do-Not-Sell) — immutable after birth. The code is the mutable machine handle — unique among non-doomed per group via the consentPurposeCode uniq marker (the organizationCode class: edit = release/reserve swap; doom releases [reissuable]; inactive holds; a collision refuses CONFLICT/IDENTITY_TAKEN). Doom is gated by the everReferenced write-once stamp; deactivate is ungated. NOT searchable (config, not a book); NO description field (captions + decorations do display duty).
Example request
mutation ExampleDoomConsentPurpose($id: ID!, $revision: ID!, $reason: String) {
doomConsentPurpose(id: $id, revision: $revision, reason: $reason) {
id
sysId
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
code
consentModel
templateKey
templateVersion
everReferenced
}
}Variables:
{
"id": "01900000-0000-7000-8000-82d1f6990000",
"revision": "01900000-0000-7000-8000-b7960e180000",
"reason": "Correcting a miscount."
}Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"doomConsentPurpose": {
"id": "01900000-0000-7000-8000-82d1f6990000",
"sysId": "PP-EXMP-0000-000F",
"type": "ConsentPurpose",
"caption": "Blue jeans",
"status": "doomed",
"parentId": "01900000-0000-7000-8000-eacdfcfd0000",
"rootId": "01900000-0000-7000-8000-a1295a650000",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revisionNum": 1,
"revision": "01900000-0000-7000-8000-53c6eea90000",
"code": "BJ-001",
"consentModel": "<consent model>",
"templateKey": "<template key>",
"templateVersion": 1,
"everReferenced": true
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": {
"name": "genesis",
"number": 0
},
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}Errors this call can answer
VALIDATION/INVALID— Something in the request is not valid. Retry: no. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. Retry: no. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. Retry: no. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. Retry: yes. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. Retry: no. (NOT_FOUND)CONFLICT/*— The record’s state, or a change made in the meantime, does not allow this; the codes are on the CONFLICT page. (CONFLICT)VALIDATION/VERSION_REQUIRED— The request did not say which app version it came from. Retry: no. (VALIDATION)