Get an extraction job
JOB_ID=7c9e6679-7425-40de-944b-e07fc1f90ae7 # the jobId the submission answered with
curl -sS "https://api.speccapture.com/v1/extractions/$JOB_ID" \ -H "Authorization: Bearer $SPECCAPTURE_API_KEY"using System.Text.Json;
using HttpClient http = new() { BaseAddress = new Uri("https://api.speccapture.com") };http.DefaultRequestHeaders.Authorization = new("Bearer", Environment.GetEnvironmentVariable("SPECCAPTURE_API_KEY"));
string jobId = args[0]; // the jobId the submission answered with
HttpResponseMessage response = await Call(HttpMethod.Get, $"/v1/extractions/{jobId}");Console.WriteLine(await response.Content.ReadAsStringAsync());
// Sends a request; stops with the problem's code and detail if the API refuses it.async Task<HttpResponseMessage> Call(HttpMethod method, string path, HttpContent? body = null, string? idempotencyKey = null) { using HttpRequestMessage request = new(method, path) { Content = body }; if (idempotencyKey is not null) request.Headers.Add("Idempotency-Key", idempotencyKey); HttpResponseMessage response = await http.SendAsync(request); if (!response.IsSuccessStatusCode) { JsonElement problem = await Json(response); string? detail = (problem.TryGetProperty("detail", out JsonElement text) ? text : problem.GetProperty("title")).GetString(); Console.Error.WriteLine($"{(int)response.StatusCode} {problem.GetProperty("code")}: {detail}"); Environment.Exit(1); } return response;}
// Reads an answer as JSON.static async Task<JsonElement> Json(HttpResponseMessage response) => JsonDocument.Parse(await response.Content.ReadAsStringAsync()).RootElement;import osimport sys
import requests
API = "https://api.speccapture.com"session = requests.Session()session.headers["Authorization"] = f"Bearer {os.environ['SPECCAPTURE_API_KEY']}"
def call(method, path, **kwargs): """Send a request; stop with the problem's code and detail if the API refuses it.""" response = session.request(method, API + path, **kwargs) if not response.ok: problem = response.json() sys.exit(f"{response.status_code} {problem['code']}: {problem.get('detail', problem['title'])}") return response
job_id = sys.argv[1] # the jobId the submission answered with
print(call("GET", f"/v1/extractions/{job_id}").text)const API = "https://api.speccapture.com";const headers = { Authorization: `Bearer ${process.env.SPECCAPTURE_API_KEY}` };
const [jobId] = process.argv.slice(2); // the jobId the submission answered with
console.log(await call("GET", `/v1/extractions/${jobId}`).then((response) => response.text()));
// Sends a request; stops with the problem's code and detail if the API refuses it.async function call(method, path, init = {}) { const response = await fetch(API + path, { ...init, method, headers: { ...headers, ...init.headers } }); if (!response.ok) { const problem = await response.json(); console.error(`${response.status} ${problem.code}: ${problem.detail ?? problem.title}`); process.exit(1); } return response;}The job as it stands: its status (queued, splitting, extracting, then completed or failed), the file, the template it is delivered with, its credits (reserved, spent, refunded and still held) and progress, and one entry per sheet with that sheet’s status, review state and resultUrl, where its values are. Poll it every few seconds until status is completed or failed, or add a webhook endpoint and be told. A job of another workspace, a deleted one, or an id nobody issued is 404 not_found.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The job’s id: the jobId POST /v1/extractions answered with, or one GET /v1/extractions lists.
Responses
Section titled “Responses”OK
One uploaded file and the extraction of its sheets: the answer of POST /v1/extractions and GET /v1/extractions/{jobId}, and the job of every extraction webhook event.
object
The job’s id: what every other request about it names.
Where the job is.
The uploaded file’s name, as it was sent.
The uploaded file’s size, in bytes.
SHA-256 of the file’s bytes, lowercase hex.
The template the job is delivered with: the id of one of the workspace’s own templates (from GET /v1/templates), or drawing - the standard template, every field but the sizes and counts and the material form - for a job sent with drawing or read before the workspace had a template of its own. Every template reads the drawing the same way; it decides which values the job keeps, what each is called and in what order.
The version of the template the job keeps for good: 1 for drawing.
The pages counted when the file was accepted; each is read, and billed, on its own.
What the job reserved, spent, refunded and still holds.
object
What each sheet of this job costs, fixed when it was accepted.
Reserved when the file was accepted: its sheets times perSheet.
Spent on sheets that were read.
Returned for sheets, or a whole file, that could not be read, and for sheets skipped.
Still reserved for sheets not yet finished, and for sheets held because they do not look like drawings.
How many of its sheets are read, how many failed, and how many need a person to look.
object
Sheets read so far.
Sheets that could not be read, their credits refunded.
Read sheets with at least one value waiting for a person to look.
Sheets held because their page does not look like a drawing, waiting to be read anyway or skipped. Left out of the answer when there are none.
Held sheets that were skipped, their credits refunded. Left out of the answer when there are none.
One entry per sheet, in page order: present from the start, each waiting until the file is split.
One sheet of a job, as the job lists it: where it stands, and where its values are.
object
1 for the file’s first page.
Where the sheet is.
Whether a read sheet’s values can be used as delivered.
autoAccepted: Every value cleared the confidence threshold and nothing asked for a person’s look - a value the drawing does not print among them, settled as not printed (notPrinted), and a company name not found (notFound).needsReview: At least one value, or the sheet as a whole, needs a person to look.reviewed: A person has accepted or corrected every value that needed it.
The version of SpecCapture’s reading engine (ev1-...) that read the sheet; null until it has been read.
When the sheet was read, or failed; null until then.
Where the sheet’s values are: GET /v1/extractions/{jobId}/sheets/{sheetNumber}.
True when the sheet’s own export-control marking (titleBlock.exportControlMarking) names an export control: controlledMarking says which. SpecCapture takes no export-controlled drawings, so the workspace is warned to delete it unless it is sure it is not controlled. A flag only: the sheet was read, and nothing about its values or review changes.
The control the marking names: Distribution Statement B to Distribution Statement F (or the old Distribution Statement X), ITAR, EAR, CUI, NOFORN, FOUO or export-restricted (a warning that the drawing’s export is restricted); null when markedControlled is false.
The decision to keep a drawing that has a sheet marked export-controlled: the workspace’s owner or an admin said, in the dashboard, that it is not controlled and may stay. It stands for the whole document, and once made it is not made again. A sheet so kept may be shared outside the workspace again.
object
When it was kept.
Who kept it, as the workspace’s people list names them; null once they have left the workspace.
Why it may stay, in the words of the person who kept it.
While the sheet is held: where to POST to read it anyway, its held credits spent once it is read. Left out otherwise.
While the sheet is held: where to POST to skip it, its credits refunded. Left out otherwise.
When the file was accepted.
When anything about the job last changed.
When its last sheet finished, or the job failed; null until then.
Why the job failed, in words for a person; null unless status is failed.
Always false: there are no test keys and no test mode, so every job reads its drawing and is charged for it.
When the workspace’s retention period removed the drawing - the uploaded file, its page images and every value’s box - so every box is null from then on and a view link is refused; null while the drawing is kept. The values, their review and the exports stay.
What the workspace calls the job’s template now (“ERP import”); null for drawing.
Examples
A finished job: both sheets read, one waiting for a person to look
{ "jobId": "7c9e6679-7425-40de-944b-e07fc1f90ae7", "status": "completed", "fileName": "bracket.pdf", "fileSizeBytes": 482113, "fileSha256": "5c7e180a7bc5a50d1300976a9400df057e7324a7e416eddfaeacec87967fed9f", "templateId": "c2b8f3a1-7e5d-4c9a-8f6b-1a2d3e4f5a6b", "templateVersion": 3, "sheetCount": 2, "credits": { "perSheet": 4, "reserved": 8, "spent": 8, "refunded": 0, "held": 0 }, "progress": { "sheetsCompleted": 2, "sheetsFailed": 0, "sheetsNeedingReview": 1 }, "sheets": [ { "sheetNumber": 1, "status": "completed", "reviewState": "needsReview", "engineVersion": "ev1-85b79e6519c05a40", "completedAt": "2026-10-14T09:31:05+00:00", "resultUrl": "/v1/extractions/7c9e6679-7425-40de-944b-e07fc1f90ae7/sheets/1", "markedControlled": false, "controlledMarking": null, "controlledKept": null }, { "sheetNumber": 2, "status": "completed", "reviewState": "autoAccepted", "engineVersion": "ev1-85b79e6519c05a40", "completedAt": "2026-10-14T09:31:22+00:00", "resultUrl": "/v1/extractions/7c9e6679-7425-40de-944b-e07fc1f90ae7/sheets/2", "markedControlled": false, "controlledMarking": null, "controlledKept": null } ], "createdAt": "2026-10-14T09:30:12+00:00", "updatedAt": "2026-10-14T09:31:22+00:00", "completedAt": "2026-10-14T09:31:22+00:00", "failureReason": null, "testMode": false, "drawingPurgedAt": null, "templateName": "ERP import"}A job being read: its first sheet read, its second being read now
{ "jobId": "7c9e6679-7425-40de-944b-e07fc1f90ae7", "status": "extracting", "fileName": "bracket.pdf", "fileSizeBytes": 482113, "fileSha256": "5c7e180a7bc5a50d1300976a9400df057e7324a7e416eddfaeacec87967fed9f", "templateId": "c2b8f3a1-7e5d-4c9a-8f6b-1a2d3e4f5a6b", "templateVersion": 3, "sheetCount": 2, "credits": { "perSheet": 4, "reserved": 8, "spent": 4, "refunded": 0, "held": 4 }, "progress": { "sheetsCompleted": 1, "sheetsFailed": 0, "sheetsNeedingReview": 1 }, "sheets": [ { "sheetNumber": 1, "status": "completed", "reviewState": "needsReview", "engineVersion": "ev1-85b79e6519c05a40", "completedAt": "2026-10-14T09:31:05+00:00", "resultUrl": "/v1/extractions/7c9e6679-7425-40de-944b-e07fc1f90ae7/sheets/1", "markedControlled": false, "controlledMarking": null, "controlledKept": null }, { "sheetNumber": 2, "status": "running", "reviewState": null, "engineVersion": null, "completedAt": null, "resultUrl": "/v1/extractions/7c9e6679-7425-40de-944b-e07fc1f90ae7/sheets/2", "markedControlled": false, "controlledMarking": null, "controlledKept": null } ], "createdAt": "2026-10-14T09:30:12+00:00", "updatedAt": "2026-10-14T09:31:05+00:00", "completedAt": null, "failureReason": null, "testMode": false, "drawingPurgedAt": null, "templateName": "ERP import"}A finished job whose second page does not look like a drawing: held, not read, its 4 credits held for a choice
{ "jobId": "7c9e6679-7425-40de-944b-e07fc1f90ae7", "status": "completed", "fileName": "bracket.pdf", "fileSizeBytes": 482113, "fileSha256": "5c7e180a7bc5a50d1300976a9400df057e7324a7e416eddfaeacec87967fed9f", "templateId": "c2b8f3a1-7e5d-4c9a-8f6b-1a2d3e4f5a6b", "templateVersion": 3, "sheetCount": 2, "credits": { "perSheet": 4, "reserved": 8, "spent": 4, "refunded": 0, "held": 4 }, "progress": { "sheetsCompleted": 1, "sheetsFailed": 0, "sheetsNeedingReview": 1, "sheetsHeld": 1 }, "sheets": [ { "sheetNumber": 1, "status": "completed", "reviewState": "needsReview", "engineVersion": "ev1-85b79e6519c05a40", "completedAt": "2026-10-14T09:31:05+00:00", "resultUrl": "/v1/extractions/7c9e6679-7425-40de-944b-e07fc1f90ae7/sheets/1", "markedControlled": false, "controlledMarking": null, "controlledKept": null }, { "sheetNumber": 2, "status": "held", "reviewState": null, "engineVersion": null, "completedAt": "2026-10-14T09:31:22+00:00", "resultUrl": "/v1/extractions/7c9e6679-7425-40de-944b-e07fc1f90ae7/sheets/2", "markedControlled": false, "controlledMarking": null, "controlledKept": null, "heldBecause": "notADrawing", "readAnywayUrl": "/v1/extractions/7c9e6679-7425-40de-944b-e07fc1f90ae7/sheets/2/read-anyway", "skipUrl": "/v1/extractions/7c9e6679-7425-40de-944b-e07fc1f90ae7/sheets/2/skip" } ], "createdAt": "2026-10-14T09:30:12+00:00", "updatedAt": "2026-10-14T09:31:22+00:00", "completedAt": "2026-10-14T09:31:22+00:00", "failureReason": null, "testMode": false, "drawingPurgedAt": null, "templateName": "ERP import"}Not Found: a problem with a stable code. See Errors for every code and what to do about it.
Every error: a problem with a stable code. https://speccapture.com/docs/api/errors lists every code.
object
A link to the code’s entry in the docs.
What went wrong, in a few words for a person: the same for every problem with this code.
The HTTP status of the answer.
What went wrong with this request and what to do about it, in a sentence or two for a person. Present on nearly every problem.
The path of the request that was refused.
What went wrong, as a stable code to branch on: a published code never changes meaning.
This request’s trace: quote it when asking for help.
Examples
Not found.
{ "type": "https://speccapture.com/docs/api/errors#not_found", "title": "Not found.", "status": 404, "detail": "There is no extraction with this id, or this sheet, in your workspace.", "instance": "/v1/extractions/7c9e6679-7425-40de-944b-e07fc1f90ae7", "code": "not_found", "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"}