Skip to content
API console (try a request with your own key)Get early access

Submit a drawing

POST
/v1/extractions
#!/usr/bin/env bash
set -euo pipefail
API=https://api.speccapture.com
AUTH="Authorization: Bearer $SPECCAPTURE_API_KEY"
DRAWING=bracket.pdf # the drawing to send: a PDF, TIFF, PNG, JPEG, BMP or WebP
job=$(curl -sS --fail-with-body "$API/v1/extractions" \
-H "$AUTH" \
-H "Idempotency-Key: $(openssl rand -hex 16)" \
-F "file=@$DRAWING") || { echo "$job" >&2; exit 1; }
jq -r '"Job \(.jobId) is \(.status): \(.sheetCount) sheets, \(.credits.reserved) credits reserved"' <<<"$job"

Accepts one PDF, TIFF, PNG, JPEG, BMP or WebP as multipart/form-data, in a part named ‘file’, reserves 4 credits per sheet and answers 202 with the job. One drawing a request: a form with a second ‘file’ part is refused whole with 400 invalid_request, so send each drawing in a request of its own. Optional form fields templateId (drawing, or an id from GET /v1/templates) and templateVersion choose which fields the job keeps, under which names and in which order; left out, the workspace’s default template. Every template reads the drawing the same way. An id the workspace does not have is 422 template_not_found, before anything is reserved. Send an Idempotency-Key to make retries safe: the same key with a different file or template is 409.

Idempotency-Key
string

Makes a retry safe: any unique string of 1 to 255 printable ASCII characters without spaces, such as a UUID. For 24 hours the same key with the same file answers with the job its first request made, marked Idempotent-Replayed: true; with a different file or template it is 409 idempotency_key_reused.

The drawing, as multipart/form-data: one part named ‘file’, one drawing a request.

Media typemultipart/form-data
object
file
required

A PDF, TIFF, PNG, JPEG, BMP or WebP, recognized from its bytes. Each page is a sheet; each sheet reserves 4 credits.

string format: binary
templateId

Optional: the template the job is delivered with - drawing (the standard template: every field but the sizes and counts and the material form) or a template id from GET /v1/templates. Left out, the workspace’s default.

string
templateVersion

Optional: a published version of templateId; its newest when left out.

integer format: int32

Accepted

Media typeapplication/json

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
jobId
required

The job’s id: what every other request about it names.

string format: uuid
status
required

Where the job is.

string
Allowed values: queued splitting extracting completed failed
fileName
required

The uploaded file’s name, as it was sent.

string
fileSizeBytes
required

The uploaded file’s size, in bytes.

integer format: int64
fileSha256
required

SHA-256 of the file’s bytes, lowercase hex.

string
templateId
required

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.

string
templateVersion
required

The version of the template the job keeps for good: 1 for drawing.

integer format: int32
sheetCount
required

The pages counted when the file was accepted; each is read, and billed, on its own.

integer format: int32
credits
required

What the job reserved, spent, refunded and still holds.

object
perSheet
required

What each sheet of this job costs, fixed when it was accepted.

integer format: int32
reserved
required

Reserved when the file was accepted: its sheets times perSheet.

integer format: int32
spent
required

Spent on sheets that were read.

integer format: int32
refunded
required

Returned for sheets, or a whole file, that could not be read, and for sheets skipped.

integer format: int32
held
required

Still reserved for sheets not yet finished, and for sheets held because they do not look like drawings.

integer format: int32
progress
required

How many of its sheets are read, how many failed, and how many need a person to look.

object
sheetsCompleted
required

Sheets read so far.

integer format: int32
sheetsFailed
required

Sheets that could not be read, their credits refunded.

integer format: int32
sheetsNeedingReview
required

Read sheets with at least one value waiting for a person to look.

integer format: int32
sheetsHeld

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.

integer format: int32
0
sheetsSkipped

Held sheets that were skipped, their credits refunded. Left out of the answer when there are none.

integer format: int32
0
sheets
required

One entry per sheet, in page order: present from the start, each waiting until the file is split.

Array<object>

