Skip to main content

Upload documents to a collection

POST 

https://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

Upload accepted; one entry per uploaded file (or chunk acknowledgement in chunked mode)