Upload an attachment
Assistants API (Deprecating)
Upload Attachment API
Upload files to be used with Assistants
POST
Upload an attachment
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 acceptsmultipart/form-data requests with a single file upload.
Response Format
The API returns the uploaded file information:Example
Error Handling
Upload errors
A file content validation error returns:
Use the attachment
The uploaded attachment ID can be used in the Assistant API by including it in theattachmentIds array either at the assistant level or message level.
Migrating to Agents API
The upload attachment endpoint remains the same across both APIs. For new systems, reference the Agents API documentation:Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on API Key Best Practices.
Authorizations
API key as Bearer token. Format "Bearer YOUR_API_KEY"
Body
multipart/form-data
The file to upload