Skip to main content

Files & References

Endpoints for managing files and references attached to assistants.

Files

GET /api/assistants/{id}/files

List files attached to an assistant.

Response: Array of file objects

POST /api/assistants/{id}/files

Attach a file to an assistant (from upload ID).

Permission: assistant:write

Request Body:

FieldTypeRequired
uploadIdstringYes
namestringNo

Response: 201 Created

POST /api/assistants/{id}/files/_upload

Upload a file directly to an assistant.

Permission: assistant:write

Content-Type: multipart/form-data

Response: 201 Created

GET /api/assistants/{id}/files/{file}

Get file metadata.

Response: File object

PUT /api/assistants/{id}/files/{file}

Update file metadata.

Permission: assistant:write

Response: Updated file object

DELETE /api/assistants/{id}/files/{file}

Delete a file from the assistant.

Permission: assistant:write

Response: 204 No Content

GET /api/assistants/{id}/files/{file}/contents

Download file contents.

Response: File contents with appropriate Content-Type

PUT /api/assistants/{id}/files/{file}/contents

Replace file contents.

Permission: assistant:write

Content-Type: multipart/form-data

Response: Updated file object

GET /api/assistants/{id}/files/{file}/embeddings/{embeddingId}/image

Retrieve an embedded image from a file.

Response: Image file


References

References are pointers to other documents or resources.

GET /api/assistants/{id}/references

List references attached to an assistant.

Response: Array of reference objects

POST /api/assistants/{id}/references

Add a reference to an assistant.

Permission: assistant:write

Request Body:

FieldTypeRequired
targetIdstringYes
targetTypestringYes
descriptionstringNo

Response: 201 Created

GET /api/assistants/{id}/references/{targetId}

Get a specific reference.

Response: Reference object

DELETE /api/assistants/{id}/references/{targetId}

Remove a reference from the assistant.

Permission: assistant:write

Response: 204 No Content