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

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, recognised 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) 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
object
jobId
required
string format: uuid
status
required
Allowed values: queued splitting extracting completed failed
fileName
required
string
fileSizeBytes
required
integer format: int64
fileSha256
required
string
templateId
required
string
templateVersion
required
integer format: int32
sheetCount
required
integer format: int32
credits
required
object
perSheet
required
integer format: int32
reserved
required
integer format: int32
spent
required
integer format: int32
refunded
required
integer format: int32
held
required
integer format: int32
progress
required
object
sheetsCompleted
required
integer format: int32
sheetsFailed
required
integer format: int32
sheetsNeedingReview
required
integer format: int32
sheets
required
Array<object>
object
sheetNumber
required
integer format: int32
status
required
Allowed values: queued running completed failed
reviewState
required
One of:
null
engineVersion
required
null | string
completedAt
required
null | string format: date-time
resultUrl
required
string
markedControlled
boolean
controlledMarking
null | string
controlledKept
One of:
null
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
completedAt
required
null | string format: date-time
failureReason
required
null | string
testMode
required
boolean
drawingPurgedAt
null | string format: date-time
templateName
null | string

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

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

null | string
title
null | string
status
null | integer format: int32
detail
null | string
instance
null | string
code

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

string
traceId

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

string

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

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

null | string
title
null | string
status
null | integer format: int32
detail
null | string
instance
null | string
code

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

string
traceId

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

string

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

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

null | string
title
null | string
status
null | integer format: int32
detail
null | string
instance
null | string
code

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

string
traceId

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

string

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

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

null | string
title
null | string
status
null | integer format: int32
detail
null | string
instance
null | string
code

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

string
traceId

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

string

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

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

null | string
title
null | string
status
null | integer format: int32
detail
null | string
instance
null | string
code

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

string
traceId

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

string

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

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

null | string
title
null | string
status
null | integer format: int32
detail
null | string
instance
null | string
code

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

string
traceId

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

string

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

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

null | string
title
null | string
status
null | integer format: int32
detail
null | string
instance
null | string
code

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

string
traceId

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

string

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

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

null | string
title
null | string
status
null | integer format: int32
detail
null | string
instance
null | string
code

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

string
traceId

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

string

Not Implemented: 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

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

null | string
title
null | string
status
null | integer format: int32
detail
null | string
instance
null | string
code

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

string
traceId

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

string

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

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

null | string
title
null | string
status
null | integer format: int32
detail
null | string
instance
null | string
code

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

string
traceId

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

string