---
title: "Ingest Fragment Batch"
method: POST
path: "/active-memory/ingest-batch"
tags: ["active-memory"]
---

# Ingest Fragment Batch

`POST /active-memory/ingest-batch`

## Request

- Base URL: `https://api.getmetacognition.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.getmetacognition.com/active-memory/ingest-batch`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/metacognition/apis/tex-api/docs/active-memory/ingest-batch/post.ts> (a function with typed inputs; its response is checked against the schema)

Batch-ingest: embed all texts in one API call, push to worker concurrently.

## Request body

- BatchIngestRequest
  - `fragments` BatchFragment[], required
    - `text` string, required
    - `agent_id` string, required
    - `episode_id` string, required
    - `user_hash` string, nullable
    - `timestamp_ms` integer, nullable
    - `fragment_id` string, nullable
    - `skip_enrichment` boolean
    - `entities` string[], nullable
    - `metadata` object, nullable
    - `scope` string, nullable
    - `inactivity_timeout_seconds` integer, nullable
  - `inactivity_timeout_seconds` integer, nullable

## Response `200`

Successful Response

- BatchIngestResponse
  - `ingested` integer, required
  - `total` integer, required
  - `failed` integer
  - `partial` boolean
  - `errors` BatchItemError[]
    - `index` integer, required
    - `fragment_id` string, required
    - `episode_id` string, required
    - `status_code` integer, nullable
    - `error` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/metacognition/apis/tex-api.md) - [All operations](https://skmtc.dev/metacognition/apis/tex-api/llms.txt) - [OpenAPI document](https://skmtc.dev/metacognition/apis/tex-api/revisions/3bef47e50f2e?raw)
