Upload document file
Upload a file to associate with a document. Supports two upload methods:
- Multipart form-data with file field
- Binary stream with X-Original-Filename header
File validation includes size limits (10MB), MIME type checking, and automatic type detection from file signatures.
AuthorizationBearer <token>
In: header
Path Parameters
idstring
Document ID to upload file for
Format
uuid
Header Parameters
X-Original-Filename?string
Original filename (required for binary uploads)
filefile
File to upload. Supports various document and image formats (e.g., PDF, DOCX, PNG, JPG).
Format
binary
Response Body
const body = new FormData();
body.set(file, "string")
fetch("https://app.orbiqhq.com/api/v1/documents/550e8400-e29b-41d4-a716-446655440000/file", {
headers: {
"X-Original-Filename": "privacy-policy.pdf"
},
body
})
{
"success": true,
"data": {
"fileId": "file-789",
"url": "https://directus.example.com/assets/file-789"
}
}
{
"error": "document_too_large",
"details": "File size exceeds 10MB limit"
}
Empty
Empty
{
"error": "unsupported_media_type"
}
{
"error": "file_upload_failed_generic"
}
How is this guide?