---
title: "Download History as CSV."
method: GET
path: "/api/chat_history_export"
tags: ["Admin"]
---

# Download History as CSV.

`GET /api/chat_history_export`

## Request

- Base URL: `https://app.getdot.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://app.getdot.ai/api/chat_history_export`
- Auth: one of:
  - API key in header `X-API-KEY`
  - API key in cookie `Authorization`
  - OAuth 2 (password, token URL `/api/auth/token`)

Every chat the History page shows under these filters, on all pages, as one CSV file.

The same filters, sorting and access rules as the History page: a modeler sees the chats
their groups and chat access allow, private Slack and Teams channels stay masked. Dates are
the viewer's calendar days in `tz`, both ends included, matched on a chat's last activity.
For each question with its answer, use `/api/export_history?include_answers=true`.

Columns, in order:

- `chat_id`: the chat's ID
- `type`: `chat`, `analysis`, `app` (the chat built or edited an app, a scheduled run's
  included), `scheduled_run` (a run a schedule created: History's "Created by Schedule"),
  `root` (a Root session), or the ticket a Root session became: `proposal`, `data_gap` or
  `review`
- `title`: the title History shows
- `first_question`: the first message as History shows it: without attachment tags, and
  without the earlier thread messages Dot reads with a question asked in a Slack thread;
  empty for a scheduled run
- `user_id`, `user_name`: who owns the chat (a private channel shows as `Private Channel with ID: …`)
- `asked_by`: who asked in a shared Slack or Teams channel, as `Name <email>`
- `channel`: where the chat ran: `web` (the Dot web app), `slack`, `teams`, `email`, `cli`,
  `mcp`, …
- `created_at`, `updated_at`: UTC, ISO 8601
- `messages`: questions asked plus edits; empty for a scheduled run
- `credits`, `credits_per_message`, `views`
- `user_rating`: `liked` or `disliked`; `user_feedback`: what the user wrote with it
- `auto_review`: Dot's own review of the conversation: `issue`, `success`, `unanswered` or
  `finished`, with its reason in `auto_review_reason`
- `assumptions`: how many answers rested on an assumption
- `labels`: separated by `; `
- `has_schedule`, `created_by_schedule`, `shared`, `archived`: `true` or `false`
- `environment`: the environment the chat ran in, empty for Production
- `ticket_status`, `summary`: for a Root ticket, where it stands and what it says.
  `ticket_status` is `drafting`, `pending_review` (a proposal waiting for review), `reported`
  (a data gap or review waiting for review), `completed` (merged), `rejected`, `resolved`,
  `dismissed`, `no_changes`, `duplicate` or `error`
- `link`: the chat's address

## Query parameters

- `sort_by` string: Sort column
- `sort_order` string: Sort direction
- `filter_type` string: Type filter: all, agentic (Analysis), app (App building: chats that built or edited an app), context_agent (Root), proposals, scheduled (has a schedule), is_scheduled (created by a schedule), shared, training or archived
- `search` string, nullable: Search term
- `labels` string, nullable: Comma-separated label names
- `users` string, nullable: Comma-separated user display names
- `start_date` string, nullable: First day (YYYY-MM-DD) of last activity, included, in `tz`
- `end_date` string, nullable: Last day (YYYY-MM-DD) of last activity, included, in `tz`
- `tz` string, nullable: Viewer's IANA timezone for the date range (default UTC)
- `review` string, nullable: Comma-separated review outcomes; a chat matching any of them is kept

## Response `200`

CSV text, one row per chat, header first.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/getdot/apis/dot-api-2.md) · [All operations](https://skmtc.dev/getdot/apis/dot-api-2/llms.txt) · [OpenAPI document](https://skmtc.dev/getdot/apis/dot-api-2/revisions/d26fe7163a7f?raw)
