Skip to main content
GET
Read a file attached to an AI Assistant message

Authorizations

X-API-Key
string
header
required

Path Parameters

attachment_id
string<uuid>
required

Response

Successful Response

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
failure_message
string | null
required

The sentence that says why a failed PDF was refused; null unless failed.

failure_reason
enum<string> | null
required

Why a failed PDF was refused: unreadable (damaged or password protected), too_many_pages, no_text (a scan), or too_complex; null unless failed.

Available options:
unreadable,
too_many_pages,
no_text,
too_complex
filename
string
required
id
string<uuid>
required
kind
enum<string>
required

What the file is: spreadsheet for a CSV or an Excel sheet, pdf for a PDF.

Available options:
spreadsheet,
pdf
page_count
integer | null
required

A PDF's pages; null for a spreadsheet, and for a PDF whose pages are still being read.

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 | null
required

The workbook sheet the rows were read from; null for a CSV or a PDF.

size_bytes
integer
required
status
enum<string>
required

Whether the file can be sent. A spreadsheet is ready at once. A PDF's pages are read after its upload answers: it is reading, then ready, or failed when it cannot be read. Read the file again until it leaves reading; a message naming a file that is not ready is refused.

Available options:
reading,
ready,
failed