Standard fill

Standard fill writes values you supply straight onto a form. Open a session over a detected form, set field values with direct fill, then render and download the finished PDF. Every action is deterministic.

Create a session

POST/sessionsBearer auth

Open a session over a previously created form. Returns 201 with the session_id.

Parameters

NameInTypeRequiredDescription
form_idbodystringyesThe form to open a session over.

Status codes

  • 201Session created.
  • 400form_id is not a UUID: "form_id must be a UUID".
  • 401Missing or invalid API key.
  • 404No such form, or owned by another key.
  • 409Form not ready.
  • 410The form's documents have been deleted under its retention policy.
  • 422form_id is missing from the body.
curl -X POST https://api.getemboss.ai/sessions \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{"form_id":"6c47f7f5-f921-4698-910f-95dd7d81310b"}'
Response
{
  "session_id": "6c47f7f5-f921-4698-910f-95dd7d81310b",
  "next_prompt": null,
  "missing": [1],
  "pending_confirmation": [],
  "form_state": {
    "fields": {
      "1": { "candidates": [], "confidence": null, "evidence": [], "history": [], "invalid_reason": null, "note": null, "origin": null, "reoffered": false, "source": null, "status": "unfilled", "value": null }
    },
    "turn_count": 0
  }
}

Get session state

GET/sessions/{id}Bearer auth

Read a session's status (active, then completed once filled) and the values set on it so far, in form_state.fields keyed by field id.

Parameters

NameInTypeRequiredDescription
idpathstringyesThe session_id.

Status codes

  • 200The session state.
  • 401Missing or invalid API key.
  • 404No such session, or owned by another key.
  • 410The form's documents have been deleted under its retention policy.
curl https://api.getemboss.ai/sessions/6c47f7f5-f921-4698-910f-95dd7d81310b \
  -H "Authorization: Bearer sk_..."
Response
{
  "session_id": "6c47f7f5-f921-4698-910f-95dd7d81310b",
  "status": "active",
  "form_state": {
    "fields": {
      "1": { "candidates": [], "confidence": "high", "evidence": [], "history": [{ "status": "filled", "turn": 1, "value": "Analytical Engines LLC" }, { "status": "confirmed", "turn": 1, "value": "Analytical Engines LLC" }], "invalid_reason": null, "note": null, "origin": "caller", "reoffered": false, "source": "direct", "status": "confirmed", "value": "Analytical Engines LLC" }
    },
    "turn_count": 1
  }
}

Direct field fill

PUT/sessions/{id}/fieldsBearer auth

Set field values directly by id. A structured, deterministic fill.

Parameters

NameInTypeRequiredDescription
idpathstringyesThe session_id.
updatesbodyarray<{field_id:integer, value:string}>yesField updates: each maps a contract field id to its value.

Status codes

  • 200Fields set.
  • 401Missing or invalid API key.
  • 404No such session, or owned by another key.
  • 409Session is completed (terminal).
  • 410The form's documents have been deleted under its retention policy.
  • 422Field validation failed (unknown id or invalid value).
curl -X PUT https://api.getemboss.ai/sessions/6c47f7f5-f921-4698-910f-95dd7d81310b/fields \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{"updates":[{"field_id":1,"value":"Analytical Engines LLC"}]}'
Response
{
  "session_id": "6c47f7f5-f921-4698-910f-95dd7d81310b",
  "applied": [1]
}

Render the filled PDF

POST/sessions/{id}/fillBearer auth

Render the session's confirmed values into a filled PDF and mark it completed.

Parameters

NameInTypeRequiredDescription
idpathstringyesThe session_id.

Status codes

  • 200Filled; session is now completed.
  • 401Missing or invalid API key.
  • 402No payment method on file and the monthly free standard fills are used up, or the form is over the free tier's 5-page cap. The body's detail carries code, message and billing_url.
  • 404No such session, or owned by another key.
  • 409Session already completed, or the form has no fillable PDF.
  • 410The form's documents have been deleted under its retention policy.
curl -X POST https://api.getemboss.ai/sessions/6c47f7f5-f921-4698-910f-95dd7d81310b/fill \
  -H "Authorization: Bearer sk_..."
Response
{
  "session_id": "6c47f7f5-f921-4698-910f-95dd7d81310b",
  "status": "completed"
}

Download the PDF

GET/sessions/{id}/pdfBearer auth

Download the filled PDF. The response body is the raw %PDF bytes. A session started with POST /sessions must be filled with POST /sessions/{id}/fill first; a session made by a fill from documents downloads straight away.

Parameters

NameInTypeRequiredDescription
idpathstringyesThe session_id.

Status codes

  • 200The PDF bytes (application/pdf).
  • 401Missing or invalid API key.
  • 404No such session, or owned by another key.
  • 409Session has not been filled yet: the body's code is not_filled. Fill it with POST /sessions/{id}/fill, the billed step, then download.
  • 410The form's documents have been deleted under its retention policy.
curl https://api.getemboss.ai/sessions/6c47f7f5-f921-4698-910f-95dd7d81310b/pdf \
  -H "Authorization: Bearer sk_..." \
  -o filled.pdf
Response
%PDF-1.7
…binary…