Mnemom Consent API

GDPR Art. 7(1) append-only consent audit log (MNE-477). Public write (banner POSTs each decision); admin-only read/export. Stores a pseudonymous subject id + truncated IP only — in addition to client-side enforcement.

GitHub OpenAPI

Operations 3

POST /consent Record a consent decision (append-only) #
GET /consent/export Export the consent log for a time window (admin) #
GET /consent/history Read a subject's consent history (admin) #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/mnemom-ai:mnemom-ai-consent-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

mnemom-ai-consent-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Mnemom Consent API
  description: Trust infrastructure for AI agents. Transparent alignment verification, behavioral drift detection, and accountability primitives.
  version: 1.0.0
  contact:
    name: Mnemom
    url: https://mnemom.ai
    email: support@mnemom.ai
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: https://api.mnemom.ai/v1
  description: Production
security:
- BearerAuth: []
- ApiKeyAuth: []
tags:
- name: Consent
  description: GDPR Art. 7(1) append-only consent audit log (MNE-477). Public write (banner POSTs each decision); admin-only read/export. Stores a pseudonymous subject id + truncated IP only — in addition to client-side enforcement.
paths:
  /consent:
    post:
      operationId: recordConsentDecision
      summary: Record a consent decision (append-only)
      description: '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.'
      tags:
      - Consent
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - subject_id
              - action
              properties:
                subject_id:
                  type: string
                  maxLength: 128
                  description: Pseudonymous client/session id (the same opaque id the consent-store keeps locally). NOT raw PII.
                action:
                  type: string
                  enum:
                  - accept_all
                  - reject_all
                  - save_preferences
                  - withdraw
                categories:
                  type: object
                  description: Consented toggles. `essential` is always-on and recorded as true regardless.
                  properties:
                    analytics:
                      type: boolean
                    marketing:
                      type: boolean
                consent_string:
                  type: string
                  maxLength: 512
                  nullable: true
                schema_version:
                  oneOf:
                  - type: string
                    maxLength: 64
                  - type: number
                  - type: 'null'
                  description: 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).
                gpc:
                  type: boolean
                  description: Client-observed GPC/DNT signal (OR'd with the request's Sec-GPC / DNT headers).
                decided_at:
                  type: string
                  format: date-time
                  description: ISO-8601 timestamp of the client decision.
      responses:
        '201':
          description: Consent decision recorded.
          content:
            application/json:
              schema:
                type: object
                required:
                - recorded
                properties:
                  recorded:
                    type: boolean
                  id:
                    type: string
                    format: uuid
                    nullable: true
                  created_at:
                    type: string
                    format: date-time
                    nullable: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/CrossOriginRejected'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/InternalServerError'
  /consent/export:
    get:
      operationId: exportConsentLog
      summary: Export the consent log for a time window (admin)
      description: Admin-only. Returns all consent audit records in a REQUIRED `[from, to]` time window (oldest first) for producing records to a supervisory authority. No full-table export is permitted (both bounds required). Requires platform admin role.
      tags:
      - Consent
      security:
      - BearerAuth: []
      - CookieAuth: []
      parameters:
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date-time
        description: Inclusive lower bound (ISO-8601). Required.
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date-time
        description: Inclusive upper bound (ISO-8601). Required.
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          default: 5000
          maximum: 50000
      responses:
        '200':
          description: Consent records in the requested window.
          content:
            application/json:
              schema:
                type: object
                required:
                - from
                - to
                - count
                - records
                properties:
                  from:
                    type: string
                    format: date-time
                  to:
                    type: string
                    format: date-time
                  count:
                    type: integer
                  records:
                    type: array
                    items:
                      type: object
                      required:
                      - id
                      - created_at
                      - subject_id
                      - action
                      properties:
                        id:
                          type: string
                          format: uuid
                        created_at:
                          type: string
                          format: date-time
                        decided_at:
                          type: string
                          format: date-time
                          nullable: true
                        subject_id:
                          type: string
                          description: Pseudonymous client-generated id. NOT raw PII.
                        action:
                          type: string
                          enum:
                          - accept_all
                          - reject_all
                          - save_preferences
                          - withdraw
                        essential:
                          type: boolean
                        analytics:
                          type: boolean
                        marketing:
                          type: boolean
                        consent_string:
                          type: string
                          nullable: true
                        schema_version:
                          type: string
                          nullable: true
                        region:
                          type: string
                          nullable: true
                        gpc_dnt_present:
                          type: boolean
                        ip_truncated:
                          type: string
                          nullable: true
                          description: Proportionate network id only (last IPv4 octet / last 80 IPv6 bits zeroed).
                        user_agent:
                          type: string
                          nullable: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/InternalServerError'
  /consent/history:
    get:
      operationId: getConsentHistory
      summary: Read a subject's consent history (admin)
      description: Admin-only. Returns the consent decisions for a given pseudonymous `subject_id`, newest first, optionally bounded to a `[from, to]` time window. Used to demonstrate consent for a specific subject. Requires platform admin role.
      tags:
      - Consent
      security:
      - BearerAuth: []
      - CookieAuth: []
      parameters:
      - name: subject_id
        in: query
        required: true
        schema:
          type: string
        description: The pseudonymous subject id to look up.
      - name: from
        in: query
        required: false
        schema:
          type: string
          format: date-time
        description: Inclusive lower bound (ISO-8601). Unbounded if omitted.
      - name: to
        in: query
        required: false
        schema:
          type: string
          format: date-time
        description: Inclusive upper bound (ISO-8601). Unbounded if omitted.
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          default: 500
          maximum: 5000
      responses:
        '200':
          description: The subject's consent decisions.
          content:
            application/json:
              schema:
                type: object
                required:
                - subject_id
                - count
                - records
                properties:
                  subject_id:
                    type: string
                  count:
                    type: integer
                  records:
                    type: array
                    items:
                      type: object
                      required:
                      - id
                      - created_at
                      - subject_id
                      - action
                      properties:
                        id:
                          type: string
                          format: uuid
                        created_at:
                          type: string
                          format: date-time
                        decided_at:
                          type: string
                          format: date-time
                          nullable: true
                        subject_id:
                          type: string
                          description: Pseudonymous client-generated id. NOT raw PII.
                        action:
                          type: string
                          enum:
                          - accept_all
                          - reject_all
                          - save_preferences
                          - withdraw
                        essential:
                          type: boolean
                        analytics:
                          type: boolean
                        marketing:
                          type: boolean
                        consent_string:
                          type: string
                          nullable: true
                        schema_version:
                          type: string
                          nullable: true
                        region:
                          type: string
                          nullable: true
                        gpc_dnt_present:
                          type: boolean
                        ip_truncated:
                          type: string
                          nullable: true
                          description: Proportionate network id only (last IPv4 octet / last 80 IPv6 bits zeroed).
                        user_agent:
                          type: string
                          nullable: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/InternalServerError'
