Detect contract fields across all pages
curl --request POST \
--url https://api.contractag.dev/fields \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileimport requests
url = "https://api.contractag.dev/fields"
files = { "file": ("example-file", open("example-file", "rb")) }
response = requests.post(url, files=files)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST'};
options.body = form;
fetch('https://api.contractag.dev/fields', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"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"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Endpoints
Fields: All
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-fileimport requests
url = "https://api.contractag.dev/fields"
files = { "file": ("example-file", open("example-file", "rb")) }
response = requests.post(url, files=files)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST'};
options.body = form;
fetch('https://api.contractag.dev/fields', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"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"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}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
| Property | Description |
|---|---|
name | Machine-friendly field name (see Reference → Fields Included). |
page | 1-indexed page where the field was detected. |
bbox | Bounding box { x, y, w, h } in PDF points. |
confidence | Float 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.