> 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 Data in batch mode

POST https://api.getzep.com/api/v2/graph-batch
Content-Type: application/json

Deprecated. Use the [Batch API](/adding-batch-data) (`client.batch.*`) instead.

Adds data to the graph in batch mode, processing episodes concurrently.


Reference: https://docs-beta.getzep.com/sdk-reference/graph/add-data-in-batch-mode

## Request

### Body (application/json)

This endpoint expects an apidata.AddDataBatchRequest.

- `episodes` (list of apidata.EpisodeData, required)
- `document_id` (string, optional) — Optional document ID applied to every episode in this batch request.
- `graph_id` (string, optional) — graph_id is the ID of the graph to which the data will be added. If adding to the user graph, please use user_id field instead.
- `strict_ontology` (boolean, optional) — When true, prevents extraction of generic Entity nodes that do not match the configured ontology.
- `user_id` (string, optional) — User ID is the ID of the user to which the data will be added. If not adding to a user graph, please use graph_id field instead.

## Response

### 202

Added episodes

- `list of apidata.GraphEpisode`

## Errors

### 400 Bad Request Error

Bad Request

- `message` (string, optional)

### 500 Internal Server Error

Internal Server Error

- `message` (string, optional)

## Types

### apidata.EpisodeData

- `data` (string, required)
- `type` (enum, required)
  - Allowed values: `text`, `json`, `message`, `fact_triple`
- `created_at` (string, optional)
- `metadata` (map from string to any, optional) — Optional metadata key-value pairs. Max 10 keys. Values must be strings, numbers, booleans, or arrays of scalars.
- `source_description` (string, optional)

### apidata.GraphEpisode

- `content` (string, required)
- `created_at` (string, required)
- `uuid` (string, required)
- `document_id` (string, optional) — Optional document ID, will be present if the episode is part of a document
- `metadata` (map from string to any, optional)
- `processed` (boolean, optional)
- `relevance` (double, optional) — Relevance is an experimental rank-aligned score in [0,1] derived from Score via logit transformation. Only populated when using cross_encoder reranker; omitted for other reranker types (e.g., RRF).
- `role` (string, optional) — Optional role, will only be present if the episode was created using memory.add API
- `role_type` (enum, optional) — Optional role_type, will only be present if the episode was created using memory.add API
  - Allowed values: `norole`, `system`, `assistant`, `user`, `function`, `tool`
- `score` (double, optional) — Score is the reranker output: sigmoid-distributed logits [0,1] when using cross_encoder reranker, or RRF ordinal rank when using rrf reranker
- `selection_rank` (integer, optional) — SelectionRank is the global cross-scope rank assigned by auto scope selection.
- `source` (enum, optional)
  - Allowed values: `text`, `json`, `message`, `fact_triple`
- `source_description` (string, optional)
- `task_id` (string, optional) — Optional task ID to poll episode processing status. Currently only available for batch ingestion.
- `thread_id` (string, optional) — Optional thread ID, will be present if the episode is part of a thread

## Examples

**Request**

```json
{
  "episodes": [
    {
      "data": "string",
      "type": "text"
    }
  ]
}
```

**Response**

```json
[
  {
    "content": "string",
    "created_at": "string",
    "uuid": "string",
    "document_id": "string",
    "metadata": {},
    "processed": true,
    "relevance": 1.1,
    "role": "string",
    "role_type": "norole",
    "score": 1.1,
    "selection_rank": 1,
    "source": "text",
    "source_description": "string",
    "task_id": "string",
    "thread_id": "string"
  }
]
```