Documents

File a new document

Adds a document to the archive and starts processing it (conversion, then type recognition and field extraction, then indexing). Omit type_id and the type is recognised from the document itself — that is the normal way to file something you were not told the type of. Returns immediately with a document id and status: "pending" — processing takes seconds to minutes, so poll documents_get to see it become ready, and read type then rather than now. Accepts the file as base64, up to 8 MB decoded; for anything larger POST the raw bytes to /api/v1/documents instead, which takes up to 256 MB and needs the same scope. The file type is decided by the BYTES, not by the name you give it.

post/api/v1/rest/documents

Request

  • Base URL: https://api.custodo.ai
  • URL: https://api.custodo.ai/api/v1/rest/documents
  • Auth: HTTP bearer

Headers

X-Tenant-Idstring uuid

The organisation to act in. An API key is bound to exactly one, so this is optional for a key and must match the one it was minted for.

Request body

filenamestring required

With its extension, e.g. fattura-123.pdf.

content_base64string required

The file’s bytes, base64-encoded.

titlestring

Defaults to the filename.

type_idstring uuid

A type id from documents_list_types. Omit to have the type recognised automatically from the document; pass one only when the user stated it.

party_idsstring[]

Anagrafiche to associate explicitly; requires anagrafiche:write.

direction'in_entrata' | 'in_uscita'

Required with a type_id whose type needs one (needs_direction in documents_list_types): in_entrata for a document the company received, in_uscita for one it issued. Refused for any other type, and without a type_id.

Response

Done. data is the tool’s own answer.

oktrue required
dataunknown required

Changes

No recorded changes to this operation across all 1 revision of this API.