Block Document Format

The block document format lets you create signing documents from scratch through the API - no PDF required. You describe the document as a flow of blocks (headings, paragraphs, input fields, images, signature blocks) plus an optional theme, and AirSign lays them out on A4 pages with automatic text wrapping, page breaks and field placement. You never specify coordinates, so documents are always well-formed and every field the recipient must fill in is placed for you. It is used by Create Session and Create Template, and by the equivalent tools on the MCP server.

Document Object

FieldTypeRequiredDescription
formatstringYesMust be "blocks"
titlestringYesDocument title shown in the header band of every page. Must fit on one line - keep it under roughly 30 characters or the request is rejected
subtitlestringNoSmaller line shown under the title (max 200 characters)
footerLabelstringNoFooter text. Page numbers ("page X of Y") are appended automatically. Defaults to the title
themeobjectNoColours and header style - see Theme. Omit for the classic look
logoobjectNo{ "fileId": "...", "width": 100 } - an image (from Upload Image) shown at the right of the header band on every page. Fits a 130 x 60 point slot; width (20-130) is optional
blocksarrayYesThe document content, in order (1-500 blocks)

Theme

Every value is optional. Colours are 6-digit hex strings. Without a theme the document uses the classic look: a teal title with a thin rule under it and near-black body text.

FieldDescription
headerStyle"line" (default): coloured title with a rule under it. "band": a solid primaryColor band across the top of every page with the title and subtitle in bandTextColor - the branded-form look
primaryColorTitle colour and header rule (line style) / band fill (band style)
accentColorSection heading colour, plus a thin stripe under the band (band style)
textColorBody text colour
bandTextColorTitle/subtitle colour on a band header. Defaults to white

Example - a red and black club form: { "headerStyle": "band", "primaryColor": "#c8102e", "accentColor": "#111111" }

Block Types

TypeFieldsDescription
headingtext (required, max 500 chars)A bold section heading. Never left orphaned at the bottom of a page
paragraphtext (required), fontSize (7-24), bold, muted, align (left / center / right)Body text with automatic wrapping. Use \n for line breaks within the paragraph. muted renders in grey for fine print
bulletListitems (required, 1-50 strings)A bulleted list, one item per entry
spacerheight (required, 1-600 points)A vertical gap
pageBreakheader (optional)Forces the next block onto a new page. header controls that page's header: omit to keep the document header, null for no header band (the body starts at the top margin), or { "title", "subtitle" } to retitle it for that page
imagefileId (required), width (20-483 points), alignAn inline picture uploaded with Upload Image. Height follows the image's aspect ratio; width defaults to the pixel width capped at the content width (483 points)
fieldfieldType, label, recipient (required), name, required, placeholder, options, dateFormatAn input the recipient fills in while signing, spanning the content width. AirSign prints the label and the box or line and places the matching form field - see Input fields
fieldRowfields (required, 2-3 field objects without type)Two or three inputs side by side in equal columns, e.g. Child name | Date of birth | Age group. Kept whole on one page
signatureBlockrecipient (required), label (required, max 100 chars)A signature area with name, date-signed and signature fields bound to one recipient. recipient must match a key in the request's recipients array. Every signer should get exactly one. Never split across pages

Input Fields

field and fieldRow compile to the same form fields the AirSign editor places by hand, so they behave identically during signing (validation, required markers, conditional logic added later in the editor). Field properties:

PropertyDescription
fieldTypeOne of the types in the table below
labelPrinted above the input (beside it for a single checkbox) and shown to the signer. Required fields get a * after the printed label
recipientKey of the recipient who fills the field in
nameStable key the value is stored under (letters, digits, underscore, hyphen). Defaults to a slug of the label; must be unique within the document
requiredDefaults to true for every type except checkbox
placeholderHint text shown inside text inputs and dropdowns
optionsChoices (1-20 strings). Required for radio and dropdown (at least 2); optional on checkbox to make a multi-select group
dateFormatdate fields only: DD/MM/YYYY (default), DD/MM/YY, MM/DD/YYYY, MM/DD/YY, YYYY-MM-DD, MM/YYYY, MM/YY
fieldTypeRendered as
textSingle-line text input on an underline
multilineTextTaller boxed text area
dateText input validated as a date in dateFormat
numberText input validated as a number
emailText input validated as an email address
auMobileText input validated as an Australian mobile (04 or +61)
checkboxOne tick box with the label beside it, or - with options - a multi-select group of boxes (all optional unless required)
radioA single-choice group of round buttons, packed left to right and wrapped as needed. The chosen option text is the stored value
dropdownA boxed single-choice dropdown
initialsAn initials box