components:
  responses:
    Unauthorized:
      description: Authentication required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: 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.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: 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.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
            minimum: 1
        X-RateLimit-Limit:
          description: Requests permitted per window.
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Requests remaining in the current window (0 on a 429).
          schema:
            type: integer
            minimum: 0
        X-RateLimit-Reset:
          description: Unix epoch seconds at which the current window resets.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    CrossOriginRejected:
      description: 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.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      description: Canonical error envelope (ADR-API-001 conv 1). `error` is always an object — never a bare string. Every 4xx/5xx response across the API conforms to this shape; the runtime helper is `src/http-errors.ts::buildErrorBody`.
      required:
      - error
      properties:
        error:
          type: object
          required:
          - code
          - message
          properties:
            code:
              type: string
              pattern: ^[a-z][a-z0-9_]*$
              description: 'Stable, machine-matchable failure identifier (lowercase snake_case). Clients may branch on this; the string is part of the contract.


                **Status-class defaults** — emitted when no caller code is supplied (`errorCodeForStatus(status)`): `bad_request` (400), `unauthorized` (401), `forbidden` (403), `not_found` (404), `method_not_allowed` (405), `conflict` (409), `gone` (410), `precondition_failed` (412), `payload_too_large` (413), `unsupported_media_type` (415), `unprocessable_entity` (422), `precondition_required` (428), `rate_limited` (429), `internal_error` (500), `not_implemented` (501), `bad_gateway` (502), `service_unavailable` (503), `gateway_timeout` (504). Fallback `error` for unmapped statuses.


                **Caller-supplied codes** — handlers may pass an explicit `code` for a specific failure class. Examples: `agent_not_found`, `invalid_hash_proof`, `already_linked`, `idempotency_conflict`, `feature_gated`, `schema_validation_failed`, `no_token`, `bad_canonical_payload`.


                **Care-framed sub-resource codes** — the cards-as-primitive surface passes its stable care code-string straight through as `error.code`. Examples: `if_match_absent`, `if_match_stale`, `if_match_malformed`, `primitive_validation_failed`.'
            message:
              type: string
              description: Human-readable, care-framed explanation of the failure.
            details:
              description: 'Optional structured context for the failure (any JSON value: object, array, or primitive). Common shapes: validation findings list, idempotency-conflict diff, `{presented_etag, current_etag}` on a stale `If-Match`, etc. Mirrors the helper''s `details?: unknown`.'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Supabase JWT token in Authorization: Bearer header'
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Mnemom-Api-Key
      description: Mnemom API key (mnm_... format)
    ServiceRole:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Supabase service role bearer JWT. Used by /blog admin operations that talk directly to Supabase. NOT used by /internal/* or /v1/arena/internal/* — those use the custom-header schemes below.
    InternalKeyAuth:
      type: apiKey
      in: header
      name: X-Internal-Key
      description: Internal service-to-service shared secret, timing-safe compared against INTERNAL_API_KEY. Used by /internal/* gateway routes (compose, agents, webhooks emit).
    ServiceKeyAuth:
      type: apiKey
      in: header
      name: X-Service-Key
      description: Service-to-service shared secret, timing-safe compared against MNEMOM_SERVICE_KEY. Used by /v1/arena/internal/*, /v1/on-chain/*, and the /v1/internal/* readers consumed by the reputation cron.
    CoherenceTokenAuth:
      type: http
      scheme: bearer
      description: Per-cell coherence bearer token. Provisioned in 1Password vault `mnemom-coherence` (one item per receiver). Value compared against COHERENCE_<NAME>_SERVICE_TOKEN_EXPECTED. Used by /v1/internal/coherence/* and /v1/internal/governance/dispatch.
    ArenaCandidateTokenAuth:
      type: http
      scheme: bearer
      description: Dedicated arena writer token (ADR-004 §"Arena dedicated writer token"). Compared against ARENA_RECIPE_CANDIDATE_TOKEN. The token's only capability is writing recipe candidates with writer_identity='arena-bypass' (stamped server-side). Used by POST /v1/internal/recipe-candidates.
    CustomerVoiceTokenAuth:
      type: http
      scheme: bearer
      description: Customer Voice API bearer token. Timing-safe compared against CUSTOMER_VOICE_API_TOKEN. Grants access to all /v1/internal/feedback/* endpoints (MNE-1876). No customer-facing or reporter-read capability.
    CookieAuth:
      type: apiKey
      in: cookie
      name: mnemom_session
      description: 'HttpOnly, Secure, SameSite=Lax cookie issued by /v1/auth/sign-in (or the SSO / email-callback flows). The value is an AES-256-GCM-encrypted blob of {access_token, refresh_token, issued_at, auth_method}. Browser clients include this automatically with `credentials: "include"`.'
    LicenseJwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: License JWT (HS256, HMAC-signed with LICENSE_SIGNING_SECRET). Used by self-hosted deployment instances to authenticate `/v1/deployments/heartbeat`. Not interchangeable with the Supabase user JWT.
    AgentAuth:
      type: apiKey
      in: header
      name: X-Mnemom-Agent-Proof
      description: 'Agent possession proof: the full SHA-256 hex digest of `${apiKey}|${agentName}` (or `${apiKey}` for an unnamed singleton agent) — the same `hash_proof` primitive used by POST /v1/agents claim, link-agent, and verify-binding. The server resolves the agent by `agent_hash = proof[:16]`. The agent''s *own* identity (ADR-API-001 third auth class) — distinct from ApiKeyAuth (`X-Mnemom-Api-Key`, which resolves a user/account, not an agent).'