Get the contract
The contract is the structured list of every field Emboss detected on a form: its labels, types, data types, and positions. Fetch it once detection is ready to verify or map your own data against the fields.
Get the contract
GET
/forms/{id}/contractBearer authReturn the detected-fields contract for a form once detection is complete. The body is { id, contract }: read the fields from contract.fields. Pages count from 0, and value is always null: the contract describes the form; a fill never writes into it.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | The form id to fetch the contract for. |
Status codes
- 200Detection complete: { id, contract }.
- 401Missing or invalid API key.
- 404No such form, or owned by another key.
- 409Contract not available: detection not ready.
curl https://api.getemboss.ai/forms/6c47f7f5-f921-4698-910f-95dd7d81310b/contract \ -H "Authorization: Bearer sk_..."
Response
{
"id": "6c47f7f5-f921-4698-910f-95dd7d81310b",
"contract": {
"schema_version": "1.0",
"page_count": 1,
"field_count": 3,
"form": { "title": "Form W-9" },
"fields": [
{
"id": 1,
"name": "business_name",
"label": "Business name",
"type": "text",
"data_type": "organization",
"required": true,
"page": 0,
"rect": { "x": 72, "y": 540, "width": 320, "height": 18 },
"description": "The legal name of the business.",
"section": "Part I",
"value": null
},
{
"id": 7,
"label": "Exempt payee code applies",
"type": "checkbox",
"data_type": "boolean",
"required": false,
"page": 0,
"rect": { "x": 88, "y": 470, "width": 12, "height": 12 },
"value": null
},
{
"id": 14,
"label": "Signature",
"type": "signature",
"data_type": "signature",
"required": true,
"page": 0,
"rect": { "x": 72, "y": 120, "width": 240, "height": 28 },
"value": null
}
]
}
}