---
title: "Record a consent decision (append-only)"
method: POST
path: "/consent"
tags: ["Consent"]
---

# Record a consent decision (append-only)

`POST /consent`

## Request

- Base URL: `https://api.mnemom.ai/v1`
- URL: `https://api.mnemom.ai/v1/consent`
- Auth: none required

Public, unauthenticated. Appends ONE immutable GDPR consent audit record per decision (GDPR Art. 7(1)). The consent banner POSTs each choice here; this is IN ADDITION to client-side enforcement, never a replacement. PII-minimised: stores a pseudonymous `subject_id` and a TRUNCATED IP (last IPv4 octet / last 80 IPv6 bits zeroed) only — no email, name, raw IP, or user id. `region` is read server-side from the `mnemom_geo` cookie; GPC/DNT presence is detected from `Sec-GPC`/`DNT` headers (OR'd with the body `gpc` flag). Malformed input is rejected with 400. Rate-limited per IP.

## Request body

- object
  - `subject_id` string, required: Pseudonymous client/session id (the same opaque id the consent-store keeps locally). NOT raw PII.
  - `action` 'accept_all' | 'reject_all' | 'save_preferences' | 'withdraw', required
  - `categories` object: Consented toggles. `essential` is always-on and recorded as true regardless.
    - `analytics` boolean
    - `marketing` boolean
  - `consent_string` string, nullable
  - `schema_version` union: Consent schema version. Accepts a number (the client currently sends `record.version` as a number) or a string; the handler normalizes numbers to their string form before persisting (MNE-6453).
    - string
    - number
  - `gpc` boolean: Client-observed GPC/DNT signal (OR'd with the request's Sec-GPC / DNT headers).
  - `decided_at` string, date-time: ISO-8601 timestamp of the client decision.

## Response `201`

Consent decision recorded.

- object
  - `recorded` boolean, required
  - `id` string, uuid, nullable
  - `created_at` string, date-time, nullable

## Other responses

- `400`: Bad request
- `403`: Cross-origin write refused (`cross_origin_rejected`). A state-changing request that carries the browser session cookie must come from a first-party origin (`Origin`, or failing that `Referer`) and must not send a form-style body (text/plain, urlencoded, multipart) the operation does not declare. Bearer and API-key callers are never subject to this check.
- `429`: Rate-limit exceeded. The global per-IP limiter (100 requests/minute, applied to every `/v1/*` route) rejected this request. Back off until the window resets — `Retry-After` carries the cooldown in seconds and `X-RateLimit-Reset` the absolute reset time.
- `500`: Server error — request was well-formed but the server failed to fulfill it. Typically a downstream dependency (DB / RPC / external API) returned an unexpected error.
- `502`: Server error — request was well-formed but the server failed to fulfill it. Typically a downstream dependency (DB / RPC / external API) returned an unexpected error.

---

[API](https://skmtc.dev/mnemom/apis/mnemom-api.md) · [All operations](https://skmtc.dev/mnemom/apis/mnemom-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mnemom/apis/mnemom-api/revisions/274b7a6ea182?raw)
