# ConsentPurpose

object type

A ConsentPurpose — the merchant-definable registry of WHAT consent can be requested for (group-parented master; GROUP-WIDE scope — per-org consent is the lock's flagged-not-now). 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).

## Fields

| Field | Type | Notes |
| --- | --- | --- |
| `id` | [ID](/types/#scalars) `ID!` | The record’s id — a UUID the platform assigned when the record was created; every reference to this record uses it. |
| `sysId` | [String](/types/#scalars) `String!` | The group-scoped human-facing system id (PP-…). |
| `type` | [String](/types/#scalars) `String!` | The kind of record — always `ConsentPurpose` here. |
| `caption` | [String](/types/#scalars) `String!` | The record’s display name — what people see it called. |
| `status` | [String](/types/#scalars) `String!` | The FSM state: active \| inactive \| doomed. |
| `parentId` | [ID](/types/#scalars) `ID!` | The parent org group; for a ConsentPurpose parentId === rootId. |
| `rootId` | [ID](/types/#scalars) `ID!` | The org-group family root. |
| `createdAt` | [String](/types/#scalars) `String!` | When the record was created, as a UTC timestamp. |
| `updatedAt` | [String](/types/#scalars) `String!` | When the record last changed, as a UTC timestamp. |
| `revisionNum` | [Int](/types/#scalars) `Int!` | How many times this record has been edited; the first save is 0. |
| `revision` | [ID](/types/#scalars) `ID!` | The OCC revision token — supply it on every mutation of this record; rotates on every write. |
| `refCaptions` | [RefCaption](/types/RefCaption/) `[RefCaption!]!` | The server-composed captions of this record's declared references (the referenced-caption rule) — one row per referenced id; see RefCaption. |
| `code` | [String](/types/#scalars) `String!` | The machine-portable handle (^\[a-z]\[a-z0-9_]{1,63}$; stored NORMALIZED trim+lowercase) — future comms/segments address purposes BY CODE. UNIQ among NON-DOOMED per group (the consentPurposeCode marker: edit swaps, doom releases, inactive holds; CONFLICT/IDENTITY_TAKEN on collision). |
| `consentModel` | [String](/types/#scalars) `String!` | opt_in \| opt_out — the two consent regimes on ONE mechanism. ⚠ IMMUTABLE AFTER BIRTH — EditConsentPurposeInput deliberately omits it. |
| `templateKey` | [String](/types/#scalars) | PROVENANCE: the canned template this purpose was copied from (copyCannedConsentPurpose); PORT-stamped, never caller-suppliable; absent on from-scratch purposes. A copy NEVER auto-revs when the registry does (fork semantics). |
| `templateVersion` | [Int](/types/#scalars) | The canned-registry version the copy was compiled from (the templateKey twin; fork semantics). |
| `everReferenced` | [Boolean](/types/#scalars) | The WRITE-ONCE first-decision stamp: set TRUE inside the FIRST decide transaction against this purpose, never touched again. Present ⇒ doom refuses CONFLICT/REFERENCED; absent ⇒ virgin, dooms freely. Never caller-suppliable. |

## Used by

- [consentPurpose](/reference/consent-purpose/consentPurpose/)
- [copyCannedConsentPurpose](/reference/privacy-and-compliance/copyCannedConsentPurpose/)
- [createConsentPurpose](/reference/consent-purpose/createConsentPurpose/)
- [deactivateConsentPurpose](/reference/consent-purpose/deactivateConsentPurpose/)
- [doomConsentPurpose](/reference/consent-purpose/doomConsentPurpose/)
- [reactivateConsentPurpose](/reference/consent-purpose/reactivateConsentPurpose/)
- [updateConsentPurpose](/reference/consent-purpose/updateConsentPurpose/)
