Assistant APIs
Upload Attachment API
Upload files to be used with Assistants
POST
/
attachment
/
v1
/
upload
Upload files that can be referenced in Assistant conversations using their attachment IDs.
To use the API you need an API key. You can create API Keys in your Workspace settings.
Request Format
This endpoint accepts multipart/form-data
requests with a single file upload.
Parameter | Type | Required | Description |
---|---|---|---|
file | File | Yes | The file you want to upload |
Response Format
The API returns the uploaded file information:
Example
Error Handling
The uploaded attachment ID can be used in the Assistant API by including it in the attachmentIds
array either at the assistant level or message level.
Body
multipart/form-data
file
file
requiredThe file to upload
Response
200 - application/json
attachmentId
string
requiredUnique identifier for the uploaded attachment
file
object
requiredWas this page helpful?