Recipients and Keys

Recipients are declared once per request (not per document) with a stable key that signatureBlock and field blocks reference:

FieldTypeRequiredDescription
keystringYesStable identifier referenced by recipient on signature blocks and fields, e.g. "parent". Alphanumeric, underscore and hyphen only
namestringSessions: yesFull name. For templates this may be a {{{variable}}} token or left blank to fill in later
emailstringSessions: yesEmail address (lowercase). For templates this may be a token
signingOrdernumberNo1-based signing order. Defaults to the array position

Images

Logos and image blocks reference pictures uploaded beforehand with Upload Image (POST /api/v1/Image, PNG / JPEG / WebP / GIF up to 2MB). The upload response returns the fileId to reference and the pixel dimensions; AirSign keeps the aspect ratio when it sizes the image on the page. Images must belong to the same organisation as the document.

Variables (templates only)

Templates may embed {{{variableName}}} tokens in any block text and in recipient name/email. Every token must be declared in the request's variables array, and values are supplied later when a session is created from the template (see Create Session From Template). Sessions are final documents - any token in a session document is rejected with a validation error.

Layout Rules

  • Pages are A4 portrait. Every page carries the title header band (unless a pageBreak removes or retitles it) and the footer with automatic page numbers.
  • Text wraps and paginates automatically; blocks that do not fit move to the next page. Headings stay with the content that follows them.
  • Fields, field rows, images and signature blocks are kept whole - they never split across a page boundary.
  • The document is validated before anything is saved: out-of-bounds content, an over-long title, an unknown recipient key, a duplicate field name, an image that is not uploaded yet or too tall for a page, or an undeclared variable all reject the request with a structured issue list.

Full Example

{
  "format": "blocks",
  "title": "Junior Footy Sign-Up",
  "subtitle": "Season 2027 registration and parental consent",
  "theme": { "headerStyle": "band", "primaryColor": "#c8102e", "accentColor": "#111111" },
  "logo": { "fileId": "0f6d2b7e-5c1a-4e0b-9a3f-2b7c8d9e1f00" },
  "blocks": [
    { "type": "heading", "text": "Player details" },
    { "type": "fieldRow", "fields": [
      { "fieldType": "text", "label": "Child name", "recipient": "parent" },
      { "fieldType": "date", "label": "Date of birth", "recipient": "parent" },
      { "fieldType": "dropdown", "label": "Age group", "recipient": "parent", "options": ["Under 8", "Under 10", "Under 12"] }
    ] },
    { "type": "field", "fieldType": "radio", "label": "Has your child played before?", "recipient": "parent", "options": ["Yes", "No"] },
    { "type": "field", "fieldType": "multilineText", "label": "Medical conditions or allergies", "recipient": "parent", "required": false },
    { "type": "heading", "text": "Consent" },
    { "type": "paragraph", "text": "I confirm that I am the parent or legal guardian of the child named above and consent to their participation for the season." },
    { "type": "field", "fieldType": "checkbox", "label": "I have read and agree to the club code of conduct", "recipient": "parent", "required": true },
    { "type": "bulletList", "items": ["Bring boots and a mouthguard.", "Training is Tuesdays and Thursdays."] },
    { "type": "spacer", "height": 16 },
    { "type": "signatureBlock", "recipient": "parent", "label": "Parent / Guardian" }
  ]
}

Validation Error Shape

Status: 400 Bad Request

{
  "message": "Document failed layout validation with 1 issue(s)",
  "error": "DOCUMENT_VALIDATION_FAILED",
  "issues": [
    {
      "kind": "title-too-long",
      "page": 1,
      "message": "title wraps to 2 lines in the header band - shorten it to fit one line (roughly 30 characters)",
      "snippet": "A Very Long Agreement Title That Cannot Fit"
    }
  ]
}

Issue kinds: title-too-long, out-of-bounds, zone-out-of-bounds, unknown-recipient, duplicate-field-name, unknown-image, image-too-tall, tokens-in-session, undeclared-variable.