Docs

Templates

Create a template

Upload a PDF or Word document with glyphs and save it as a template.

POST/v1/templates

The document is read for glyphs and the fields they define are returned. Word documents are converted to PDF first. A file is refused when it has no selectable text (a scan) or no glyphs.

Authorization

Authorizationstringheaderrequired
Bearer followed by your API key: Bearer sgk_…. The key also works in an X-Api-Key header. See Authentication.

Body

multipart/form-data
filefilerequired
The document: a PDF or a Word .docx, 10 MB at most.
namestring
A name for the template, 150 characters at most. Defaults to the file name without its extension.

Response

201 CreatedThe new template, with its fields.
uidstring
The template's id: 8 letters and digits.
namestring
Your name for it (150 characters at most). Defaults to the file name.
source_namestring
The uploaded file's name.
source_typestring
What was uploaded. Word documents are converted to PDF on upload.
One of pdf docx
page_countinteger
Pages in the document.
signer_countinteger
Signers the glyphs call for: the highest glyph number.
field_countinteger
Fields found in the document.
date_createdstring (date-time)
When it was uploaded.
date_updatedstring (date-time)
When it last changed.
fieldsarray of objects
Every field, from its glyphs or placed by hand, in page order.
Single-template responses only.
ShowHide field attributes
idinteger | null
The field's id on a pact. null on a template.
recipientinteger
The signer the field belongs to: the number in its glyph (\s2\ → 2), or the signer it was given to in the website's field editor.
typestring
What the signer provides.
One of signature initials name date text checkbox
pageinteger
The page it is on, starting at 1.
xnumber
Distance from the page's left edge, in PDF points (1/72 inch).
ynumber
Distance from the top of the page to the box's bottom edge, in points: the glyph's text baseline. Signatures stand on that line.
widthnumber
The box's width in points: set by the field type for a glyph, as drawn for a field placed by hand on the website.
heightnumber
The box's height in points: set by the field type for a glyph, as drawn for a field placed by hand on the website.
labelstring | null
The label from the glyph, such as Company in \t1:Company\, or the one typed in the field editor.
requiredboolean
false when the glyph ends in ! (\t1:Phone!\, \c1!\), or when the field was made optional in the field editor.
valuestring | null
What was filled in, once that signer has signed: text as typed, "1" or "0" for a checkbox, the typed name for name, and the signing date (MM/dd/yyyy, UTC) for date. Signatures and initials are images on the PDF, so they stay null.

Errors

StatusWhen
400 Bad RequestNo file part; the file is not a PDF or .docx, is over 10 MB, is password-protected, has no selectable text, or has no glyphs. The message says which.
401 UnauthorizedThe API key is missing, wrong or revoked.
403 ForbiddenThe account's plan does not include API access (Pro and Business do).
413 Content Too LargeThe request body is well over 10 MB and was refused before it was read.

Every error body is { "error": "message" }. See Errors.