Exports
GET /v1/extractions/{jobId}/export?format=json|csv|xlsx downloads a finished job’s values as one file.
format is json when left out.
#!/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 with
curl -sS --fail-with-body "$API/v1/extractions/$JOB_ID/export?format=xlsx" \ -H "$AUTH" \ -o extraction.xlsxcurl -sS --fail-with-body "$API/v1/extractions/$JOB_ID/export?format=csv" \ -H "$AUTH" \ -o extraction-csv.zipcurl -sS --fail-with-body "$API/v1/extractions/$JOB_ID/export?format=json" \ -H "$AUTH" \ -o extraction.jsonecho "Saved extraction.xlsx, extraction-csv.zip and extraction.json"Save as export.sh, set SPECCAPTURE_API_KEY, and run: bash export.sh. Needs curl; scripts also use bash and jq.
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 xlsxDownload = await Call(HttpMethod.Get, $"/v1/extractions/{jobId}/export?format=xlsx");await File.WriteAllBytesAsync("extraction.xlsx", await xlsxDownload.Content.ReadAsByteArrayAsync());HttpResponseMessage csvDownload = await Call(HttpMethod.Get, $"/v1/extractions/{jobId}/export?format=csv");await File.WriteAllBytesAsync("extraction-csv.zip", await csvDownload.Content.ReadAsByteArrayAsync());HttpResponseMessage jsonDownload = await Call(HttpMethod.Get, $"/v1/extractions/{jobId}/export?format=json");await File.WriteAllBytesAsync("extraction.json", await jsonDownload.Content.ReadAsByteArrayAsync());Console.WriteLine("Saved extraction.xlsx, extraction-csv.zip and extraction.json");
// 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;Save as export.cs, set SPECCAPTURE_API_KEY, and run: dotnet run export.cs -- 7c9e6679-7425-40de-944b-e07fc1f90ae7. Needs .NET 10 or later.
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
with open("extraction.xlsx", "wb") as download: download.write(call("GET", f"/v1/extractions/{job_id}/export?format=xlsx").content)with open("extraction-csv.zip", "wb") as download: download.write(call("GET", f"/v1/extractions/{job_id}/export?format=csv").content)with open("extraction.json", "wb") as download: download.write(call("GET", f"/v1/extractions/{job_id}/export?format=json").content)print("Saved extraction.xlsx, extraction-csv.zip and extraction.json")Save as export.py, set SPECCAPTURE_API_KEY, and run: python export.py 7c9e6679-7425-40de-944b-e07fc1f90ae7. Needs Python 3.9+ and requests (pip install requests).
import { writeFile } from "node:fs/promises";
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
const xlsxDownload = await call("GET", `/v1/extractions/${jobId}/export?format=xlsx`);await writeFile("extraction.xlsx", Buffer.from(await xlsxDownload.arrayBuffer()));const csvDownload = await call("GET", `/v1/extractions/${jobId}/export?format=csv`);await writeFile("extraction-csv.zip", Buffer.from(await csvDownload.arrayBuffer()));const jsonDownload = await call("GET", `/v1/extractions/${jobId}/export?format=json`);await writeFile("extraction.json", Buffer.from(await jsonDownload.arrayBuffer()));console.log("Saved extraction.xlsx, extraction-csv.zip and extraction.json");
// 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;}Save as export.mjs, set SPECCAPTURE_API_KEY, and run: node export.mjs 7c9e6679-7425-40de-944b-e07fc1f90ae7. Needs Node.js 20 or later.
format |
Content type | Saved as | What it holds |
|---|---|---|---|
json |
application/json |
{upload name}-extraction.json |
When the job’s template lays its JSON out flat or nested: formatVersion (1), workspace, exportedAt, then exactly what GET /v1/extractions/{jobId}/values answers. When its JSON is complete - the standard template’s, and every template’s that never chose - formatVersion (1), workspace, exportedAt, job - exactly what GET /v1/extractions/{jobId} answers - and sheets, each exactly what GET .../sheets/{n} answers. Indented UTF-8; ± and ° are written as themselves. |
csv |
application/zip |
{upload name}-extraction-csv.zip |
sheets.csv (one row per sheet) or values.csv (one row per value), as the template chooses, one file per table type named by its path (revisionHistory.csv, bom.csv, holeTable.csv, application.csv, dashNumbers.csv) and generalNotes.csv (empty for a job read with the standard template, which leaves the notes out: below). |
xlsx |
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
{upload name}-extraction.xlsx |
A Cover tab (workspace, job, file, template, status, engine version, export time, how to read it), Sheets or Values, a tab per table type (named by the template: Revision History, Bill of Materials, …) and the notes (empty for a job read with the standard template, as the CSV’s). |
The template decides what the files hold (its output): plain values, or each value with the
extras the template carries. Every template reads the drawing the same way; its output decides only how its values are
delivered. A job keeps the template version it was uploaded with, so its files keep their layout.
What a download may choose
Section titled “What a download may choose”A template says what its files hold; a download picks the file, and may ask for every detail instead:
| Parameter | Values | What it chooses |
|---|---|---|
format |
json (when left out), csv, xlsx |
Which file. Every finished job has all three. |
content |
template (when left out), complete |
complete is every detail of what the job kept, whatever its template’s files hold: the JSON is the job and every sheet exactly as GET /v1/extractions/{jobId} and its sheets answer them, and the CSV and Excel files are laid out as the standard template’s are - each sheet’s status, engine version and completion time, and beside every value what was read, its review state and its confidence - over the job’s own fields, under its template’s names and in its order. |
keys |
names, paths |
The keys of a JSON file in the template’s shape, as on /values; the template’s own when left out. The complete answer carries both each value’s path and its name, so keys changes nothing there, nor in the CSV and Excel files. |
#!/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 with
curl -sS --fail-with-body "$API/v1/extractions/$JOB_ID/export?format=xlsx&content=complete" \ -H "$AUTH" \ -o extraction-complete.xlsxcurl -sS --fail-with-body "$API/v1/extractions/$JOB_ID/export?format=json&keys=paths" \ -H "$AUTH" \ -o extraction-by-paths.jsonecho "Saved extraction-complete.xlsx (every detail) and extraction-by-paths.json (keyed by SpecCapture's paths)"Save as export_every_detail.sh, set SPECCAPTURE_API_KEY, and run: bash export_every_detail.sh. Needs curl; scripts also use bash and jq.
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 xlsxDownload = await Call(HttpMethod.Get, $"/v1/extractions/{jobId}/export?format=xlsx&content=complete");await File.WriteAllBytesAsync("extraction-complete.xlsx", await xlsxDownload.Content.ReadAsByteArrayAsync());HttpResponseMessage jsonDownload = await Call(HttpMethod.Get, $"/v1/extractions/{jobId}/export?format=json&keys=paths");await File.WriteAllBytesAsync("extraction-by-paths.json", await jsonDownload.Content.ReadAsByteArrayAsync());Console.WriteLine("Saved extraction-complete.xlsx (every detail) and extraction-by-paths.json (keyed by SpecCapture's paths)");
// 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;Save as export_every_detail.cs, set SPECCAPTURE_API_KEY, and run: dotnet run export_every_detail.cs -- 7c9e6679-7425-40de-944b-e07fc1f90ae7. Needs .NET 10 or later.
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
with open("extraction-complete.xlsx", "wb") as download: download.write(call("GET", f"/v1/extractions/{job_id}/export?format=xlsx&content=complete").content)with open("extraction-by-paths.json", "wb") as download: download.write(call("GET", f"/v1/extractions/{job_id}/export?format=json&keys=paths").content)print("Saved extraction-complete.xlsx (every detail) and extraction-by-paths.json (keyed by SpecCapture's paths)")Save as export_every_detail.py, set SPECCAPTURE_API_KEY, and run: python export_every_detail.py 7c9e6679-7425-40de-944b-e07fc1f90ae7. Needs Python 3.9+ and requests (pip install requests).
import { writeFile } from "node:fs/promises";
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
const xlsxDownload = await call("GET", `/v1/extractions/${jobId}/export?format=xlsx&content=complete`);await writeFile("extraction-complete.xlsx", Buffer.from(await xlsxDownload.arrayBuffer()));const jsonDownload = await call("GET", `/v1/extractions/${jobId}/export?format=json&keys=paths`);await writeFile("extraction-by-paths.json", Buffer.from(await jsonDownload.arrayBuffer()));console.log("Saved extraction-complete.xlsx (every detail) and extraction-by-paths.json (keyed by SpecCapture's paths)");
// 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;}Save as export_every_detail.mjs, set SPECCAPTURE_API_KEY, and run: node export_every_detail.mjs 7c9e6679-7425-40de-944b-e07fc1f90ae7. Needs Node.js 20 or later.
- Never a field the job did not keep. What a job keeps is decided when it is uploaded, by its template: a field the
template leaves out is not stored, and no download brings it back. For every field, sizes and counts included,
upload with a template that keeps them all; the standard template (
templateIddrawing) keeps every field but those. - Never a waiting value left blank. With every detail, a value still waiting for a person is there with
needsReviewbeside it, so check those before you rely on them. - Made afresh, never stored. Every detail is made from the values as they stand when it is asked for, and saved as
{upload name}-extraction-complete.json,-extraction-complete-csv.zipor-extraction-complete.xlsx. The files SpecCapture keeps for a finished job are always its template’s, so a download withoutcontentis the file it always was. - The links a webhook carries (
data.exports) take the same parameters: add&content=completeor&keys=pathsto the link you follow. - A
contentorkeysthe API does not know is400 invalid_request.
The CSV is always a zip, even for a job whose drawings print no table: a program reading it finds the
same files every time, and a table no sheet printed is a file with its heading row only. Each file is
RFC 4180 (comma-separated, CRLF, a field quoted when it holds a comma, a quote or a line break) in UTF-8
with a byte-order mark, so Excel reads it as UTF-8. Times are ISO 8601 in UTC (2026-10-12T09:01:00Z).
Columns. The Sheets file and tab have Sheet, then - when the template carries each sheet’s details -
Sheet status, then Sheet review, then with the details Engine version and Completed at, then every
single-valued field the job’s template keeps, in its order, headed by its names (Part Number,
Drawing Number, …, or the workspace’s own). A table or the notes a template of yours leaves out has no file or tab;
the standard template keeps its notes file and tab, empty (below). A
table’s file and tab have Sheet, Sheet review, Row (1 for the table’s first row: the API’s rowIndex + 1),
then the template’s columns. Every column is there whether or not the job has a value for it, so the files’ shape
depends on the template, never on what one drawing printed; a value at a path the template does not name gets a
column of its own after the template’s, headed by its path, so nothing read is ever dropped.
Each value is its column, then the extras the template carries, in this order: the value as it stands (a
reviewer’s correction when there is one); - as read, what the engine read, filled only beside a correction;
- review (autoAccepted, needsReview, accepted, corrected); - confidence (0 to 1; empty for a general
note, which is not scored, and beside a correction); - box (the box’s left, top, right and bottom as fractions of
the page, 0.6367,0.8016,0.6698,0.8248), with - match on sheet beside it (the API’s matchOnSheet: exact,
approximate, noMatch, tooShortToLookFor, nothingRead or workedOut; Where a value was found on the
sheet); and - quote (the text it was read from). Without the review state, a
value still waiting for a person is left blank (shaded amber in the workbook) and its heading is named in a last
column, Waiting for review, so nothing unchecked is imported as final; with it, the value is there and its state
beside it. Either way a value waiting for review is never exported as if it were final. The notes are
generalNotes.csv and their tab: one row per note, sheet by sheet in printed order, under Note, the whole note as
it stands. Before it, Note number is the number the note is printed with (a whole number in the workbook), read as a
note’s number is in Tables and never counted: empty for a note printed with none, and for one left blank
while it waits. A job read with the standard template keeps the file and the tab with no rows, since 2026-10-21: the
standard template leaves the notes out until a workspace turns them on, and the file and tab stay so the files have the
same shape when they are, and an import built on them keeps working. The workbook’s cover says why the tab is empty.
One row per value. A template whose spreadsheetRows is perValue has values.csv and a Values tab in place of
the Sheets file: one row for each field it keeps on each sheet - Sheet, Sheet review, Field (its name), Key
(its path), Value, the extras, and Waiting for review (Yes beside a value left blank) - given or not, so an import
that takes one value a row sees every field. Tables and notes keep their own files.
The standard template, and every template made before these choices keep the layout they always had: the standard template’s files carry each sheet’s details, what was read, the review state and the confidence - four columns a value - and a template that chose values only has one column per field.
In the workbook, values are always text (1:2 stays a scale, 0012 keeps
its zeros, nothing is run as a formula), confidences are numbers, every tab has a frozen, filterable
heading row, a value waiting for review is shaded amber and a correction blue. In the CSV a value is
written exactly as the API returns it, except one a spreadsheet would run as a formula - it starts with
=, @, a tab, or a sign followed by more than a number, white space in front not counting - which gets a
leading apostrophe; an amount such as -, -.005 or +.002/-.000 is left alone. A field holding a semicolon is
quoted, as Excel separates fields with ; where the comma is the decimal mark.
Values only. A template that carries nothing beside a value - every template made in the dashboard starts so, for
an ERP import - has one column per field: Sheet, Sheet review, then each field under its name, then
Waiting for review. A corrected value is the correction. A table’s file is the same, row by row. No sheet is ever
left out. The workbook’s cover names the template and its version, and says what each column holds.
Always current. The file says what the API says at the moment it is asked: a value a reviewer corrected after
the job finished is exported corrected. Two downloads of the same values differ only in exportedAt (and the
cover’s export time). Answers carry Cache-Control: no-store.
From the dashboard. A document’s Export menu offers the same three files, named for what arrives: Excel,
CSV files (zip) and JSON, and Every detail…: a small dialog choosing the file, each with every detail, the same as
content=complete. One difference: a JSON file downloaded there names each sheet’s resultUrl as a full
address on the API (https://api.speccapture.com/v1/extractions/{jobId}/sheets/1), because a file kept away from
the API has nothing to resolve a path against; the API’s own download keeps the paths its answers give. To download
many documents as one file, tick them on the Documents page - one by one, a whole page with the box above the list,
or, once a page is ticked, every finished document the search and filter match - and choose a format from the
selection bar’s Export menu - or Every detail… there, as on a document’s menu: the same file POST /v1/exports makes, up to
100 sheets. A document still being read cannot be ticked. A larger
selection, up to 5,000 sheets, is offered as “Prepare them as one file”:
SpecCapture makes it in the background, and it appears under Exports on the Documents page with a Download
button when it is ready, kept 7 days - the same export job POST /v1/exports
answers 202 with.
| Answer | When |
|---|---|
200 |
The job is completed or failed (a failed job exports its sheets with no values) |
400 invalid_request |
format is not json, csv or xlsx, content is not template or complete, or keys is not names or paths |
404 not_found |
No such job in the workspace - another workspace’s id answers the same |
409 not_finished |
The job is queued, splitting or extracting; the problem’s jobStatus says which |
Exporting many extractions at once
Section titled “Exporting many extractions at once”POST /v1/exports makes one file of many finished extractions - a week’s drawings for an ERP import, a project’s for
a drawing register. Send JSON naming the format and either the extractions or a filter:
{ "format": "xlsx", "extractionIds": ["6f1c2b3a-4d5e-4f60-8a71-92b3c4d5e6f7", "0b9e7f5d-3c2a-4e1b-9a8c-7d6e5f4a3b2c"] }{ "format": "csv", "filter": { "status": "completed", "createdAfter": "2026-10-01T00:00:00Z", "fileName": "bracket" } }extractionIds: 1 to 500 job ids, exported in the order named; an id named twice is exported once.filter: the narrowingGET /v1/extractionstakes -status(completedorfailed; both when left out),fileName(part of the file name, in any case),createdAfterandcreatedBefore(read exactly as that list reads them, but written as JSON: an offset as it is,2026-10-14T09:30:00+02:00, never%2B) - over the workspace’s finished extractions, newest first.{}is every finished extraction; a filter that matches none answers a file with headings and no rows.format:jsonwhen left out,csvorxlsx. Send exactly one ofextractionIdsandfilter.content:templatewhen left out, orcompletefor every detail - the CSV and Excel files in the full layout, what was read, the review state and the confidence beside every value and each sheet’s details, whatever the documents’ templates carry; never a field a document did not keep, and never a waiting value left blank. The JSON is the complete answer either way. Saved with-completeafter the date:speccapture-export-{date}-complete.xlsx.
#!/usr/bin/env bashset -euo pipefailAPI=https://api.speccapture.comAUTH="Authorization: Bearer $SPECCAPTURE_API_KEY"
status=$(curl -sS --fail-with-body "$API/v1/exports" \ -H "$AUTH" \ -H "Content-Type: application/json" \ -d '{"format":"xlsx","content":"complete","filter":{"status":"completed","createdAfter":"2026-10-01T00:00:00Z"}}' \ -o extractions-complete.xlsx \ -w '%{http_code}')if [[ $status == 202 ]]; then exportJob=$(cat extractions-complete.xlsx) && rm extractions-complete.xlsx jq -r '"Over 100 sheets: export \(.exportId) is \(.status). Follow it until it is ready, then download its file."' <<<"$exportJob"else echo "Saved extractions-complete.xlsx"fiSave as batch_export_every_detail.sh, set SPECCAPTURE_API_KEY, and run: bash batch_export_every_detail.sh. Needs curl; scripts also use bash and jq.
using System.Net;using System.Text;using System.Text.Json;using System.Text.Json.Nodes;
using HttpClient http = new() { BaseAddress = new Uri("https://api.speccapture.com") };http.DefaultRequestHeaders.Authorization = new("Bearer", Environment.GetEnvironmentVariable("SPECCAPTURE_API_KEY"));
StringContent body = new(new JsonObject { ["format"] = "xlsx", ["content"] = "complete", ["filter"] = new JsonObject { ["status"] = "completed", ["createdAfter"] = "2026-10-01T00:00:00Z" },}.ToJsonString(), Encoding.UTF8, "application/json");HttpResponseMessage response = await Call(HttpMethod.Post, "/v1/exports", body);if (response.StatusCode == HttpStatusCode.Accepted) { JsonElement exportJob = await Json(response); Console.WriteLine($"Over 100 sheets: export {exportJob.GetProperty("exportId")} is {exportJob.GetProperty("status")}. Follow it until it is ready, then download its file.");} else { await File.WriteAllBytesAsync("extractions-complete.xlsx", await response.Content.ReadAsByteArrayAsync()); Console.WriteLine("Saved extractions-complete.xlsx");}
// 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;Save as batch_export_every_detail.cs, set SPECCAPTURE_API_KEY, and run: dotnet run batch_export_every_detail.cs. Needs .NET 10 or later.
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
response = call( "POST", "/v1/exports", json={"format": "xlsx", "content": "complete", "filter": {"status": "completed", "createdAfter": "2026-10-01T00:00:00Z"}},)if response.status_code == 202: export_job = response.json() print(f"Over 100 sheets: export {export_job['exportId']} is {export_job['status']}. Follow it until it is ready, then download its file.")else: with open("extractions-complete.xlsx", "wb") as download: download.write(response.content) print("Saved extractions-complete.xlsx")Save as batch_export_every_detail.py, set SPECCAPTURE_API_KEY, and run: python batch_export_every_detail.py. Needs Python 3.9+ and requests (pip install requests).
import { writeFile } from "node:fs/promises";
const API = "https://api.speccapture.com";const headers = { Authorization: `Bearer ${process.env.SPECCAPTURE_API_KEY}` };
const response = await call("POST", "/v1/exports", { body: JSON.stringify({ format: "xlsx", content: "complete", filter: { status: "completed", createdAfter: "2026-10-01T00:00:00Z" } }), headers: { "Content-Type": "application/json" },});if (response.status === 202) { const exportJob = await response.json(); console.log(`Over 100 sheets: export ${exportJob.exportId} is ${exportJob.status}. Follow it until it is ready, then download its file.`);} else { await writeFile("extractions-complete.xlsx", Buffer.from(await response.arrayBuffer())); console.log("Saved extractions-complete.xlsx");}
// 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;}Save as batch_export_every_detail.mjs, set SPECCAPTURE_API_KEY, and run: node batch_export_every_detail.mjs. Needs Node.js 20 or later.
The answer is 200 with the file, saved as speccapture-export-{date}.json, speccapture-export-{date}-csv.zip or
speccapture-export-{date}.xlsx:
- JSON:
formatVersion(1),workspace,exportedAt,extractions- each exactly whatGET /v1/extractions/{jobId}answers - andsheets, each exactly whatGET .../sheets/{n}answers and naming itsjobId: extraction by extraction in the export’s order, each one’s sheets in page order. - CSV and XLSX: the files above, each row starting with its document:
Document(the uploaded file’s name) andExtraction idon every file and tab, andTemplate- the template it was uploaded with, “ERP import, version 3”, or “Standard” for the standard one, asGET /v1/templatesnames it - on the sheets. The workbook’s cover counts the documents and sheets and names their templates.
Documents uploaded with different templates share one column per field. A field’s path, such as
titleBlock.partNumber, is what a column is; a template decides only where it goes and what it is called. The first
document’s template gives its fields in its order, and each later template adds the fields it keeps that no earlier
one did, after them; tables and their columns combine the same way. A column is headed by every name its templates
give it, joined with “ / “ - Item number / Part Number - and a field a document’s template does not keep is empty
for that document, its review and confidence cells too. The CSV and Excel files carry what the documents’ templates
carry when every one lays its files out alike - the same extras, the same rows - and the full layout, nothing hidden,
otherwise, or when the request asks for content complete. With one template, the columns are exactly that template’s. A batch’s JSON is always the complete answer,
every extraction and sheet exactly as the API answers them, whatever the templates’ JSON.
Up to 100 sheets, the file comes back at once, built while you wait.
From 101 to 5,000 sheets, it is an export job: the answer is 202 with
the export and Location: /v1/exports/{exportId}, and SpecCapture makes the file in the background - a minute or two
for the largest. A selection holding more is refused with 422 export_too_large, whose sheetCount,
extractionCount and maximumSheets say by how much: name fewer extractions in each request, or split the filter by
createdAfter and createdBefore. Exporting reads values already read, and is never charged.
| Answer | When |
|---|---|
200 |
The file: up to 100 sheets |
202 |
An export job: 101 to 5,000 sheets. The body is the export (status queued); follow it as below |
400 invalid_request |
The body is not what the endpoint takes: neither or both of extractionIds and filter, more ids than it takes, a format, content or status it does not know, a time it cannot read; detail names it |
404 not_found |
A named extraction is not the workspace’s - another workspace’s id answers the same; extractionId names it |
409 not_finished |
A named extraction is still being read; extractionId and jobStatus say which and how far |
409 too_many_exports |
The workspace already has 5 exports waiting or being made; waitingCount and maximumWaiting say so. They are made one at a time: ask again once one is ready |
422 export_too_large |
The extractions hold more than 5,000 sheets |
Nothing is half-done: a request that cannot be answered in full is refused whole, before anything is read.
Following an export job
Section titled “Following an export job”What an export holds is decided when you ask: the extractions named, or every one the filter matched at that moment,
in that order. An extraction finished a moment later is not in it, and one deleted before the file is made is left out
and named in extractionsLeftOut (and on the workbook’s cover).
{ "exportId": "2b1e7c55-0c1a-4d2e-9b1f-6a4e2d8c9f31", "format": "xlsx", "content": "template", "status": "ready", "extractionCount": 412, "sheetCount": 1187, "createdAt": "2026-10-14T15:30:00.118Z", "createdBy": { "kind": "apiKey", "name": "ERP import" }, "completedAt": "2026-10-14T15:31:12.402Z", "expiresAt": "2026-10-21T15:31:12.402Z", "fileUrl": "/v1/exports/2b1e7c55-0c1a-4d2e-9b1f-6a4e2d8c9f31/file", "fileName": "speccapture-export-2026-10-14.xlsx", "fileSizeBytes": 2483301, "extractionsLeftOut": [], "problem": null}content: what the request asked the file to hold:template, orcompletefor every detail.status:queuedwhile it waits its turn - one export of a workspace is made at a time - thenbuilding, thenready.failedmeans it could not be made, andproblemsays why: ask for it again.expiredmeans its file was kept its 7 days and is gone; ask again for a new one.- Ask
GET /v1/exports/{exportId}until it isready, a few seconds apart - or add a webhook and wait for theexport.readyevent, whose body carries the export exactly as that read answers it (see Webhooks). - Download
GET /v1/exports/{exportId}/file- the same file a smaller export answers at once, saved asfileName- any time beforeexpiresAt, as often as you like. GET /v1/exportslists the workspace’s exports, newest first, whoever asked - through the API or in the dashboard - under the list convention (Lists and paging); an export stays listed 30 days.
GET /v1/exports/{exportId}/file |
When |
|---|---|
200 |
The file, while the export is ready |
404 not_found |
No such export in the workspace - another workspace’s id answers the same |
409 export_not_ready |
It is still queued or building, or it failed; exportStatus says which |
410 export_expired |
Its file was kept 7 days and has been deleted: ask for the export again |