---
title: "Run single integrity analysis"
method: POST
path: "/analyze"
tags: ["Analyze"]
---

# Run single integrity analysis

`POST /analyze`

## Request

- Base URL: `https://api.mnemom.ai/v1`
- URL: `https://api.mnemom.ai/v1/analyze`
- Auth: API key in header `X-Mnemom-Api-Key`

Analyzes one thinking block for `agent_id`. The API key's owning user must be an owner, admin or member of the org that governs the agent; otherwise the request is rejected with 404 before any analysis or state change.

## Request body

- object
  - `thinking_block` string, required
  - `thinking_metadata` object, required
    - `provider` string, required
    - `model` string, required
  - `agent_id` string, required
  - `session_id` string, required
  - `card` object, required
    - `card_id` string, required
    - `values` object[], required
  - `conscience_values` ConscienceValue[]
    - `type` 'BOUNDARY' | 'FEAR' | 'COMMITMENT' | 'BELIEF' | 'HOPE', required
    - `name` string, required
    - `content` string, required
  - `window_context` object[]
  - `task_context` string
  - `store_checkpoint` boolean

## Response `200`

Analysis result

- object
  - `checkpoint` Checkpoint
    - `checkpoint_id` string
    - `request_id` string, nullable: The gateway's per-proxied-request id (ADR-065 mnemom_request_id), when the gateway wrote this checkpoint with a request-scoped logger. Null on rows written before migration 548 or by a caller with no request context.
    - `agent_id` string
    - `card_id` string
    - `session_id` string
    - `timestamp` string, date-time
    - `thinking_block_hash` string
    - `provider` string
    - `model` string
    - `verdict` 'clear' | 'review_needed' | 'boundary_violation' | 'unverified' | 'unanalyzed': `unverified`: analysis was supposed to run but did not complete. `unanalyzed`: the agent's integrity_mode is off (AIP off), so the turn was recorded but never analysed (migration 518). Neither is a clean integrity pass.
    - `concerns` object[]
      - `category` string
      - `severity` string
      - `description` string
      - `evidence` string
    - `reasoning_summary` string
    - `conscience_context` object
    - `window_position` object
      - `index` integer
      - `window_size` integer
    - `analysis_metadata` object
    - `linked_trace_id` string, nullable
    - `re_evaluated_at` string, date-time, nullable
    - `original_verdict` string, nullable
  - `proceed` boolean
  - `recommended_action` string
  - `window_summary` object
  - `metering` object
    - `event_id` string
    - `account_id` string
    - `billed` boolean

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `402`: Paid feature gate — the caller's plan doesn't include this operation's feature flag. Emitted by `requireFeature` / `requireEntitlement` in `src/org/rbac.ts`.
- `403`: Forbidden
- `404`: Resource not found
- `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.
- `503`: An upstream dependency is currently unavailable. The request was not processed; retry after the cooldown window.

---

[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)
