---
search:
  tags:
    - memory
    - POST
seo:
  description: >-
    Create memory batch. Reference for the POST
    /workspaces/{organizationId}/memory/batch endpoint in the Pile API.
sidebar:
  label: Create memory batch
  badge: POST
title: Create memory batch
type: openapi-operation
---
`POST /workspaces/{organizationId}/memory/batch`

**Request body** (`application/json`)

- `memories` (object[])
- `documentIds` (string[])
- `sourceAgentSlug` (string)

Request body example:

```json
{
  "memories": [
    {
      "entityType": "string",
      "entityId": "string",
      "kind": "string",
      "fact": "string",
      "validUntil": "string",
      "sourceAgentSlug": "string",
      "sourceSessionId": "string"
    }
  ],
  "documentIds": [
    "string"
  ],
  "sourceAgentSlug": "string"
}
```

**Responses**

- `200` — Memories written

Response example, 200:

```json
{
  "ids": [
    "string"
  ],
  "count": 0,
  "extractedFromDocuments": 0
}
```
