Extract spec sections
Section content extraction · model content-extractor
/v1/specs/content-extractQueue extraction of section text (and optional LLM-structured requirement fields) for CSI-style sections from the same PDF as a completed TOC parse job. Job model: content-extractor. X-API-Key and Content-Type: application/json; response is 202 with a new job id, then poll GET /v1/jobs/{job_id}.
- Returns
- A job to check202 Accepted
- Usage
- Document indexingper page of the sections extracted
- Results in
- Section contentresult.sections
- Auth
- API keyX-API-Key header
Prerequisite
toc-parser job for your account with status complete. Create it with POST /v1/specs/parse/document. The canonical path is /v1/specs/parse/document — not /v1/specs/parse.How it runs
- Send a completed TOC
job_id - Get a
job_id - Check your results or receive a webhook
Request
Headers: X-API-Key, Content-Type: application/json. Body: ContentExtractRequest.
| Field | Description |
|---|---|
job_idstring · UUIDRequired | Must be a completed toc-parser job id for this account. |
section_codesstring[]Optional | Explicit 6-digit section codes. |
division_codesstring[]Optional | Expands to all 6-digit section codes under each division using result.divisions on the TOC job. Sections are pulled only from divisions present in the stored TOC result. |
webhook_urlstring · URLOptional | Worker delivers on developer, pro, and enterprise only. |
| Header | Description |
|---|---|
X-API-KeyRequired | Your API key. A missing or invalid key returns 401. |
Content-TypeRequired | application/json |
102900). Invalid input → 422 INVALID_SECTION_CODE.01, 1). Sections are taken only from divisions present in the stored TOC result. After expansion, codes are deduplicated (order preserved). If nothing resolves → 422 NO_SECTIONS_RESOLVED.Responses
The response job_id is a new content-extractor job. The request body job_id is the source TOC job; when complete, result.source_job_id points back to that TOC job. Poll GET /v1/jobs/{job_id} — see GET /v1/jobs/{job_id}.
| Field | Description |
|---|---|
job_idstring · UUID | New content-extractor job id. |
statusstring | Always queued on this response. |
poll_urlstring | Path only — prepend https://api.anchorgrid.ai. |
When status is complete and model is content-extractor, result is returned per section.
| Field | Description |
|---|---|
source_job_idstring · UUID | The toc-parser job uuid from the request. |
sectionsarray | One object per requested section. |
sections[].section_codestring | 6-digit code. |
sections[].section_formattedstring | e.g. 10 29 00 |
sections[].section_titlestring | null | Title from the table of contents; null when the request used document_id. |
sections[].division_codestring | Division portion. |
sections[].division_titlestring | null | Division title from the table of contents; null when the request used document_id. |
sections[].foundboolean | false with empty content if the section could not be located. |
sections[].contentstring | Full extracted text when found. |
sections[].start_pageinteger | null | 1-based PDF page where the section starts; null if not found. |
sections[].end_pageinteger | null | Last page carrying the section code in its header or footer. |
sections[].section_pagesinteger[] | Pages carrying the section code in their header or footer. |
sections[].productsarray | Structured when SpecNormalizer succeeds; else []. |
sections[].required_itemsarray | Same. |
sections[].compliance_requirementsarray | Same. |
sections[].mounting_rulesarray | Same. |
sections[].furnishing_rulesarray | Same. |
sections_requestedinteger | Count requested. |
sections_foundinteger | Sections with content located. |
model_versionstring | e.g. content-extractor-v1.0.0 |
processing_time_msinteger | Wall time for the task. |
SpecNormalizer succeeds on non-empty content; on failure they default to empty arrays (logged server-side). GET /v1/jobs does not post-process content-extractor results (only door-detector is filtered on read).Usage & rate limits
Each job counts as one document-indexing page. Allowance behavior is the same as parse/document: 402 when a trial allowance is used up, 429 when a monthly allowance is; RPM 429 from middleware. Rate limit: tier RPM (job-submit bucket).
Errors (synchronous, before queueing)
Codes appear in handler detail; Intelligence may still genericize JSON bodies.
| Status | What it means |
|---|---|
| 401 | Missing or invalid API key. |
| 402 | Trial allowance used up. |
| 404JOB_NOT_FOUND | No row with that id + account + model toc-parser. |
| 422 | Pydantic validation: missing both section_codes and division_codes, bad UUID, etc. |
| 422JOB_NOT_COMPLETE | TOC job still queued, processing, or failed. |
| 422JOB_NO_FILE | TOC job missing input_s3_key / bucket. |
| 422INVALID_SECTION_CODE | Cannot normalize to 6 digits. |
| 422NO_SECTIONS_RESOLVED | Expansion + explicit codes yielded nothing. |
| 429 | Monthly quota or RPM limit. |
See Errors for HTTP exception mapping.
Typical flow
POST /v1/documents→document_idPOST /v1/specs/parse/document→ TOCjob_idGET /v1/jobs/{toc_job_id}until complete → readresult.divisions/ section codesPOST /v1/specs/content-extractwith bodyjob_id(TOC job) andsection_codesand/ordivision_codesGET /v1/jobs/{content_job_id}until complete → readresult.sections