Upload Form
Endpoint
POST /v1/forms/upload
Description
Uploads a single PDF form file and triggers Instafill’s batch-processing pipeline.
The file is first stored in Instafill’s template blob storage, then forwarded to the downstream /forms/batch
service.
The response is an array (length = 1) containing the parsed form’s metadata and detected fields.
Accepted file types —
application/pdf
orapplication/octet-stream
Any otherContent-Type
returns 415 Unsupported Content Type.
Request
Headers
Header | Required | Value |
---|---|---|
Content-Type | ✓ | application/pdf or application/octet-stream |
Authorization | ✓ | Bearer YOUR_API_KEY |
Body
Binary contents of the PDF file.
curl -X POST https://api.instafill.ai/v1/forms/upload \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/pdf" \
--data-binary "@sample-form.pdf"
Responses
Success — 200 OK
Returns an array with the result of the form upload and processing:
{
"id": "uf_50a7cd169edd47a093168a29792733cd",
"object": "upload_form",
"form_id": "6866495ea5c8a5bac52a3c7f",
"file_name": "6d4a5144-3725-48be-b7ae-4318c271e87a_1751533840.pdf"
}
Error — 415 Unsupported Content Type
Returned when the request’s Content-Type
is not application/pdf
or application/octet-stream
.
{
"id": "error_6b63acaf4baf4d179b33ebe580571c0a",
"created": "2024-06-19T13:45:08.4531108Z",
"object": "error",
"error_message": "Expected octet-stream or pdf"
}