> This is a page from the ElevenLabs documentation. For an index of the documentation, fetch https://elevenlabs.io/docs/llms.txt.

# Export user memory

POST https://api.elevenlabs.io/v1/convai/agents/{agent_id}/user-memory/export
Content-Type: application/json

Get a copy of everything this agent remembers about an end user, to answer their request to access or take their data; each agent remembers its users separately. Conversations are not included; use the Get Conversation Details endpoint for those. Someone who reached you under identities that were never linked is a separate user for each.

Reference: https://elevenlabs.io/docs/api-reference/agents/user-memory/export

## Servers

- `https://api.elevenlabs.io` (Production, default)
- `https://api.us.elevenlabs.io` (Production US)
- `https://api.eu.residency.elevenlabs.io` (Production EU)
- `https://api.in.residency.elevenlabs.io` (Production India)
- `https://api.sg.residency.elevenlabs.io` (Production Singapore)

## Request

### Path parameters

- `agent_id` (string, required) — The id of an agent.

### Body (application/json)

This endpoint expects an ExportUserMemoryRequestModel.

- `user_id` (string, required) — ID of the end user whose memory the agent is to export. Find it from the `user_id` your conversation initiation data sent with Find Agents User By Identity.

## Response

### 200

성공 응답

- `agent_id` (string, required) — ID of the agent whose memory was exported.
- `user_id` (string, required) — ID of the end user the export is about.
- `exported_at_unix_secs` (integer, required) — When the export was taken.
- `entities` (list of RenderedUserMemoryEntity, required) — Everything the agent remembers about the user, by who or what it is about, the user first. Includes what is no longer believed.

## Errors

### 422 Unprocessable Entity Error

유효성 검사 오류

- `detail` (list of ValidationError, optional)

## Types

### RenderedUserMemoryEntity

- `id` (string, required) — ID of the entity, to delete it with everything known about it.
- `name` (string, required) — e.g. `Piotr N`. The user themselves is `user`.
- `type` (string, required) — e.g. `person`, `company`, `dog`.
- `is_user` (boolean, required) — Whether this is the user themselves.
- `relations` (list of RenderedUserMemoryFact, required) — How the user relates to it, e.g. `colleague`.
- `facts` (list of RenderedUserMemoryFact, required) — What holds about it until something replaces it.
- `events` (list of RenderedUserMemoryFact, required) — Things that happened once.

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### RenderedUserMemoryFact

- `id` (string, required) — ID of the fact, to delete it on its own.
- `attribute` (string, required) — What the fact is about, e.g. `diet`.
- `text` (string, required) — The fact itself, e.g. `Is vegetarian.`
- `learned_at_unix_secs` (integer, required) — When agents learned it.
- `reference_count` (integer, required) — How many times the user has said it.
- `last_seen_conversation_id` (string, required) — The latest conversation in which the user said it.
- `valid_from` (string, optional, nullable) — When it became true, or for an event when it happened.
- `valid_to` (string, optional, nullable) — When it stopped being true.
- `invalidated_at_unix_secs` (integer, optional, nullable) — When agents stopped believing it. Unset while still believed.

### ValidationErrorLocItems

- string
- integer

## Examples

**Request**

```json
{
  "user_id": "ausr_01k6m3w9xq4f2c8t7n5b0r1d2e"
}
```

**Response**

```json
{
  "agent_id": "agent_01k6m3w9xq4f2c8t7n5b0r1d2e",
  "user_id": "ausr_01k6m3w9xq4f2c8t7n5b0r1d2e",
  "exported_at_unix_secs": 1790000000,
  "entities": [
    {
      "id": "umen_01k6m3w9xq4f2c8t7n5b0r1d2e",
      "name": "user",
      "type": "person",
      "is_user": true,
      "relations": [],
      "facts": [
        {
          "id": "umfa_01k6m3w9xq4f2c8t7n5b0r1d2e",
          "attribute": "diet",
          "text": "Is vegetarian.",
          "learned_at_unix_secs": 1789000000,
          "reference_count": 2,
          "last_seen_conversation_id": "conv_01k6m3w9xq4f2c8t7n5b0r1d2e",
          "valid_from": "2026-03-01"
        }
      ],
      "events": []
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.elevenlabs.io/v1/convai/agents/agent_3701k3ttaq12ewp8b7qv5rfyszkz/user-memory/export"

payload = { "user_id": "ausr_01k6m3w9xq4f2c8t7n5b0r1d2e" }
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/convai/agents/agent_3701k3ttaq12ewp8b7qv5rfyszkz/user-memory/export';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"user_id":"ausr_01k6m3w9xq4f2c8t7n5b0r1d2e"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.elevenlabs.io/v1/convai/agents/agent_3701k3ttaq12ewp8b7qv5rfyszkz/user-memory/export"

	payload := strings.NewReader("{\n  \"user_id\": \"ausr_01k6m3w9xq4f2c8t7n5b0r1d2e\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.elevenlabs.io/v1/convai/agents/agent_3701k3ttaq12ewp8b7qv5rfyszkz/user-memory/export")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"user_id\": \"ausr_01k6m3w9xq4f2c8t7n5b0r1d2e\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.elevenlabs.io/v1/convai/agents/agent_3701k3ttaq12ewp8b7qv5rfyszkz/user-memory/export")
  .header("Content-Type", "application/json")
  .body("{\n  \"user_id\": \"ausr_01k6m3w9xq4f2c8t7n5b0r1d2e\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.elevenlabs.io/v1/convai/agents/agent_3701k3ttaq12ewp8b7qv5rfyszkz/user-memory/export', [
  'body' => '{
  "user_id": "ausr_01k6m3w9xq4f2c8t7n5b0r1d2e"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/convai/agents/agent_3701k3ttaq12ewp8b7qv5rfyszkz/user-memory/export");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"user_id\": \"ausr_01k6m3w9xq4f2c8t7n5b0r1d2e\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = ["user_id": "ausr_01k6m3w9xq4f2c8t7n5b0r1d2e"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.elevenlabs.io/v1/convai/agents/agent_3701k3ttaq12ewp8b7qv5rfyszkz/user-memory/export")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```