Retrieve the latest extraction result for a previously submitted document, optionally filtered to a specific page.
The API Playground above uses the endpoint to send live requests and inspect
responses without leaving the docs.
Request
- Method:
GET
- URL:
https://api.contractag.dev/fields/{document_id}
- Query Parameters:
page
— Optional. 1-indexed page number to filter by.
- Headers:
x-api-key: YOUR_API_KEY
(optional)
curl -X GET https://api.contractag.dev/fields/doc_123 \
-H "x-api-key: $CONTRACTAG_API_KEY"
To filter by page:
curl "https://api.contractag.dev/fields/doc_123?page=2" \
-H "x-api-key: $CONTRACTAG_API_KEY"
Response
When no page
parameter is provided, returns all fields:
{
"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"
}
When page
is specified, returns fields for that page only:
{
"documentId": "doc_123",
"pages": 12,
"fields": [
{
"name": "special_conditions",
"page": 2,
"bbox": { "x": 64.1, "y": 481.0, "w": 482.8, "h": 96.5 },
"confidence": 0.85
}
],
"createdAt": "2024-09-10T07:21:37.524Z"
}
Responses include coordinates and confidence only. Render bounding boxes over the source PDF to view the underlying text.
Errors
404
— Document ID not found or expired (default retention is 30 days).
410
— Document purged; re-upload required.
422
— Invalid page parameter.
429
— Rate limit exceeded; see response headers for reset window.
fields
FieldDetection · object[]
required
createdAt
string<date-time>
required