Orbiq logoTrust Center Documentation
API v1 ReferenceDocumentsIdFile

Upload document file

Upload a file to associate with a document. Supports two upload methods: 1. Multipart form-data with file field 2. Binary stream with X-Original-Filename…

PUT
/api/v1/documents/{id}/file

Upload a file to associate with a document. Supports two upload methods:

  1. Multipart form-data with file field
  2. Binary stream with X-Original-Filename header

File validation includes size limits (10MB), MIME type checking, and automatic type detection from file signatures.

A language without a file of its own serves the default language's file (on a versioned document, the file of its promoted version). Uploading with locale gives that language its own file, and a DELETE with the same locale leaves that language without a file instead of falling back. A replaced or removed file is only deleted once no language or version of the document still uses it.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Document ID to upload file for

Formatuuid

Query Parameters

version?string

Draft document version that receives the uploaded file

Formatuuid
locale?string

Locale whose document file should be uploaded or removed. Base locale codes are resolved to Directus language codes such as ja-JP, ko-KR, and zh-CN.

Value in

  • "en"
  • "de"
  • "fr"
  • "ja"
  • "ko"
  • "zh"

Header Parameters

X-Original-Filename?string

Original filename (required for binary uploads)

Request Body

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://app.orbiqhq.com/api/v1/documents/$DOCUMENT_ID/file" \  -H "Authorization: Bearer $ACCESS_TOKEN" \  -H "X-Original-Filename: privacy-policy.pdf" \  --data-binary "@/path/to/privacy-policy.pdf"
{  "success": true,  "data": {    "fileId": "file-789",    "url": "https://directus.example.com/assets/file-789"  }}

How is this guide?