Skip to main content
Create a document

Authorizations

Authorization
string
header
required

Authorize using an API key. Send it in the Authorization: Bearer <api-key> header. Only API keys are accepted — session tokens are rejected. Create your first API key in the Circularo web app; further keys can be managed through this API.

Headers

Idempotency-Key
string

A unique key that makes a create request safe to retry. Generate a fresh value for each distinct operation. If a retry with the same key arrives while the original is still being processed you get a conflict; once it has completed you get the original result back instead of creating a duplicate, and reusing the key with a different request body is rejected. Stored results are retained for a limited time, after which a retry executes the request again.

Required string length: 1 - 255
Example:

"6b8f0f2e-9d3a-4c1e-bf7a-2f1d9c0a1b23"

Body

application/json

Everything needed to create a single document from an uploaded file.

mainFileId
string
required

Identifier of a file you have already uploaded, used as the document's main file.

Minimum string length: 1
Pattern: ^[a-z0-9]+$
Example:

"s1pss1atbzli272pinbt48n2ssy96ax2pwgqrz5qyzklwxg1kl0tq6anvz1p97xj"

title
string
required

Human-readable title of the document.

Maximum string length: 255
Example:

"Client agreement"

attachments
object[]

Files attached to the document alongside its main file.

category
string | null

A category label for the document. Your organization can define a set of categories to organize documents by.

Maximum string length: 255
Example:

"Contract"

customFields
object[]

Custom key/value data stored on the document, outside its metadata definition. All custom fields of a document together may take up at most 10 KiB.

Maximum array length: 100
expiresAt
string<date-time> | null

When the document expires — the end of the last day it is valid. The Circularo web app sets it to the end of the chosen day in the user's time zone; send it the same way. It cannot be sent with term.nonFixedTerm, whose expiration is worked out from the termination.

Example:

"2026-12-31T22:59:59.999Z"

folderId
string | null

Identifier of the folder to place the document in. The folder may belong to your personal tree or your organization's shared tree; the document is placed in whichever tree that folder belongs to. When omitted, the document is placed at the root of the tree selected by scope. At most one of folderId and scope may be provided.

Minimum string length: 1
Pattern: ^[A-Za-z0-9_-]+$
Example:

"97cfb9de-92dd-413a-b5e7-175eff7506d6"

metadataDefinition
string | null
default:d_default

Identifier of the metadata definition the document is created with. It determines the available metadata fields. It must support documents created from a file; another one is rejected.

Pattern: ^[A-Za-z0-9_-]+$
Example:

"d_default"

metadataFields
object

Values for the fields the chosen metadata definition declares, keyed by field identifier. Retrieve the definition to see which fields it has; a key it does not declare, a value that does not fit its field's type (a date as ISO 8601, a number as a number, true or false for a toggle), a value for a field that holds none (such as an image), a choice that a radio, checkbox or list field does not offer, or a select_user value that is not the identifier of an active user your account can see, is rejected, so nothing you send is stored only partially.

Example:
pdfConversion
enum<string>
default:none

How the main file is converted when the document is created. A PDF that already carries a signature is stored as uploaded — re-rendering it would strip the existing signature.

  • none: The main file is stored as uploaded, without conversion.
  • pdf: The main file is converted to PDF, when its format supports conversion.
  • pdfa: The main file is converted to the PDF/A archiving format. This may change its visual appearance.
Available options:
none,
pdf,
pdfa
Example:

"pdfa"

scope
enum<string>

Selects the folder tree when no folderId is given — the document is placed at the root of that tree. Defaults to personal. At most one of folderId and scope may be provided.

  • personal: Your personal folder tree, visible only to you.
  • shared: The organization-wide shared folder tree.
Available options:
personal,
shared
Example:

"shared"

submittedFiles
object[]

Evidence files submitted to the document. Once a transaction starts, submitted files can no longer be changed. Each entry must reference a freshly uploaded file that no other document uses yet — reusing a file identifier here fails with 400 (unlike mainFileId and attachments, which are copied automatically).

term
object

The contract term of the document — how it renews, the reminders ahead of its expiration, or the notice terms of a contract running until it is terminated. Sending it requires the use_document_terms right. A reminder recipient who could not read the document yet is given read access to it.

Response

The document was created.

A single document: its metadata, files, field values and lifecycle status.

annotations
object[]
required

Text annotations added to the document.

attachments
object[]
required

Files attached to the document.

category
string | null
required

Free-form category label of the document.

Example:

"Contract"

createdAt
string<date-time> | null
required

When the document was created.

Example:

"2024-11-02T09:15:30.000Z"

createdBy
object | null
required

The user who created the document. Null when it cannot be determined.

customFields
object[]
required

Custom key/value data stored on the document, outside its metadata definition.

expiresAt
string<date-time> | null
required

When the document expires — the end of the last day it is valid. Null when the document has no expiration date.

Example:

"2026-12-31T22:59:59.999Z"

folders
object[]
required

The document's placements in folder trees — one entry per tree it belongs to. Empty when the document is not in any folder tree.

id
string
required

Identifier of the document.

Minimum string length: 1
Pattern: ^[A-Za-z0-9_-]+$
Example:

"a0d01c9d-f72f-4c57-af11-e26bda19cc59"

images
object[]
required

Images embedded into the document.

mainFile
object | null
required

The main file of the document.

metadataDefinition
string | null
required

Identifier of the metadata definition the document was created with.

Required string length: 1 - 100
Pattern: ^[A-Za-z0-9_-]+$
Example:

"d_default"

metadataFields
object
required

Values of the metadata-definition fields, keyed by field identifier.

Example:
owner
object | null
required

The current owner of the document. Null when it cannot be determined.

signatureProvider
enum<string> | null
required

The provider used to sign this document. A transaction fixes it — from the signatureProvider that transaction was created with, or from your account default at the moment the first signature is applied — and it cannot be changed afterwards. Null until a transaction has fixed it.

  • internal: The certificate Circularo manages for your environment.
  • datasure: Datasure, an external trust service provider. Requires a Datasure certificate and Datasure account configured in your environment.
  • emdha: EMDHA, the Saudi national digital signature service. The signer completes the signature in the web app.
  • uaePassSign: UAE PASS, the national digital identity service of the United Arab Emirates. The signer completes the signature in the web app.
  • icaQualified: I.CA qualified certificates on a hardware token. The signer completes the signature in the web app, using their own device.
  • icaSwStore: I.CA certificates from the signer's software certificate store. The signer completes the signature in the web app, using their own device.
Available options:
internal,
datasure,
emdha,
uaePassSign,
icaQualified,
icaSwStore,
null
Example:

"internal"

signatures
object[]
required

Signatures, seals and timestamps applied to the document.

submittedFiles
object[]
required

Immutable evidence files submitted to the document.

templateId
string | null
required

Identifier of the template the document's transaction is bound to. Null when the document is not bound to a template.

Minimum string length: 1
Pattern: ^[A-Za-z0-9_-]+$
Example:

"cba71ea5-9a68-431a-a5c2-6d9932792ec7"

term
object | null
required

The contract term recorded for the document. Null when the document neither expires nor has a term configured.

title
string | null
required

Human-readable title of the document.

Example:

"Client agreement"

transaction
object
required

A summary of the document's transaction: its current state and the recipients still to act.

trashed
boolean
required

Whether the document is currently in the trash.

Example:

false

webUrl
string<uri> | null
required

Link to open the document in the Circularo web app. Requires an authenticated Circularo session.

Example:

"https://sandbox.circularo.com/home/detail?select=a0d01c9d-f72f-4c57-af11-e26bda19cc59"