Read a held sheet anyway
#!/usr/bin/env bashset -euo pipefailAPI=https://api.speccapture.comAUTH="Authorization: Bearer $SPECCAPTURE_API_KEY"
JOB_ID=7c9e6679-7425-40de-944b-e07fc1f90ae7 # the jobId the submission answered withSHEET_NUMBER=1 # which sheet: 1 is the first page
job=$(curl -sS --fail-with-body -X POST "$API/v1/extractions/$JOB_ID/sheets/$SHEET_NUMBER/read-anyway" \ -H "$AUTH") || { echo "$job" >&2; exit 1; }jq -r '"Job \(.jobId) is \(.status) again: the page is read from the credits it holds"' <<<"$job"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 withstring sheetNumber = args[1]; // which sheet: 1 is the first page
JsonElement job = await Json(await Call(HttpMethod.Post, $"/v1/extractions/{jobId}/sheets/{sheetNumber}/read-anyway"));Console.WriteLine($"Job {job.GetProperty("jobId")} is {job.GetProperty("status")} again: the page is read from the credits it holds");
// 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 withsheet_number = sys.argv[2] # which sheet: 1 is the first page
job = call("POST", f"/v1/extractions/{job_id}/sheets/{sheet_number}/read-anyway").json()print(f"Job {job['jobId']} is {job['status']} again: the page is read from the credits it holds")const API = "https://api.speccapture.com";const headers = { Authorization: `Bearer ${process.env.SPECCAPTURE_API_KEY}` };
const [jobId, sheetNumber] = process.argv.slice(2); // the jobId the submission answered with; which sheet: 1 is the first page
const job = await call("POST", `/v1/extractions/${jobId}/sheets/${sheetNumber}/read-anyway`).then((response) => response.json());console.log(`Job ${job.jobId} is ${job.status} again: the page is read from the credits it holds`);
// 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;}A sheet whose page does not look like an engineering drawing - a letter, a datasheet, a photo, a blank page - is held before it is read: its status is held, heldBecause says why, and its 4 credits are held, not spent. This reads it anyway: it is queued and read like any sheet, its held credits spent once it is read (or refunded if it cannot be), and the job is extracting again until it is - then it completes again, and its webhook endpoints receive a new extraction.completed. Answers 200 with the job. 409 sheet_not_held when the sheet is not held (never held, or already read or skipped); 409 drawing_no_longer_kept when the workspace’s retention removed its drawing.
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.
Which sheet of the job: 1 for the file’s first page, up to the job’s sheetCount.
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
Sheet 2 read anyway: queued to be read from the credits it holds, the job extracting again until it is
{ "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": "queued", "reviewState": null, "engineVersion": null, "completedAt": null, "resultUrl": "/v1/extractions/7c9e6679-7425-40de-944b-e07fc1f90ae7/sheets/2", "markedControlled": false, "controlledMarking": null, "controlledKept": null, "heldBecause": "notADrawing" } ], "createdAt": "2026-10-14T09:30:12+00:00", "updatedAt": "2026-10-14T09:31:22+00:00", "completedAt": null, "failureReason": null, "testMode": false, "drawingPurgedAt": null, "templateName": "ERP import"}Forbidden: 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
This key's role does not allow this.
{ "type": "https://speccapture.com/docs/api/errors#role_not_allowed", "title": "This key's role does not allow this.", "status": 403, "detail": "This key acts with the member role of the person who created it, which cannot do this. Use a key created by the workspace's owner or an admin.", "instance": "/v1/extractions/7c9e6679-7425-40de-944b-e07fc1f90ae7/sheets/2/read-anyway", "code": "role_not_allowed", "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01", "keyRole": "member"}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/sheets/3/read-anyway", "code": "not_found", "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"}Conflict: 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
This sheet is not held.
{ "type": "https://speccapture.com/docs/api/errors#sheet_not_held", "title": "This sheet is not held.", "status": 409, "detail": "This page isn't held any more: someone has already read it anyway or skipped it.", "instance": "/v1/extractions/7c9e6679-7425-40de-944b-e07fc1f90ae7/sheets/2/read-anyway", "code": "sheet_not_held", "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"}This sheet's drawing is no longer kept.
{ "type": "https://speccapture.com/docs/api/errors#drawing_no_longer_kept", "title": "This sheet's drawing is no longer kept.", "status": 409, "detail": "This document's drawing is no longer kept (your workspace's retention setting), so the page can't be read now. Upload it again to read it.", "instance": "/v1/extractions/7c9e6679-7425-40de-944b-e07fc1f90ae7/sheets/2/read-anyway", "code": "drawing_no_longer_kept", "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"}