One sheet of a job, as the job lists it: where it stands, and where its values are.

object
sheetNumber
required

1 for the file’s first page.

integer format: int32
status
required

Where the sheet is.

string
Allowed values: queued running completed failed held skipped
reviewState
required
One of:
null
engineVersion
required

The version of SpecCapture’s reading engine (ev1-...) that read the sheet; null until it has been read.

null | string
completedAt
required

When the sheet was read, or failed; null until then.

null | string format: date-time
resultUrl
required

Where the sheet’s values are: GET /v1/extractions/{jobId}/sheets/{sheetNumber}.

string
markedControlled

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.

boolean
controlledMarking

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.

null | string
controlledKept
One of:
null
turnedUpright
One of:
null
heldBecause
One of:
null
readAnywayUrl

While the sheet is held: where to POST to read it anyway, its held credits spent once it is read. Left out otherwise.

null | string
skipUrl

While the sheet is held: where to POST to skip it, its credits refunded. Left out otherwise.

null | string
createdAt
required

When the file was accepted.

string format: date-time
updatedAt
required

When anything about the job last changed.

string format: date-time
completedAt
required

When its last sheet finished, or the job failed; null until then.

null | string format: date-time
failureReason
required

Why the job failed, in words for a person; null unless status is failed.

null | string
testMode
required

Always false: there are no test keys and no test mode, so every job reads its drawing and is charged for it.

boolean
drawingPurgedAt

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.

null | string format: date-time
templateName

What the workspace calls the job’s template now (“ERP import”); null for drawing.

null | string

Examples

Exampleaccepted

The new job: 8 credits reserved for its 2 sheets, waiting to be split

{
"jobId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"status": "queued",
"fileName": "bracket.pdf",
"fileSizeBytes": 482113,
"fileSha256": "5c7e180a7bc5a50d1300976a9400df057e7324a7e416eddfaeacec87967fed9f",
"templateId": "c2b8f3a1-7e5d-4c9a-8f6b-1a2d3e4f5a6b",
"templateVersion": 3,
"sheetCount": 2,
"credits": {
"perSheet": 4,
"reserved": 8,
"spent": 0,
"refunded": 0,
"held": 8
},
"progress": {
"sheetsCompleted": 0,
"sheetsFailed": 0,
"sheetsNeedingReview": 0
},
"sheets": [
{
"sheetNumber": 1,
"status": "queued",
"reviewState": null,
"engineVersion": null,
"completedAt": null,
"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
}
],
"createdAt": "2026-10-14T09:30:12+00:00",
"updatedAt": "2026-10-14T09:30:12+00:00",
"completedAt": null,
"failureReason": null,
"testMode": false,
"drawingPurgedAt": null,
"templateName": "ERP import"
}

Bad Request: a problem with a stable code. See Errors for every code and what to do about it.

Media typeapplication/problem+json

Every error: a problem with a stable code. https://speccapture.com/docs/api/errors lists every code.

object
type
required

A link to the code’s entry in the docs.

string
title
required

What went wrong, in a few words for a person: the same for every problem with this code.

string
status
required

The HTTP status of the answer.

integer format: int32
detail

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.

string
instance
required

The path of the request that was refused.

string
code
required

What went wrong, as a stable code to branch on: a published code never changes meaning.

string
traceId
required

This request’s trace: quote it when asking for help.

string

Examples

The request has no file.

{
"type": "https://speccapture.com/docs/api/errors#file_missing",
"title": "The request has no file.",
"status": 400,
"detail": "The form has no part named 'file'. Send the drawing as -F \"file=@drawing.pdf\".",
"instance": "/v1/extractions",
"code": "file_missing",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
}

Unauthorized: a problem with a stable code. See Errors for every code and what to do about it.

Media typeapplication/problem+json

Every error: a problem with a stable code. https://speccapture.com/docs/api/errors lists every code.

object
type
required

A link to the code’s entry in the docs.

string
title
required

What went wrong, in a few words for a person: the same for every problem with this code.

string
status
required

The HTTP status of the answer.

integer format: int32
detail

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.

string
instance
required

The path of the request that was refused.

