Skip to content

Attachment

type Attachment =
| {
id: string;
mime_type: string;
name: string;
type: 'file';
}
| {
id: string;
mime_type: string;
name: string;
preview_url: string;
type: 'image';
};

Attachment associated with a user message. When passed to sendUserMessage or setComposerValue, it must already be uploaded by your server. We do not currently support attaching raw Files to a message.

{
id: string;
mime_type: string;
name: string;
type: 'file';
}
id: string;

Server-generated identifier for the uploaded file.

mime_type: string;

MIME type of the file.

name: string;

Original filename shown in the UI.

type: 'file';
{
id: string;
mime_type: string;
name: string;
preview_url: string;
type: 'image';
}
id: string;

Server-generated identifier for the uploaded image.

mime_type: string;

MIME type of the image.

name: string;

Original filename shown in the UI.

preview_url: string;

URL used to render the image preview in the UI.

type: 'image';