AlmondTill/G3N API

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

FieldTypeNotes
idID ID!The record’s id — a UUID the platform assigned when the record was created; every reference to this record uses it.
sysIdString String!The group-scoped human-facing system id (PP-…).
typeString String!The kind of record — always ConsentPurpose here.
captionString String!The record’s display name — what people see it called.
statusString String!The FSM state: active | inactive | doomed.
parentIdID ID!The parent org group; for a ConsentPurpose parentId === rootId.
rootIdID ID!The org-group family root.
createdAtString String!When the record was created, as a UTC timestamp.
updatedAtString String!When the record last changed, as a UTC timestamp.
revisionNumInt Int!How many times this record has been edited; the first save is 0.
revisionID ID!The OCC revision token — supply it on every mutation of this record; rotates on every write.
refCaptionsRefCaption [RefCaption!]!The server-composed captions of this record's declared references (the referenced-caption rule) — one row per referenced id; see RefCaption.
codeString 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).
consentModelString String!opt_in | opt_out — the two consent regimes on ONE mechanism. ⚠ IMMUTABLE AFTER BIRTH — EditConsentPurposeInput deliberately omits it.
templateKeyStringPROVENANCE: 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).
templateVersionIntThe canned-registry version the copy was compiled from (the templateKey twin; fork semantics).
everReferencedBooleanThe 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