API Reference

Form Fill

API reference for the form filling endpoints

Form Fill

Fill PDF forms with AI-powered field detection.

Enterprise plans. A request from another plan is refused with 402 naming the plan that has it — the same body as every plan-gated feature (documented under the status codes in the OCR reference).


POST /v1/form-fill

Upload a PDF form and field data for AI-powered filling.

Endpoint

POST https://api.deepread.tech/v1/form-fill

Authentication

Include your API key in the X-API-Key header:

X-API-Key: YOUR_API_KEY

Request

Headers

HeaderRequiredDescription
X-API-KeyYesYour API key
Content-TypeYesmultipart/form-data

Request Body (Multipart)

ParameterTypeRequiredDescription
filefileYesPDF form to fill
form_fieldsstringYesJSON object with field names and values
webhook_urlstringNoURL to receive job completion notifications
idempotency_keystringNoUnique key to prevent duplicate submissions
url_expires_inintegerNoSigned URL expiration in seconds (default: 604800 = 7 days, min: 3600, max: 604800)

Example Request

cURL Example
curl -X POST https://api.deepread.tech/v1/form-fill \
-H "X-API-Key: $DEEPREAD_API_KEY" \
-F "file=@application_form.pdf" \
-F 'form_fields={"full_name": "John Doe", "date_of_birth": "1990-01-15", "ssn": "123-45-6789", "address": "123 Main St", "city": "New York", "state": "NY", "zip": "10001"}' \
-F "webhook_url=https://your-app.com/webhooks/form-fill"

Response

Success Response (200 OK)

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "queued"
}

Response Fields

FieldTypeDescription
idstringUnique job identifier (UUID)
statusstringInitial job status (queued)

Status Codes

CodeDescription
200Job created successfully; with an idempotency_key seen before, the job that request created
400Invalid input (bad JSON, unsupported file type, or a PDF over the plan's page cap)
401Invalid or missing API key
402Form fill is not on the plan, or the credits do not cover the job; the body names what is needed
413File over the plan's size cap (15 MB on Free, 50 MB on Standard, 500 MB on Enterprise) or the hard maximum
429Submissions per minute, pages in flight, or the Free monthly allowance exceeded; Retry-After says when to try again
500Internal server error
503The API key could not be checked because our database did not answer; retry after Retry-After (5 s). A bad key is 401

GET /v1/form-fill/{job_id}

Retrieve the status and results of a form fill job.

Endpoint

GET https://api.deepread.tech/v1/form-fill/{job_id}

Authentication

X-API-Key: YOUR_API_KEY

Path Parameters

ParameterTypeDescription
job_idUUIDThe job ID returned from POST /v1/form-fill

Example Request

cURL Example
curl https://api.deepread.tech/v1/form-fill/550e8400-e29b-41d4-a716-446655440000 \
-H "X-API-Key: $DEEPREAD_API_KEY"

Response

Success Response (200 OK)

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "completed",
  "file_name": "application_form.pdf",
  "created_at": "2024-01-15T10:30:00Z",
  "completed_at": "2024-01-15T10:30:08Z",
  "filled_form_url": "https://storage.deepread.tech/filled/abc123.pdf",
  "fields_detected": 12,
  "fields_filled": 10,
  "fields_verified": 10,
  "fields_hil_flagged": 0,
  "duration_seconds": 8.5,
  "report": { ... },
  "errors": []
}

Response Fields

FieldTypeDescription
idstringJob identifier
statusstringqueued, processing, completed, or failed
file_namestringOriginal uploaded file name
created_atstringISO 8601 timestamp
completed_atstringISO 8601 timestamp (null if not completed)
filled_form_urlstringSigned URL to download filled PDF (when completed)
fields_detectedintegerNumber of form fields found
fields_filledintegerNumber of fields that received values
fields_verifiedintegerNumber of fields that passed QA
fields_hil_flaggedintegerNumber of fields flagged for human review
duration_secondsnumberProcessing time
reportobjectDetailed processing report
errorsarrayList of error messages (if any)
error_messagestringError description (if status is failed)

Status Codes

CodeDescription
200Job found
401Invalid or missing API key
404Job not found
429Polling limit for the plan (Free 20 a minute, Standard 60, Enterprise 150); Retry-After says when to try again

Idempotency

Use the idempotency_key parameter to prevent duplicate form fills:

cURL Example
curl -X POST https://api.deepread.tech/v1/form-fill \
-H "X-API-Key: $DEEPREAD_API_KEY" \
-F "file=@application_form.pdf" \
-F 'form_fields={"full_name": "John Doe"}' \
-F "idempotency_key=user-123-form-456-2024-01-15"

If a job with the same idempotency key already exists, the API returns the existing job instead of creating a new one.


Webhooks

When you provide a webhook_url, DeepRead sends a POST request when the job completes:

{
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "completed",
  "created_at": "2024-01-15T10:30:00Z",
  "completed_at": "2024-01-15T10:30:08Z",
  "result": {
    "filled_form_url": "https://storage.deepread.tech/filled/abc123.pdf",
    "fields_detected": 12,
    "fields_filled": 10,
    "fields_verified": 10,
    "fields_hil_flagged": 0,
    "report": { ... }
  }
}

For failed jobs:

{
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "failed",
  "created_at": "2024-01-15T10:30:00Z",
  "error": "Unable to detect form fields in document",
  "errors": ["..."]
}

Rate Limits

Limits are per plan. Past a limit the request is refused with 429 and a Retry-After header saying when to try again.

PlanPOST /v1/form-fill per minuteGET /v1/form-fill/{job_id} per minute
Free1020
Standard10060
Enterprise500150

A form-fill job counts its pages towards the account's pages in flight (16 on Free, 200 on Standard, 500 on Enterprise), shared with OCR and PII redaction jobs. No document over 2,000 pages or 500 MB is accepted on any plan (413).

Response headers include:

  • X-RateLimit-Limit: Maximum requests per period
  • X-RateLimit-Remaining: Remaining requests
  • X-RateLimit-Reset: Unix timestamp when limit resets