---
title: "Add a file to send with an AI Assistant message"
method: POST
path: "/chat-attachments/"
tags: ["assistant"]
---

# Add a file to send with an AI Assistant message

`POST /chat-attachments/`

## Request

- Base URL: `https://api.getoneprofile.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.getoneprofile.ai/chat-attachments/`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Upload a CSV, Excel or PDF file to send with your next message to the AI Assistant. The file is read once here: a spreadsheet's column names and row count, or a PDF's page count, come back for the card in the composer, and the assistant reads the file when the message is sent. Name the file's `id` in the message's `attachment_ids`; a file never sent can be removed again.

Files up to 10 MB, and PDFs up to 500 pages with text to read (a scan has none). The format is decided by the file's own bytes, not its name.

## Response `201`

Successful Response

- ChatAttachmentReadSchema: One file attached to a chat message, as the card above the message draws it. The bytes are never returned; the shape is. ``columns`` and ``row_count`` are what a card and a model's first look need, and a page of rows is a separate read.
  - `column_count` integer, required
  - `columns` string[], required: The header row's names, in order; empty for a PDF.
  - `created_at` string, date-time, required
  - `filename` string, required
  - `id` string, uuid, required
  - `kind` 'spreadsheet' | 'pdf', required: What kind of thing a file the person attached is, for the card that shows it. Each kind is read by its own reader and drawn under its own icon: a CSV or an Excel file is a spreadsheet, rows under a header; a PDF is pages of text, and the rows of the table its pages hold when one is asked for.
  - `page_count` integer, nullable, required: A PDF's pages; null for a spreadsheet.
  - `row_count` integer, required: Data rows under the header row; 0 for a PDF, whose table is read into rows only when its rows are first read.
  - `sent` boolean, required: Whether the file has been sent with a message. A file added and never sent can be removed; one already sent stays with its message.
  - `sheet` string, nullable, required: The workbook sheet the rows were read from; null for a CSV or a PDF.
  - `size_bytes` integer, required

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `422`: Invalid request made to the API.
- `500`: Internal server error.
- `502`: Bad gateway error.
- `503`: Service unavailable.

---

[API](https://skmtc.dev/getoneprofile/apis/api-reference-oneprofile.md) · [All operations](https://skmtc.dev/getoneprofile/apis/api-reference-oneprofile/llms.txt) · [OpenAPI document](https://skmtc.dev/getoneprofile/apis/api-reference-oneprofile/revisions/4a6bd71e3f02?raw)
