Before you begin
- An uploaded file. The document is built on a file identifier, as in Create a document from a file.
- Custom fields need the
allow_documents_custom_fieldsright. Without it, a create call that carriescustomFieldsis rejected with403; the rest of the document is unaffected.
Two kinds of structured data
A document holds two separate sets of values, and they behave differently:
A metadata definition is the shape of a document: it lists the fields the document can hold, their data types and which of them are mandatory. Every document is created with exactly one definition, and its values go into
metadataFields, keyed by field identifier. Definitions are configured for your organization and cannot be created through the API, so an integration discovers what exists and works with it.
Custom fields are your own key/value pairs, stored alongside. Use them for data that belongs to your system rather than to Circularo — an identifier from your HR or CRM database, for example.
Step 1: Find the definitions you can use
Definitions are configured for your organization, so start by listing what is available:Request
Response
pagination is null, because this collection is never paged. Among the definitions is d_default — the one a document gets when you do not name any.
Each entry is a whole definition, including its field list; the block above is curated down to the identifiers. One call is therefore enough to learn everything about every definition available to you.
Step 2: Read the definition you will use
When the definition your integration works with is fixed — its identifier sitting in your configuration — read that one on its own:Request
Response
nameis the key you use when you supply the field’s value.typesays what a value looks like:D_EMPLOYMENT_START_DATEtakes a calendar date,D_EMPLOYMENT_NOTEfree text.optionslists the choices of a field that offers a fixed set of them, like the department here, and is empty for any other field;isMultiselectsays whether a field takes more than one value.requiredmarks the fields the definition expects every document to carry.
Step 3: Create a document with values
Name the definition and supply the values, keyed by field identifier:Request
Response
type, which defaults to string; displayName is the label shown next to the value. A custom field’s value always comes back as text, whatever its type — a field typed number returns "42", not 42, so convert it on your side.
A key the definition does not declare is rejected and no document is created, so a typo in a field identifier cannot leave you with a document that is missing part of its metadata.
GET /documents/{id} returns the same metadataFields and customFields. Filtering documents by their metadata values is covered in Search documents.
Complete example
Reading a definition and creating a document that fills it, as a Node.js script. Error handling is minimal for brevity — in production, inspect the error envelope of non-2xx responses.Next steps
- Send the document for signature or approval — Signing & approvals.
- Create documents with attachments and categories — Create a document from a file.