> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs-beta.getzep.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs-beta.getzep.com/_mcp/server.

# Add batch items

POST https://api.getzep.com/api/v4/batches/{batch_uuid}/items
Content-Type: application/json

Reference: https://docs-beta.getzep.com/sdk-reference/batch/add-items

## Authentication

- `Authorization` header (required) (prefixed with ` Api-Key  `) — Type "Api-Key" followed by a space and the project API key.

## Request

### Path parameters

- `batch_uuid` (string, required) — Batch UUID

### Body (application/json)

This endpoint expects a v4.AddBatchItemsRequest.

- `items` (list of v4.BatchItemInput, required) — The batch items to append, each identified by its type field.

## Response

### 200

OK

- `items` (list of v4.BatchItem, optional) — The batch items that were added, in the order they were appended.

## Errors

### 400 Bad Request Error

Bad Request

- `error` (v4.ErrorBody, optional)

### 401 Unauthorized Error

Unauthorized

- `error` (v4.ErrorBody, optional)

### 404 Not Found Error

Not Found

- `error` (v4.ErrorBody, optional)

### 409 Conflict Error

Conflict

- `error` (v4.ErrorBody, optional)

## Types

### v4.BatchItemInput

- `type` (enum, required) — The kind of item: graph_episode or thread_message.
  - Allowed values: `graph_episode`, `thread_message`
- `content` (string, optional) — The message content, for a thread_message item.
- `created_at` (string, optional) — The item's reference time, used for temporal reasoning rather than ingestion time. Applies to both graph_episode and thread_message items.
- `data` (string, optional) — The episode content, for a graph_episode item.
- `data_type` (enum, optional) — The data format of the episode: text, json, or message.
  - Allowed values: `text`, `json`, `message`, `fact_triple`
- `document_id` (string, optional) — Groups this item as a chunk of a document on the graph.
- `graph_uuid` (string, optional) — The graph to ingest this item into. Mutually exclusive with user_uuid.
- `metadata` (map from string to any, optional) — Metadata to store on the item. Max 10 keys. Values must be strings, numbers, booleans, or arrays of scalars.
- `name` (string, optional) — A customizable name for the sender of the message.
- `role` (enum, optional) — The role of the message's sender, for a thread_message item.
  - Allowed values: `system`, `assistant`, `user`, `function`, `tool`
- `source_description` (string, optional) — A description of the source of this episode.
- `thread_uuid` (string, optional) — The thread this message is added to, for a thread_message item.
- `user_uuid` (string, optional) — The user whose graph this item is ingested into. Mutually exclusive with graph_uuid.

### v4.BatchItem

- `content_policy` (v4.EpisodeContentPolicy, optional) — The content policy state of the item's episode, present only on a graph with a bound content policy rule and only once the item is processed.
- `created_at` (string, optional) — The time the item was appended to the batch.
- `episode_uuid` (string, optional) — The identifier of the episode created for this item, equal to source_uuid.
- `graph_uuid` (string, optional) — The graph the item's episode is or will be ingested into.
- `sequence_index` (integer, optional) — The item's position within the batch, in the order it was appended.
- `source_uuid` (string, optional) — The unique identifier of the item's stored source row.
- `status` (enum, optional) — The processing status of the item: pending, queued, processing, succeeded, failed, skipped, or canceled.
  - Allowed values: `pending`, `queued`, `processing`, `succeeded`, `failed`, `skipped`, `canceled`
- `thread_uuid` (string, optional) — The thread the item's message is or will be added to. Present only for thread_message items.
- `type` (enum, optional) — The kind of item: graph_episode or thread_message.
  - Allowed values: `graph_episode`, `thread_message`
- `uuid` (string, optional) — The unique identifier of the batch item.

### v4.ErrorBody

- `code` (string, optional)
- `details` (map from string to any, optional)
- `message` (string, optional)
- `param` (string, optional)
- `request_id` (string, optional)

### v4.EpisodeContentPolicy

- `category_keys` (list of string, optional) — The keys of the categories with a matched rule.
- `dropped_count` (integer, optional) — The number of derived candidates that were dropped.
- `retained_count` (integer, optional) — The number of derived candidates that were published to the graph.
- `revision` (integer, optional) — The project revision number of the policy the graph bound.
- `status` (enum, optional) — The evaluation status. pending means the evaluation has not finished, complete means every candidate was evaluated and the graph batch was written, and failed means ingestion retries were exhausted.
  - Allowed values: `pending`, `complete`, `failed`
- `violated` (boolean, optional) — Whether at least one derived candidate matched a rule. Once true, it stays true.

## Examples

**Request**

```json
{
  "items": [
    {
      "type": "graph_episode"
    }
  ]
}
```

**Response**

```json
{
  "items": [
    {
      "content_policy": {
        "category_keys": [
          "health"
        ],
        "dropped_count": 0,
        "retained_count": 7,
        "revision": 3,
        "status": "complete",
        "violated": false
      },
      "created_at": "string",
      "episode_uuid": "string",
      "graph_uuid": "string",
      "sequence_index": 1,
      "source_uuid": "string",
      "status": "pending",
      "thread_uuid": "string",
      "type": "graph_episode",
      "uuid": "string"
    }
  ]
}
```