string
code
required

What went wrong, as a stable code to branch on: a published code never changes meaning.

string
traceId
required

This request’s trace: quote it when asking for help.

string

Examples

Exampleapi_key_invalid

The API key is not valid.

{
"type": "https://speccapture.com/docs/api/errors#api_key_invalid",
"title": "The API key is not valid.",
"status": 401,
"detail": "This key is unknown, revoked or expired, as every key of a workspace is once its deletion has been asked for. Create a new key in the dashboard (API keys).",
"instance": "/v1/extractions",
"code": "api_key_invalid",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
}

Payment Required: a problem with a stable code. See Errors for every code and what to do about it.

Media typeapplication/problem+json

Every error: a problem with a stable code. https://speccapture.com/docs/api/errors lists every code.

object
type
required

A link to the code’s entry in the docs.

string
title
required

What went wrong, in a few words for a person: the same for every problem with this code.

string
status
required

The HTTP status of the answer.

integer format: int32
detail

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.

string
instance
required

The path of the request that was refused.

string
code
required

What went wrong, as a stable code to branch on: a published code never changes meaning.

string
traceId
required

This request’s trace: quote it when asking for help.

string

Examples

Not enough credits.

{
"type": "https://speccapture.com/docs/api/errors#not_enough_credits",
"title": "Not enough credits.",
"status": 402,
"detail": "This file has 2 sheets, which needs 8 credits (4 a sheet), and the workspace has 5 available. Nothing was stored or reserved; add credits and send it again.",
"instance": "/v1/extractions",
"code": "not_enough_credits",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
"sheetCount": 2,
"creditsNeeded": 8,
"creditsAvailable": 5,
"sheetsRemaining": 1,
"upgradeUrl": "https://app.speccapture.com/billing"
}

Conflict: a problem with a stable code. See Errors for every code and what to do about it.

Media typeapplication/problem+json

Every error: a problem with a stable code. https://speccapture.com/docs/api/errors lists every code.

object
type
required

A link to the code’s entry in the docs.

string
title
required

What went wrong, in a few words for a person: the same for every problem with this code.

string
status
required

The HTTP status of the answer.

integer format: int32
detail

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.

string
instance
required

The path of the request that was refused.

string
code
required

What went wrong, as a stable code to branch on: a published code never changes meaning.

string
traceId
required

This request’s trace: quote it when asking for help.

string

Examples

This Idempotency-Key was used for a different request.

{
"type": "https://speccapture.com/docs/api/errors#idempotency_key_reused",
"title": "This Idempotency-Key was used for a different request.",
"status": 409,
"detail": "This Idempotency-Key was used in the last 24 hours for a different file or template. Send a new key for a new request.",
"instance": "/v1/extractions",
"code": "idempotency_key_reused",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
}

Payload Too Large: a problem with a stable code. See Errors for every code and what to do about it.

Media typeapplication/problem+json

Every error: a problem with a stable code. https://speccapture.com/docs/api/errors lists every code.

object
type
required

A link to the code’s entry in the docs.

string
title
required

What went wrong, in a few words for a person: the same for every problem with this code.

string
status
required

The HTTP status of the answer.

integer format: int32
detail

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.

string
instance
required

The path of the request that was refused.

string
code
required

What went wrong, as a stable code to branch on: a published code never changes meaning.

string
traceId
required

This request’s trace: quote it when asking for help.

string

Examples

Examplefile_too_large

The file is too large.

{
"type": "https://speccapture.com/docs/api/errors#file_too_large",
"title": "The file is too large.",
"status": 413,
"detail": "This file is larger than the 50 MB limit. Export the drawing at a lower resolution, or split it into smaller files.",
"instance": "/v1/extractions",
"code": "file_too_large",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
"maximumFileSizeMegabytes": 50
}

Unsupported Media Type: a problem with a stable code. See Errors for every code and what to do about it.

Media typeapplication/problem+json

Every error: a problem with a stable code. https://speccapture.com/docs/api/errors lists every code.

object
type
required

A link to the code’s entry in the docs.

string
title
required

