Upload File
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/File
Headers
| 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
}
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) |