Send extractions to a teammate to check
#!/usr/bin/env bashset -euo pipefailAPI=https://api.speccapture.comAUTH="Authorization: Bearer $SPECCAPTURE_API_KEY"
sent=$(curl -sS --fail-with-body "$API/v1/review-assignments" \ -H "$AUTH" \ -H "Content-Type: application/json" \ -d '{"extractionIds":["7c9e6679-7425-40de-944b-e07fc1f90ae7","1b4e28ba-2fa1-41d2-883f-0016d3cca427"],"assigneeEmail":"sam.okafor@northfield.example","message":"Line 3 needs these before Thursday.","dueOn":"2026-10-22"}') || { echo "$sent" >&2; exit 1; }
jq -r '.data[] as $assignment | "\($assignment.fileName) is with \($assignment.assignee.name): \($assignment.assignmentId)"' <<<"$sent"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 { ["extractionIds"] = new JsonArray("7c9e6679-7425-40de-944b-e07fc1f90ae7", "1b4e28ba-2fa1-41d2-883f-0016d3cca427"), ["assigneeEmail"] = "sam.okafor@northfield.example", ["message"] = "Line 3 needs these before Thursday.", ["dueOn"] = "2026-10-22",}.ToJsonString(), Encoding.UTF8, "application/json");JsonElement sent = await Json(await Call(HttpMethod.Post, "/v1/review-assignments", body));
foreach (JsonElement assignment in sent.GetProperty("data").EnumerateArray()) { Console.WriteLine($"{assignment.GetProperty("fileName")} is with {assignment.GetProperty("assignee").GetProperty("name")}: {assignment.GetProperty("assignmentId")}");}
// 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
sent = call( "POST", "/v1/review-assignments", json={"extractionIds": ["7c9e6679-7425-40de-944b-e07fc1f90ae7", "1b4e28ba-2fa1-41d2-883f-0016d3cca427"], "assigneeEmail": "sam.okafor@northfield.example", "message": "Line 3 needs these before Thursday.", "dueOn": "2026-10-22"},).json()
for assignment in sent["data"]: print(f"{assignment['fileName']} is with {assignment['assignee']['name']}: {assignment['assignmentId']}")const API = "https://api.speccapture.com";const headers = { Authorization: `Bearer ${process.env.SPECCAPTURE_API_KEY}` };
const sent = await call("POST", "/v1/review-assignments", { body: JSON.stringify({ extractionIds: ["7c9e6679-7425-40de-944b-e07fc1f90ae7", "1b4e28ba-2fa1-41d2-883f-0016d3cca427"], assigneeEmail: "sam.okafor@northfield.example", message: "Line 3 needs these before Thursday.", dueOn: "2026-10-22" }), headers: { "Content-Type": "application/json" },}).then((response) => response.json());
for (const assignment of sent.data) { console.log(`${assignment.fileName} is with ${assignment.assignee.name}: ${assignment.assignmentId}`);}
// 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;}Each extraction named in extractionIds (1 to 200; an id named twice is sent once) becomes the job of the person assigneeEmail names - one of the workspace’s people, by the email GET /v1/workspace/members shows - to check: it waits for them under Assigned to you on the dashboard’s Review page, with their count beside Review, and with message and dueOn (YYYY-MM-DD) when given. One person at a time: an extraction already with someone moves to them, the earlier assignment listed as reassigned; one another key or person sent may be handed on only by a key acting as the owner or an admin (403 role_not_allowed). It locks nothing - anyone in the workspace may still check it - and closes by itself (status done) once nothing on it waits for a person, opening again for the same person if something on it comes to wait again. SpecCapture emails the person once for each request, within a minute or two, naming the extractions and linking to them on Review - for up to 50 requests a workspace’s keys make a day; past that, the extractions are still theirs on Review, with no email. Answers 201 with one assignment for each extraction, in the order named. All or nothing: an extraction with nothing left to check answers 409 nothing_to_review, naming it; one that is not the workspace’s, or an email that is not one of its people’s, 404 not_found. Costs no credits.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”The body of POST /v1/review-assignments: send extractions to one of the workspace’s people to check, as the dashboard’s Send for review sends drawings to a teammate. Each extraction becomes theirs to check, shown to them under Assigned to you on the dashboard’s Review page.
object
The extractions, 1 to 200 job ids, in the order they are to be listed; an id named twice is sent once. Each must have a sheet still waiting for a person.
Whom they go to: one of the workspace’s people, by the email GET /v1/workspace/members shows for them. Sending to the person something is already with sends it to them again.
A short note for them, up to 500 characters (“Line 3 needs these before Thursday”); left out, none.
The day they are wanted by, as YYYY-MM-DD, from today to a year ahead; left out, none.
Examples
Two extractions for one of the workspace's people, with a note and a day
{ "extractionIds": [ "7c9e6679-7425-40de-944b-e07fc1f90ae7", "1b4e28ba-2fa1-41d2-883f-0016d3cca427" ], "assigneeEmail": "sam.okafor@northfield.example", "message": "Line 3 needs these before Thursday.", "dueOn": "2026-10-22"}Responses
Section titled “Responses”Created
A page of the workspace’s review assignments, newest first: GET /v1/review-assignments; and what POST /v1/review-assignments made, one for each extraction in the order named, in one page.
object
The page’s assignments.
A review assignment: an extraction sent to one of the workspace’s people to check - through the API, or from the dashboard’s Review page. It locks nothing: anyone in the workspace may still check the extraction; the assignment says whose job it is. At most one is open per extraction.
object
What taking it back takes.
The extraction.
The extraction’s file name.
Whom it was sent to.
object
Their name as the workspace’s people list last knew them, else their email.
Their sign-in email, as GET /v1/workspace/members shows it.
Whether they are still one of the workspace’s people; an assignment to someone who left is shown to nobody in the dashboard.
Who sent it: one of the workspace’s people, or one of its API keys.
object
One of the workspace’s people, or one of its API keys.
The person’s name - else their email - as the workspace’s people list last knew them, kept after they leave; or the key’s name. Null when nothing names them.
The note sent with it; null when there was none.
The day it is wanted by, YYYY-MM-DD; null when none was chosen.
Where it stands.
When it was sent.
When it was done, handed on or taken back; null while it is open.
When it last opened again by itself, something on the extraction waiting again after it was done; null if it never has.
How many of the extraction’s sheets wait for a person now.
Whether more assignments follow this page.
Send as cursor for the page after this one; null when there is none.
Examples
Two extractions sent to one of the workspace's people, wanted by a Thursday
{ "data": [ { "assignmentId": "d7e9f1a3-5b6c-4d8e-9f0a-1b3c5d7e9f2a", "jobId": "7c9e6679-7425-40de-944b-e07fc1f90ae7", "fileName": "bracket.pdf", "assignee": { "name": "Sam Okafor", "email": "sam.okafor@northfield.example", "inWorkspace": true }, "assignedBy": { "kind": "apiKey", "name": "ERP import" }, "message": "Line 3 needs these before Thursday.", "dueOn": "2026-10-22", "status": "open", "createdAt": "2026-10-15T10:20:00+00:00", "closedAt": null, "reopenedAt": null, "sheetsWaiting": 2 }, { "assignmentId": "a3c5e7f9-1b2d-4f6a-8c0e-2d4f6a8c0e1b", "jobId": "1b4e28ba-2fa1-41d2-883f-0016d3cca427", "fileName": "mounting-plate.pdf", "assignee": { "name": "Sam Okafor", "email": "sam.okafor@northfield.example", "inWorkspace": true }, "assignedBy": { "kind": "apiKey", "name": "ERP import" }, "message": "Line 3 needs these before Thursday.", "dueOn": "2026-10-22", "status": "open", "createdAt": "2026-10-15T10:20:00+00:00", "closedAt": null, "reopenedAt": null, "sheetsWaiting": 1 } ], "hasMore": false, "nextCursor": null}Bad Request: 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
The request is not valid.
{ "type": "https://speccapture.com/docs/api/errors#invalid_request", "title": "The request is not valid.", "status": 400, "detail": "assigneeEmail is whom to send them to: the email GET /v1/workspace/members shows for one of the workspace's people.", "instance": "/v1/review-assignments", "code": "invalid_request", "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"}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": "bracket.pdf was sent to someone by another person: only they, the owner or an admin can send it to someone else.", "instance": "/v1/review-assignments", "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": "assigneeEmail is not one of the workspace's people: GET /v1/workspace/members lists them, and the dashboard's People page invites someone.", "instance": "/v1/review-assignments", "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
Nothing on this extraction waits for a person.
{ "type": "https://speccapture.com/docs/api/errors#nothing_to_review", "title": "Nothing on this extraction waits for a person.", "status": 409, "detail": "mounting-plate.pdf has nothing left to check, so there is nothing to send.", "instance": "/v1/review-assignments", "code": "nothing_to_review", "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"}