---
title: "POST /api/v1/{context_id}/facts/batch"
method: POST
path: "/api/v1/{context_id}/facts/batch"
---

# POST /api/v1/{context_id}/facts/batch

`POST /api/v1/{context_id}/facts/batch`

Bulk conversation ingest. Persists each message as a turn and routes extraction through `reconcile_extraction`.

## Path parameters

- `context_id` string, required

## Request body

- FactsBatchRequest — Request body for `POST /api/v1/{ctx}/facts/batch`.
  - `extract` 'per_message' | 'whole_conversation' — Bulk extraction strategy for `/facts/batch`.
  - `infer` 'full' | 'triples' | 'preview' | 'none' — Inference mode for the `/facts` write API. Decides which extraction path runs and which provenance kind the reconciler tags the writes with (see the per-variant docs below).
  - `labels` Label[] — Descriptive labels for the persisted rows (accepted + recorded; row application deferred).
  - `messages` BatchMessage[], required
    - `content` string, required
    - `role` 'user' | 'assistant' | 'system' | 'tool', required — Role of a conversation turn participant.
    - `ts` string, date-time, nullable
  - `scopes` array[] — A DNF scope selector: an OR of conjunctive clauses. Each clause is an array of scope paths, ALL of which a reader must cover (AND); the outer array is the OR. E.g. [["team/a"],["team/b","clearance/secret"]] means team/a OR (team/b AND clearance/secret). Empty means unscoped (the caller's default region). A bare string is also accepted as a singleton clause.
    - string[]
  - `session_id` string, nullable

## Response `200`

- FactsBatchResponseJson
  - `extractions` ExtractionResultJson[], required
    - `attributes` AttributeSummaryJson[], required
      - `entityId` string, required
      - `id` string, required
      - `key` string, required
      - `memoryCategory` 'identity' | 'knowledge' | 'context', required — Memory category classification applied during extraction.
      - `value` string, required
    - `corrections` CorrectionSummaryJson[], required
      - `entityId` string, required
      - `key` string, required
      - `newValue` string, required
      - `oldValue` string, required
    - `entities` EntitySummaryJson[], required
      - `entityType` string, required
      - `id` string, required
      - `isNew` boolean, required
      - `memoryCategory` 'identity' | 'knowledge' | 'context', required — Memory category classification applied during extraction.
      - `name` string, required
    - `instructions` InstructionSummaryJson[], required
      - `description` string, required
      - `id` string, required
      - `label` string, required
    - `relations` RelationSummaryJson[], required
      - `label` string, required
      - `memoryCategory` 'identity' | 'knowledge' | 'context', required — Memory category classification applied during extraction.
      - `object` string, required
      - `subject` string, required
    - `turnId` string, required
    - `uncertainties` UncertaintySummaryJson[], required
      - `about` string, required
      - `reason` string, required
  - `sessionId` string, required
  - `turnIds` string[], required

## Other responses

- `400` — Invalid request
- `401` — Unauthorized
- `409` — Idempotency-Key reused with a different body
- `422` — Invalid context id

---

[API](https://skmtc.net/surrealdb/apis/spectron.md) · [All operations](https://skmtc.net/surrealdb/apis/spectron/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/surrealdb/spectron/revisions/52b41ab517b6/schema)
