Upload API
The app uploads and downloads documents through the same API that your own systems call. This page describes those endpoints: uploading a document with its document type and fields, filing it in an Akte, adding a version and downloading a version. The API reference has the full request and response schemas.
Before you start
Section titled “Before you start”- Signing in. Your own systems send an API key with each request; see Authentication. The examples leave it out.
- Address. Every path starts with
/api/v1/t/<tenant>/, where<tenant>is the address of your workspace. An address that doesn’t exist, or a workspace the caller isn’t a member of, answers404. - Permissions. Uploading, filing, tagging and adding versions need the permission to edit documents
(Create files and tags, file and tag documents in the role) and the access level Write where the
document lands: on its document type, or for the whole workspace. Reading and downloading need the level
Read. A document the caller can’t read answers
404, as if it didn’t exist. Confidential documents are only visible to the people on their confidential list. - Language. Send
Accept-Language: deoren. Error titles and messages come back in that language.
Authentication
Section titled “Authentication”Send an API key of the workspace in the Authorization header:
curl "https://<acriva-host>/api/v1/t/<tenant>/document-types" \ -H "Authorization: Bearer acv_live_…"Owners and admins, and every role allowed to manage API keys, create the key under Settings › Security & access › API keys (API keys). The key acts as a member of the role chosen for it: the role’s permissions and access levels above apply, and the key’s permissions limit them further. A key never sees a confidential document. A request with a key needs no antiforgery token.
| Endpoints on this page | Permission of the key |
|---|---|
| Upload a document, add a version | documents:write |
| File in an Akte or take out of it, add or remove a tag | documents:write |
| Get a document, its versions, document types and tags; download a version | documents:read |
Uploads count against the key’s limit of 60 a minute, every request against its 600 a minute.
401: the key is expired (api-key-expired) or revoked (api-key-revoked), or the token isn’t shaped like a key.403with the codeapi-key-scope: the key lacks the permission for the endpoint, or the endpoint takes no key.404: the key is unknown or belongs to another workspace, the workspace is suspended, or the public API isn’t part of the plan.429: too many requests; wait for the seconds inRetry-After.
Upload a document
Section titled “Upload a document”-
Look up the document type and its fields with
GET /api/v1/t/<tenant>/document-types. Each type has anid, akey(such asincoming-invoice) andfields, each with itskey, itstypeand whether it isrequired. -
Send the file as
multipart/form-datatoPOST /api/v1/t/<tenant>/documents, with the form fields first and the file last:Terminal window curl -X POST "https://<acriva-host>/api/v1/t/<tenant>/documents" \-H "Accept-Language: en" \-F "title=Invoice RE-2026-0042" \-F "documentTypeId=<document-type-id>" \--form-string 'metadata={"invoiceNumber":"RE-2026-0042","invoiceDate":"2026-09-01","totalGross":{"amount":119.00,"currency":"EUR"}}' \-F "sha256=<sha256-of-the-file>" \-F "file=@invoice.pdf;type=application/pdf" -
Acriva answers
201 Createdwith the new document underdocument(itsid,title,metadata,currentVersionand more) and a listduplicates. Keep the document’sidfor the next calls.
The form has these parts. Only file is required. The reference for this endpoint
lists its responses; the form parts are described only here, because Acriva streams the file instead of
reading a request body schema.
| Part | Content |
|---|---|
title |
The document’s title, at most 500 characters. Without it, the title is the file name without its extension. |
documentTypeId |
The id of an active document type. Without it, the document has no type. |
metadata |
A JSON object with the values of the type’s fields, keyed by the field’s key. |
sha256 |
The SHA-256 of the file as 64 lowercase hex characters. Acriva checks the content against it. |
file |
The file itself. It must be the last part; anything after it is ignored. |
Acriva checks the fields, the document type and the caller’s access before it stores the file, so a rejected upload leaves nothing behind.
Set fields on upload
Section titled “Set fields on upload”metadata holds one value per field, keyed by the field’s key. Keys the type doesn’t have are rejected,
and required fields must be set. A document without a type takes no fields, so its metadata must be empty
({}) or left out.
| Field type | Value |
|---|---|
Text |
A string of at most 2000 characters. |
Number |
A JSON number: 42 or 3.5. |
Date |
A string YYYY-MM-DD: "2026-09-01". |
Money |
An object with the amount and an ISO 4217 currency code: {"amount": 119.00, "currency": "EUR"}. |
Enumeration |
The key of one of the field’s options. |
Reference |
The id of an Akte of the workspace. |
Use --form-string in curl for metadata: -F would treat a value starting with @ or < as a file.
Check the content
Section titled “Check the content”Send sha256 to make sure the file arrived unchanged. If the content that arrives has a different
checksum, the upload fails with 400 for the field sha256 and nothing is stored. Upload the file again.
Every version in the response carries its sha256 and size, whether or not you sent a checksum.
Duplicates
Section titled “Duplicates”If a document you can read already has a version with the same content, the upload still goes through.
duplicates then lists up to 10 of those documents, each with its documentId, title and versionNumber.
Documents the caller can’t read are never listed.
File and tag the document
Section titled “File and tag the document”An Akte bundles the documents of a customer, vendor, employee or project. In the API, Akten are files.
-
Find the Akte with
GET /api/v1/t/<tenant>/files?q=<number-or-name>.qmatches a part of the file number or the name. -
File the document in it:
Terminal window curl -X PUT "https://<acriva-host>/api/v1/t/<tenant>/documents/<document-id>/files/<file-id>" -
To tag it, find the tag’s
idwithGET /api/v1/t/<tenant>/tagsand assign it:Terminal window curl -X PUT "https://<acriva-host>/api/v1/t/<tenant>/documents/<document-id>/tags/<tag-id>"
Both answer 204 No Content, and repeating them changes nothing. DELETE on the same paths takes the
document out of the Akte or removes the tag. A closed Akte takes no documents (409, code file-closed).
Add a version
Section titled “Add a version”A new version of a document keeps the old ones: stored versions are never changed or overwritten.
curl -X POST "https://<acriva-host>/api/v1/t/<tenant>/documents/<document-id>/versions" \ -F "sha256=<sha256-of-the-file>" \ -F "file=@invoice-corrected.pdf;type=application/pdf"The form takes sha256 (optional) and file, with the same rules as an upload
(reference). Acriva answers 201 Created with the new version under version and a list duplicates.
A document someone else has checked out takes no versions (409, code document-locked), and neither does
an archived one (409, code document-archived). If you have checked the document out yourself, send the
new version to POST …/documents/<document-id>/check-in instead; it adds the version and releases the
check-out. GET …/documents/<document-id>/versions lists all versions, newest first.
Download a version
Section titled “Download a version”The reference for this endpoint lists its responses.
curl -o invoice.pdf \ "https://<acriva-host>/api/v1/t/<tenant>/documents/<document-id>/versions/<number>/content?download=true"<number>is the version number; the current one is in the document’scurrentVersion.number(GET …/documents/<document-id>).download=trueasks for the file as an attachment. Without it, PDFs, images and text files come inline. The response carries the stored content type and the original file name inContent-Disposition.- The
ETagis the version’s SHA-256 in quotes, so you can check the downloaded content against it. - Large files can be loaded in parts: send a single byte range such as
Range: bytes=0-1048575, and Acriva answers206 Partial ContentwithContent-Range. WithIf-Range: <etag>, a range is only served if the content still matches. A range that starts past the end answers416.
Downloads are recorded in the document’s history, once per download rather than once per range.
Limits
Section titled “Limits”- File size: at most 200 MB per file by default. Larger files are rejected with
413, codefile-too-large; thetitlenames the limit that applies. - File types: PDF, images (PNG, JPEG, TIFF, GIF, WebP), text and CSV, XML, emails (
.eml,.msg) and office documents (Word, Excel, PowerPoint and OpenDocument). Acriva takes the type from thefilepart’sContent-Type; when it is missing orapplication/octet-stream, from the file extension. Other types are rejected with415, codecontent-type-not-allowed. - Requests: the API limits the number of requests per workspace and caller. Above the limit, it answers
429with aRetry-Afterheader in seconds.
Errors
Section titled “Errors”Errors come back as problem details (RFC 9457, application/problem+json). The title is in the language
of the request; the code, where there is one, stays the same in every language, so check that instead of
the text.
| Status | code |
Meaning |
|---|---|---|
400 |
The request is invalid. errors names each field with its message: title, documentTypeId, sha256, file, metadata for the whole object, or metadata.<key> for one field. |
|
401 |
Not signed in. | |
403 |
The caller lacks the permission for the endpoint; detail names it. |
|
403 |
document-access-denied |
The caller can read the document, but not change it, or has no Write on the document type the upload is for. |
404 |
The workspace, the document, the version, the Akte or the tag doesn’t exist, or the caller can’t read it. | |
409 |
document-locked |
Someone else has checked the document out. |
409 |
document-not-checked-out |
A check-in without the caller’s own check-out. |
409 |
document-archived |
The document is archived. |
409 |
version-conflict |
Another version was added at the same moment. Read the document and try again. |
409 |
file-closed |
The Akte is closed. |
409 |
usage-limit-reached |
The workspace has used up its storage. |
413 |
file-too-large |
The file is larger than the limit. |
415 |
content-type-not-allowed |
Acriva doesn’t take this file type. |
416 |
The byte range starts past the end of the file. | |
429 |
Too many requests; wait for Retry-After seconds. |