Skip to main content
Convert a file to PDF

Authorizations

token
string
query
required

Standard authorization for most API calls. This token identifies the logged-in user and their permissions. It is obtained either as a temporary token after a successful login or as a long-term API key.

Body

application/json
hash
string
required

Unique hash (identifier) of the file.

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

"s1pss1atbzli272pinbt48n2ssy96ax2pwgqrz5qyzklwxg1kl0tq6anvz1p97xj"

checkSignFields
boolean | null
default:false

Whether to look through the converted document for signature fields already placed in it and report what was found. Requires returnType hash. The converted PDF is analyzed, so this is how the signature fields of a Word file are found. Every notation is read: AcroForm signature fields, signature_field_start:{...}:signature_field_end markers in a rectangle, and {{cir:...}} tags written into the document text - in a drawing shape or in ordinary text flow. A tag found in text flow is also removed from the file. A marker that cannot be used - a {{cir:...}} tag with an unknown type, property or flag or a value of the wrong shape, or a JSON marker that is not valid JSON or is in no rectangle - does not fail the request: it is left in the document and returned in faultySignFields with the reason. A JSON marker naming an invalid field still fails the request. A field from a tag gets the userRoleId its role: stands for in the document - the id a JSON marker already pairs with that role name, or else the next free number, in reading order. Tag fields with the same group: form one radio group or checkbox group and share a groupId, the next number above those the file already uses; a group whose fields differ in type, role or signing order, or are not all required or all optional, fails the request. w: and h: are fractions of the page, between 0 and 1 (w:0.3 is 30 % of the page width).

Example:

false

extractTermDates
boolean | null
default:false

Whether to also detect the contract's term in the converted PDF and return every value found as a suggestion with the passage it was read from and where that passage is printed. It works only when the answer describes the converted file rather than streaming it. Asking for it requires the rights to use the AI features (llm_extraction) and the document term (use_document_terms), and write access to the file - being allowed to edit a document it belongs to, or owning it when it belongs to no document.

Example:

false

forcePdfA
boolean | null
default:false

Whether to archive an already-signed document even though converting destroys the signature. Left off, a signed document is left as it is and the answer says the conversion was skipped.

Example:

false

returnType
enum<string> | null
default:file

Whether to answer with the converted document itself or with a description of it. Asked for as file the PDF is streamed straight back, which suits handing it to a viewer; asked for as hash the answer is the stored file's metadata together with anything read out of it, which is what a client needs before going on to build a document from it. Reading anything out of the document is only possible in the second form.

Available options:
,
null,
hash,
file
Example:

"file"

signatureAnchors
object[]

Pieces of text to look for in the converted document, each with an offset saying where a signature belongs relative to the text found. Where they landed is reported back, so a signature can be positioned without knowing the page layout in advance.

Maximum array length: 100
usePdfA
boolean | null
default:false

Whether to convert the document for long-term archiving as well. The conversion embeds everything the document needs to render the same way years later, which can change how it looks now.

Example:

false

Response

Streams the converted PDF, or returns it as a stored file together with whatever was read out of it.

anchorPositions
object[] | null

Where each requested text anchor was found, page and position, so a signature field can be placed against it. Empty unless anchors were asked for.

faultySignFields
object[] | null

Signature field markers found in the file that could not be used - a {{cir:...}} tag that describes no usable field, or an original signature_field_start:{...}:signature_field_end marker that is not valid JSON, cannot be read, or is in no rectangle to take its position from. Each is left in the document so it stays visible, and the request still succeeds with the fields that could be used.

file
object

The converted PDF as it was stored - a file of its own, leaving the original where it was.

pdfASkippedDueToSignature
boolean

True when PDF/A conversion was requested but skipped because the file is already signed and forcePdfA was not set. The original signed file is kept and is not PDF/A compliant.

signFields
object[] | null

Signature fields already placed in the document, as read out of it. Empty unless the request asked for them.

termSuggestions
object | null

The contract term detected in the converted PDF, when extractTermDates asked for it; null otherwise.