Skip to main content
POST
/
fields
Detect contract fields across all pages
curl --request POST \
  --url https://api.contractag.dev/fields \
  --header 'Content-Type: multipart/form-data' \
  --form file=@example-file
{
  "documentId": "<string>",
  "pages": 123,
  "fields": [
    {
      "name": "<string>",
      "page": 123,
      "bbox": {
        "x": 123,
        "y": 123,
        "w": 123,
        "h": 123
      },
      "confidence": 123
    }
  ],
  "createdAt": "2023-11-07T05:31:56Z"
}
Upload a contract PDF and receive all detected fields in a single response.
Use the API Playground above to upload sample PDFs, tweak parameters, and inspect live responses without leaving the docs.

Request

  • Method: POST
  • URL: https://api.contractag.dev/fields
  • Headers:
    • x-api-key: YOUR_API_KEY (optional)
  • Body:
    • file — Required. PDF file upload.
curl -X POST https://api.contractag.dev/fields \
  -H "x-api-key: $CONTRACTAG_API_KEY" \
  -F file=@/path/to/contract.pdf

Upload Limits

  • Maximum file size: 25 MB
  • Accepted mime types: application/pdf
  • Multi-page contracts supported (up to 150 pages)

Response

{
  "documentId": "doc_123",
  "pages": 12,
  "fields": [
    {
      "name": "purchaser_name",
      "page": 1,
      "bbox": { "x": 142.3, "y": 258.9, "w": 210.5, "h": 24.2 },
      "confidence": 0.97
    }
  ],
  "createdAt": "2024-09-10T07:21:37.524Z"
}

Field Object

PropertyDescription
nameMachine-friendly field name (see Reference → Fields Included).
page1-indexed page where the field was detected.
bboxBounding box { x, y, w, h } in PDF points.
confidenceFloat 0–1 describing model confidence.
Contractag does not return raw text; overlay bounding boxes on the original PDF to display values.

Status Codes

  • 200 — Extraction completed and results returned.
  • 400 — Invalid file or request parameters.
  • 401 — Missing/invalid API key.
  • 413 — File size exceeds limit.

Headers

x-api-key
string | null

Body

multipart/form-data
file
file
required

PDF contract

Response

Successful Response

documentId
string
required
pages
integer
required
fields
FieldDetection · object[]
required
createdAt
string<date-time>
required
I