List the workspace's templates
#!/usr/bin/env bashset -euo pipefailAPI=https://api.speccapture.comAUTH="Authorization: Bearer $SPECCAPTURE_API_KEY"
templateList=$(curl -sS --fail-with-body "$API/v1/templates" \ -H "$AUTH") || { echo "$templateList" >&2; exit 1; }jq -r '"A job naming no template is delivered with \(.defaultTemplateId)"' <<<"$templateList"
jq -r '.templates[] as $template | "\($template.templateId) \($template.name), version \($template.version)"' <<<"$templateList"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"));
JsonElement templateList = await Json(await Call(HttpMethod.Get, "/v1/templates"));Console.WriteLine($"A job naming no template is delivered with {templateList.GetProperty("defaultTemplateId")}");
foreach (JsonElement template in templateList.GetProperty("templates").EnumerateArray()) { Console.WriteLine($"{template.GetProperty("templateId")} {template.GetProperty("name")}, version {template.GetProperty("version")}");}
// 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
template_list = call("GET", "/v1/templates").json()print(f"A job naming no template is delivered with {template_list['defaultTemplateId']}")
for template in template_list["templates"]: print(f"{template['templateId']} {template['name']}, version {template['version']}")const API = "https://api.speccapture.com";const headers = { Authorization: `Bearer ${process.env.SPECCAPTURE_API_KEY}` };
const templateList = await call("GET", "/v1/templates").then((response) => response.json());console.log(`A job naming no template is delivered with ${templateList.defaultTemplateId}`);
for (const template of templateList.templates) { console.log(`${template.templateId} ${template.name}, version ${template.version}`);}
// 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 standard template (templateId drawing: every field and table SpecCapture reads, under its standard names, but the sizes and counts, the material form and the general notes, which only a template that keeps them delivers) comes first and is always there; then each template the workspace made in the dashboard, by name, with its newest version. defaultTemplateId is what POST /v1/extractions uses when it names no templateId.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”OK
The workspace’s templates: GET /v1/templates. The standard template, drawing, comes first and is always there; then each of the workspace’s own, by name. Every template reads a drawing the same way - the whole standard template - and decides which values a job keeps, what each is called and in what order.
object
What POST /v1/extractions uses when it names no template: one of these ids.
The standard template first, then the workspace’s own by name.
One template in the list.
object
drawing for the standard template; a GUID for one of the workspace’s own.
What the workspace calls it; “Standard” for drawing.
Its newest published version: what a submission naming it, and no version, is delivered with.
What a submission naming no template is delivered with.
speccapture for the standard template, workspace for the workspace’s own.
When its newest version was published; null for the standard template.
Where its fields are: GET /v1/templates/{templateId}.
Examples
The standard template, and the workspace's own, which is its default
{ "defaultTemplateId": "c2b8f3a1-7e5d-4c9a-8f6b-1a2d3e4f5a6b", "templates": [ { "templateId": "drawing", "name": "Standard", "version": 1, "isDefault": false, "definedBy": "speccapture", "updatedAt": null, "url": "/v1/templates/drawing" }, { "templateId": "c2b8f3a1-7e5d-4c9a-8f6b-1a2d3e4f5a6b", "name": "ERP import", "version": 3, "isDefault": true, "definedBy": "workspace", "updatedAt": "2026-10-02T15:04:00+00:00", "url": "/v1/templates/c2b8f3a1-7e5d-4c9a-8f6b-1a2d3e4f5a6b" } ]}