API · v1 · stable
CODEMETA OSDeveloper Center
EN
Open console
Entity · marketing_consents

Marketing Consent Schema

Schema ID
marketing_consent
Collection
marketing_consents
Permissions
  • Readmarketing_consent_view
  • Createmarketing_consent_create
  • Editmarketing_consent_edit
  • Deletemarketing_consent_delete

Fields

Marketing Consent Schema

marketing_consents4 permissions

Per-(person × org × category × channel) marketing consent with double-opt-in lifecycle (ADR 0290).

personPartyIduuidrequired

ID of the PERSON party the consent belongs to.

organizationPartyIduuidoptional

ID of the ORGANIZATION party the person relates to (the consent is scoped to the work context). Null for a person without an org relationship.

nullable
contactRelationshipIduuidoptional

ID of the party_relationship whose marketingConsent cache is recomputed from this record.

nullable
categorystringrequired
NEWSLETTERPRODUCT_UPDATESSALES_OUTREACHEVENTSSURVEYS
channelstringrequired
EMAIL
Default: "EMAIL"
statusstringrequired
PENDINGGRANTEDREVOKEDEXPIRED
Default: "PENDING"
legalBasisstringoptional
CONSENTLEGITIMATE_INTERESTEXISTING_CUSTOMER
Default: "CONSENT"nullable
sourcestringoptional
WEB_FORMSALES_MANUALPHONECONTRACTIMPORTSYSTEM
nullable
initiatedByUserIduuidoptional

User who initiated the sign-up (e.g. the salesperson).

nullable
emailstringoptional

Email the consent was captured for (denormalized for the DOI mail + audit).

max 320 charactersnullable
consentTextstringoptional

Exact wording the person agreed to (accountability).

max 4000 charactersnullable
consentTextVersionstringoptional
max 64 charactersnullable
doiTokenstringoptional

Opaque single-use confirmation token; cleared on confirm/expiry.

max 128 charactersread-onlynullable
doiSentAtdatetimeoptional
read-onlynullable
doiExpiresAtdatetimeoptional
read-onlynullable
confirmedAtdatetimeoptional
read-onlynullable
proofIpstringoptional

Client IP recorded at the PENDING → GRANTED transition.

max 64 charactersread-onlynullable
proofUserAgentstringoptional
max 512 charactersread-onlynullable
revokedAtdatetimeoptional
read-onlynullable
revokedReasonstringoptional
max 500 charactersnullable
notesstringoptional
max 1000 charactersnullable

Standard endpoints

This resource follows the platform's generic CRUD contract. Read the conventions for pagination, idempotency, optimistic locking and audit. The most important endpoints:

  • GET /api/v1/marketing_consents — List, paginated + filterable
  • GET /api/v1/marketing_consents/<id> — Single entity
  • POST /api/v1/marketing_consents — Create
  • PATCH /api/v1/marketing_consents/<id> — Partial update
  • DELETE /api/v1/marketing_consents/<id> — Soft delete
  • GET /api/v1/marketing_consents/<id>/timeline — Audit + activities

Search