AlmondTill/G3N API

On this page

consentPurpose

query · in the family Consent purpose

What it does

Look up one record — a consent purpose — one named thing customers can allow or refuse (marketing email, data use).

A ConsentPurpose by id, within the caller's OWN org-group family; requires authentication. A cross-tenant id reads as null (not-found) AND trips the rootId tripwire server-side.

What happens

Reads only — changes nothing.

Who may call it

Capability area: Reading your records — Looking up and listing the records of your organization.

Arguments

NameTypeRequiredNotes
idID ID!yesThe id of the record.

Returns

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

Example request

query ExampleConsentPurpose($id: ID!) {
  consentPurpose(id: $id) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    code
    consentModel
    templateKey
    templateVersion
    everReferenced
  }
}

Variables:

{
  "id": "01900000-0000-7000-8000-37386ae00000"
}

Example response

{
  "data": {
    "consentPurpose": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "PP-EXMP-0000-000F",
      "type": "ConsentPurpose",
      "caption": "Blue jeans",
      "status": "active",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "code": "BJ-001",
      "consentModel": "<consent model>",
      "templateKey": "<template key>",
      "templateVersion": 1,
      "everReferenced": true
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer