Upload documents to a collection
POSThttps://platform.docana.com/api/v1/collections/:collectionId/documents/
Multipart upload of one or more files into a collection. Plain multipart posts of the files field work for any file that fits in one request; folderId files every file into one manual folder, and folderIds (comma-separated, one entry per file in order, empty for the root) files each into its own, so one request can mirror a directory tree. One request carries at most the single-request ceiling of the infrastructure in front of the platform (maxRequestSizeInMBytes in the createDocumentUploadUrl response, 100MB on the hosted platform); a bigger body answers 413 with code: "upload/request-too-large" and useChunkedUpload: true. Files up to the plan limit go through the resumable chunked protocol: POST each 5MB chunk as files with the X-Chunk-Index, X-Total-Chunks, X-Chunk-Size, X-Total-File-Size, X-File-Name, X-File-Type and X-Resume-Token headers (see src/shared/chunked-upload.ts); the last chunk answers with the created document. A multipart body the server cannot parse answers 400 with code: "upload/malformed-multipart"; an exhausted plan budget or quota answers 402 with code: "budget-exceeded" or code: "quota-exceeded-<quota>". Requires write permission on the collection.
Request
Responses
- 200
- 400
- 401
- 402
- 403
- 404
- 413
- 500
Upload accepted; one entry per uploaded file (or chunk acknowledgement in chunked mode)
Malformed multipart body (code: "upload/malformed-multipart"), or a folder that is not a manual folder of the collection
The API key or session is missing, expired, or malformed.
Plan budget or quota exhausted (code: "budget-exceeded" or "quota-exceeded-<quota>")
No write permission on the collection
A resource referenced by the path does not exist or is not visible to the caller.
File over the plan limit (code: "upload/file-too-large"), or request body over the single-request ceiling (code: "upload/request-too-large", useChunkedUpload: true)
Unexpected server error.