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.Documentation Index
Fetch the complete documentation index at: https://docs.langdock.com/llms.txt
Use this file to discover all available pages before exploring further.
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.
| 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
attachmentIds 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 projects, 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.