What went wrong, in a few words for a person: the same for every problem with this code.

string
status
required

The HTTP status of the answer.

integer format: int32
detail

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.

string
instance
required

The path of the request that was refused.

string
code
required

What went wrong, as a stable code to branch on: a published code never changes meaning.

string
traceId
required

This request’s trace: quote it when asking for help.

string

Examples

Exampleunsupported_media_type

The request body is not a media type this endpoint takes.

{
"type": "https://speccapture.com/docs/api/errors#unsupported_media_type",
"title": "The request body is not a media type this endpoint takes.",
"status": 415,
"detail": "Send the drawing as multipart/form-data with the file in a part named 'file'.",
"instance": "/v1/extractions",
"code": "unsupported_media_type",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
}

Unprocessable Entity: a problem with a stable code. See Errors for every code and what to do about it.

Media typeapplication/problem+json

Every error: a problem with a stable code. https://speccapture.com/docs/api/errors lists every code.

object
type
required

A link to the code’s entry in the docs.

string
title
required

What went wrong, in a few words for a person: the same for every problem with this code.

string
status
required

The HTTP status of the answer.

integer format: int32
detail

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.

string
instance
required

The path of the request that was refused.

string
code
required

What went wrong, as a stable code to branch on: a published code never changes meaning.

string
traceId
required

This request’s trace: quote it when asking for help.

string

Examples

The file is not a drawing we can read (PDF, TIFF, PNG, JPEG, BMP or WebP).

{
"type": "https://speccapture.com/docs/api/errors#not_a_drawing",
"title": "The file is not a drawing we can read (PDF, TIFF, PNG, JPEG, BMP or WebP).",
"status": 422,
"detail": "This isn't a PDF, TIFF, PNG, JPEG, BMP or WebP file. Export the drawing in one of those formats and upload it again.",
"instance": "/v1/extractions",
"code": "not_a_drawing",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
}

Too Many Requests: a problem with a stable code. See Errors for every code and what to do about it.

Media typeapplication/problem+json

Every error: a problem with a stable code. https://speccapture.com/docs/api/errors lists every code.

object
type
required

A link to the code’s entry in the docs.

string
title
required

What went wrong, in a few words for a person: the same for every problem with this code.

string
status
required

The HTTP status of the answer.

integer format: int32
detail

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.

string
instance
required

The path of the request that was refused.

string
code
required

What went wrong, as a stable code to branch on: a published code never changes meaning.

string
traceId
required

This request’s trace: quote it when asking for help.

string

Examples

Examplerate_limited

Too many requests.

{
"type": "https://speccapture.com/docs/api/errors#rate_limited",
"title": "Too many requests.",
"status": 429,
"detail": "This key may make 120 requests a minute: up to 120 at once, then one more every 0.5 seconds as the allowance refills. Try again in 1 second.",
"instance": "/v1/extractions",
"code": "rate_limited",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
"retryAfterSeconds": 1,
"upgradeUrl": "https://app.speccapture.com/billing"
}

Service Unavailable: a problem with a stable code. See Errors for every code and what to do about it.

Media typeapplication/problem+json

Every error: a problem with a stable code. https://speccapture.com/docs/api/errors lists every code.

object
type
required

A link to the code’s entry in the docs.

string
title
required

What went wrong, in a few words for a person: the same for every problem with this code.

string
status
required

The HTTP status of the answer.

integer format: int32
detail

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.

string
instance
required

The path of the request that was refused.

string
code
required

What went wrong, as a stable code to branch on: a published code never changes meaning.

string
traceId
required

This request’s trace: quote it when asking for help.

string

Examples

Examplestorage_unavailable

The file could not be stored.

{
"type": "https://speccapture.com/docs/api/errors#storage_unavailable",
"title": "The file could not be stored.",
"status": 503,
"detail": "The file could not be stored. The credits reserved for it are returned within minutes; please send it again.",
"instance": "/v1/extractions",
"code": "storage_unavailable",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
"retryAfterSeconds": 5,
"jobWithoutFileId": "1b4e28ba-2fa1-41d2-883f-0016d3cca427"
}