Field detection
When you upload a PDF or DOCX, Atlas runs an automated pipeline to find signature lines, initial blocks, dates, text fields, and checkboxes. Results appear on the review page before send.
Pipeline overview
- Cache lookup — prior runs for the same document hash skip network calls
- Page dimensions — local PDF parse for coordinate normalization
- Extend Edit Schema — per-field detection (no party clustering in this step)
- Mapper — converts vendor schema to Atlas field types with bounding boxes
- Prose filter — drops text fields whose labels look like contract prose, not form labels
- Claude clustering — groups fields into detected parties and assigns
party_index - Cache write — stores field list for future uploads of the same file
If Extend returns zero fields, status becomes recovered_empty and you place fields manually on review.
fields_status states
| Status | Meaning |
|---|---|
pending | Detection running. Send returns 409. |
ready | Fields detected. Safe to send after review. |
failed | Pipeline error. See metadata.detection_error on review. |
recovered_empty | Zero fields found. Manual placement fallback. |
Never send while pending. Poll GET /api/envelope/{id} or watch the review page progress bar.
Detected parties
Clustering produces detected_parties[] with display names and optional role hints. Each field gets party_index pointing into that list.
When you pass parties[] at create, Atlas matches your signers to detected parties by role or name string. Unmatched parties stay available for witness or CC-style roles you add manually.
Manual corrections
On review you can drag fields, add new ones, rebind party assignment, and prefill text. Saves go to PATCH /api/envelope/{id}/fields with fields_version for optimistic concurrency.
Send bundles fields, parties, and version in one POST /api/envelope/{id}/send from review UI. Do not PATCH fields separately right before Send from review (avoids version drift on failure).
Re-detection
POST /api/envelope/{id}/redetect queues a fresh run. Useful after replacing the underlying PDF. Sets metadata.last_redetect_at.
Detection errors
On failure, Atlas writes metadata.detection_error: { message, stage, occurred_at } and leaves fields_status as failed or pending. It does not silently flip to ready.
Background stage updates land in metadata.detection_stage and metadata.detection_progress for the review UI.
Formats
Detection runs on PDF bytes. DOCX uploads convert to PDF at create time. Both paths share the same pipeline.
API create with detection
curl -X POST https://atlaswork.ai/api/envelope \ -H "Authorization: Bearer $ATLAS_API_KEY" \ -F "file=@nda.pdf"
Response may include detected_fields on fast paths. Always confirm on review_url.
MCP note
MCP send_contract_for_review triggers the same pipeline. The agent should tell the operator to open review_url and wait for fields before send.