AlmondTill/G3N API

ConsentPurpose

object type

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).

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 human-readable id, shaped like PP-… — stable for the record’s life.
typeString String!The kind of record — always ConsentPurpose here.
captionString String!The record’s display name — what people see it called.
statusString String!The record’s current state — one of active, inactive or doomed.
parentIdID ID!The parent org group; for a ConsentPurpose parentId === rootId.
rootIdID ID!The id of your organization group — every record of yours carries the same one.
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 id of the record’s current edit — send it back with a change so an edit made in the meantime is refused instead of overwritten.
refCaptionsRefCaption [RefCaption!]!The captions of the records this one refers to, composed for you — 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