# Consent ledger

Agencies see a creator's photos only after she consented, and only once she confirmed she is 18 or over. We keep every such step as an entry in an append-only ledger: entries are only ever added. The database allows two exceptions and nothing else: when her data is deleted at her request, the IP address and browser are erased from her entries (the rest stays), and entries disappear only together with her lead record — which we anonymise rather than delete, so in practice they stay. Her current state (`GET /v1/creator/consent`, the `confirmations` of a lead) is computed from it, and her photos are released only by it.

## What an entry holds

| Field | Meaning |
|---|---|
| `kind` | `consent_granted`, `consent_revoked`, `age_confirmed`, `creator_terms_accepted` |
| `text_kind`, `text_version` | Which text she was shown (`consent`, `age_confirmation`, `creator_terms`), and which version of it |
| `sha256` of the text | Stored with the entry, so the exact wording can be proven later |
| `channel` | Where she acted (below); for an app we also keep the app's name at that moment, even if the app is deleted later |
| IP address, browser, time | Where the request came from and when |

The IP address and browser are evidence for Creator Guard. They are shown only to the creator herself in her portal and to our team — **never to partner or agency apps**: ledger entries returned through the API (`GET /v1/creator/consent`) carry kind, text version, channel and time only, and her data export (which goes to the app that asked for it) leaves them out too.

## Channels — equal evidence

| `channel` | Where she acted |
|---|---|
| `hosted_link` | The consent page behind a consent link (`/creator-consent/<token>`) |
| `hosted_portal` | Her creator portal on `app.creator-guard.com` |
| `oauth_app:<app id>` (e.g. `oauth_app:app_…`) | Your dashboard, through `POST /v1/creator/consent/grant`, `…/revoke`, `/v1/creator/age-confirmation` or the creator-terms accept — never the app of the account that referred her, except for a withdrawal (see below) |
| `admin` | Our team, on her documented request |
| `legacy` | Decided before the ledger existed; how she answered was not recorded |

**The referrer's app records no decision.** Consent, the 18+ confirmation and the creator terms are never recorded through an OAuth app owned by the account that submitted her lead — apps belong to the account, so this covers every member's app of it. Such a call answers [`403 referrer_app_not_allowed`](https://docs.creator-guard.com/errors/#referrer_app_not_allowed) and nothing is written; she decides in Creator Guard's own screens instead (the consent link or her creator portal). Her withdrawal is the exception: it is accepted through any connected app, the referrer's included. Reading her consent state is not affected.

Every channel records the same fields. For an `oauth_app:` channel the IP address and browser are those of **your server's request**, not hers — so your dashboard must show her the exact text from `GET /v1/creator/consent-text`, unchanged, and send its `text_version` only after she actively agreed. Keep your own record of that moment too. Texts change only as a new version (version 2 of the consent and 18+ texts went live with the 2026-10 release, in English; other languages fall back to the English text): a grant, 18+ confirmation or terms acceptance naming an older version answers `409 consent_text_outdated` with `current_version`, so fetch the text again and show it to her.

## Consent includes 18+

The consent text includes her confirmation that she is 18 or over. So every channel records a grant the same way: a `consent_granted` entry and, unless her 18+ is already confirmed, an `age_confirmed` entry on the same consent text and version. While our team has declined her 18+ check or is still reviewing a document, a grant is refused with `409 invalid_state` (`error.current_state` `age_declined` or `age_pending`) and records nothing; she should contact our support.

## Versioned texts

Each text (`consent`, `age_confirmation`, `creator_terms`) has numbered versions per language; a published version never changes. A new wording is a new version. Granting consent, confirming 18+ or accepting the creator terms with an older `text_version` gets `409 consent_text_outdated` (`error.current_version` names the current one) and records nothing — show her the new text and ask again.

## Withdrawal

She can withdraw consent at any time — on the consent page (even after the link has expired: an expired link can no longer grant, but it still withdraws), in the creator portal or through your app (`consent_revoked`). A withdrawal is **never refused because of the text version**: it records the version it was sent if that version exists, otherwise the current one. Her photos stop being shown to agencies at once. The earlier entries stay: the ledger records history, it does not rewrite it. When her data is deleted at her request, her ledger entries keep their kind, version and time, but lose the IP address and browser. Two internal references stay on each entry as pseudonymous identifiers: the id of the login that recorded it (the login itself is deleted, so it no longer points to anyone) and the id of the app connection it came through (the connection is deleted with her login). They keep the record consistent and cannot be traced back to her without data we no longer hold.
