---
title: "Keep a file the user attaches in the editor's AI chat"
method: POST
path: "/dashboards/{dashboard_id}/chat/attachments"
tags: ["Dashboard v3"]
---

# Keep a file the user attaches in the editor's AI chat

`POST /dashboards/{dashboard_id}/chat/attachments`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/dashboards/{dashboard_id}/chat/attachments`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-KEY` and API key in header `X-API-SECRET` and API key in header `X-WORKSPACE-ID`

One picture (PNG, JPEG, WebP, GIF; scaled to 1500px), PDF or Word file (20 MB, first 50 pages read) or text. Kept with this board's chat, once per content, never on the board itself; the returned `ref` is what a chat turn's `attachments` names. A spreadsheet is refused (code `data`: it belongs in Use my data), as is a .pbix/.twb (code `workbook`: the import).

## Path parameters

- `dashboard_id` integer, required

## Response `201`

The attachment, kept with the chat

- ChatAttachmentResponse
  - `ref` string, required
  - `name` string, required
  - `kind` 'image' | 'document' | 'text', required
  - `media_type` string, required
  - `byte_size` integer, required
  - `pages` integer
  - `pages_read` integer
  - `words` integer
  - `truncated` boolean

## Other responses

- `400`: Bad request syntax or unsupported method
- `403`: Request forbidden -- authorization will not help

---

[API](https://skmtc.dev/mammoth/apis/mammoth-analytics.md) · [All operations](https://skmtc.dev/mammoth/apis/mammoth-analytics/llms.txt) · [OpenAPI document](https://skmtc.dev/mammoth/apis/mammoth-analytics/revisions/fe078afe239b?raw)
