Upload File
Two endpoints share this shape: POST /api/v1/File for PDFs (below) and POST /api/v1/Image for pictures used inside block documents - see Upload Image at the end of this page.
Upload a PDF (base64-encoded) for use in sessions created with Create Session. The returned fileId is referenced in the session's files array as { "type": "uploadedPdf", "fileId": "..." }. Uploaded PDFs ride along as reference documents - signature fields are placed on block documents. Only PDF files are accepted, up to 7MB (decoded).
Endpoint
POST https://api.airsign.com.au/api/v1/FileHeaders
| Name | Value | Required | Description |
|---|---|---|---|
| Content-Type | application/json | Yes | Specifies the format of the request body |
| Authorization | Bearer {access_token} | Yes | Bearer token with the write:files or write:sessions scope |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| fileName | string | Yes | File name (max 255 characters). A .pdf extension is added if missing |
| data | string | Yes | base64-encoded PDF bytes, without a data: URI prefix. Max 7MB decoded |
Example Request
curl --location 'https://api.airsign.com.au/api/v1/File' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {access_token}' \
--data-raw '{
"fileName": "supplier-terms.pdf",
"data": "JVBERi0xLjcKJ...{base64}..."
}'Response
Status: 200 OK
{
"fileId": "{uuid}",
"fileName": "supplier-terms.pdf",
"fileType": "application/pdf",
"sizeBytes": 482133,
"pageCount": 2,
"pages": [{ "pageNumber": 1, "width": 595.28, "height": 841.89 }, { "pageNumber": 2, "width": 595.28, "height": 841.89 }],
"formFields": [
{ "name": "supplier_name", "type": "textZone", "label": "Supplier name", "page": 1, "x": 160, "y": 123.9, "w": 220, "h": 18 },
{ "name": "accepts_terms", "type": "checkboxZone", "page": 2, "x": 60, "y": 187.9, "w": 14, "h": 14 }
],
"hasSignatureField": false,
"nextStep": "This PDF has form fields but NO signature field - add one with files[].fields (fieldType "signature", anchored to the signature caption or by page/x/y)."
}formFields lists the PDF's own form fields in PDF points (top-left origin). They are imported as AirSign fields when the file is used in a session or template (see Uploaded PDF entries); use the names here to re-assign or exclude individual fields, and add what is missing with fields. A PDF that cannot be opened is rejected with INVALID_PDF.
Upload Image
POST /api/v1/Image takes the same body (fileName + base64 data) and accepts PNG, JPEG, WebP and GIF up to 2MB decoded. The image is stored for use as a block document logo or inline image block. Requires write:files (or a session/template write scope).
{
"fileId": "0f6d2b7e-5c1a-4e0b-9a3f-2b7c8d9e1f00",
"fileName": "club-logo.png",
"fileType": "image/png",
"width": 400,
"height": 400,
"sizeBytes": 18234
}Errors mirror the PDF endpoint: INVALID_FILE_TYPE for anything that is not a supported image, FILE_TOO_LARGE above 2MB.
Error Responses
| Status | Description |
|---|---|
400 | Invalid base64 (INVALID_BASE64) or the decoded file is not a PDF (INVALID_FILE_TYPE) |
401 | Missing or invalid authentication token |
413 | File too large - max 7MB decoded (FILE_TOO_LARGE) |