---
title: "Create chat logs"
method: POST
path: "/agents/chats/exports"
tags: ["Chats Export"]
---

# Create chat logs

`POST /agents/chats/exports`

Create a chat log export for `agent_id` containing all of the Agent's chats.

Use the `export_id` in the GET chat logs endpoint to get the result of the create chat logs request (zipped JSON files).

(The chat log export will be deleted from the database after 7 days from the export creation date)

## Request body

- ExportDto
  - `agent_id` string, required — The id of the agent that the export will run for
  - `from` string — The start of the time range for the export. If not provided, the export will start from the beginning of the agent's data
  - `to` string — The end of the time range for the export. If not provided, the export will run until the current time
  - `persistent_chats` boolean — Determines if the export should fetch persistent chats. Defaults to true.
  - `token` string — Pagination - used to continue the creation of the chat log using this same endpoint

## Response `200`

OK

- object
  - `export_id` string, required

## Other responses

- `400` — RangeError
- `401` — AuthorizationError
- `500` — InternalServerError

---

[API](https://skmtc.net/d-id/apis/realtime-endpoints.md) · [All operations](https://skmtc.net/d-id/apis/realtime-endpoints/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/d-id/realtime-endpoints/versions/2f2425e1b6b6/schema)
