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

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

- `sessionId` (string)
- `issueId` (string)
- `documentId` (string)
- `text` (string)
- `entityType` (string)
- `entityId` (string)
- `sourceAgentSlug` (string)

Request body example:

```json
{
  "sessionId": "string",
  "issueId": "string",
  "documentId": "string",
  "text": "string",
  "entityType": "string",
  "entityId": "string",
  "sourceAgentSlug": "string"
}
```

**Responses**

- `200` — Facts extracted and persisted

Response example, 200:

```json
{
  "ids": [
    "string"
  ],
  "facts": [
    {
      "id": "string",
      "entityType": "string",
      "entityId": "string",
      "kind": "string",
      "fact": "string"
    }
  ]
}
```
