Skip to content
concord.app
Book a demo
esc
concord.app
Book a demo

API reference

Uploads. 6 operations.

The Uploads operations of the concord.app REST API, each with its parameters, body fields and responses.

Uploads — presigned direct-to-storage upload sessions.

Every path is on https://app.concord.app.

PUT/api/upload-pieces/{id}/{piece}

Send one piece of an upload

The byte route (server-relative, NOT under /v1). The body is exactly bytes [(piece - 1) × piece_size, …) of the file, with Content-Type: application/octet-stream, an exact Content-Length, X-Concord-Upload-Token: <token> and X-Concord-Piece-Sha256: <hex SHA-256 of this piece>. No Authorization header: the token is the credential. Pieces may be sent in any order and in parallel; a piece already held is acknowledged again. Errors use the upload plane's own envelope ({ statusCode, error, code, message, data: { reason, retryable, facts } }).

Parameters

NameInTypeDescription
id
required
path string The upload id POST /v1/imports or POST /v1/uploads returned.
piece
required
path string The 1-based piece number.

Request body

A application/octet-stream body.

Responses

StatusDescription
200The piece was received
401The token is missing, wrong, or was replaced by a newer declare
409The upload is no longer receiving pieces
410The upload expired, was cancelled or was refused
422Wrong piece number, length or digest
429Too many bytes in flight — retry after Retry-After
503Storage busy — retry after Retry-After

GET/api/v1/ai-suggestions/uploads

Read the suggestions for files you uploaded

For up to ten of your own uploads (comma-separated uploadIds), the workspace, folder and stage concord.app suggests before you import them. A dimension concord.app could not tell has needsChoice: true and no value: choose one before importing. ready is false until the analysis has answered (usually within three seconds of the file landing). Uploads that are not yours are left out.

Parameters

NameInTypeDescription
uploadIds
required
query string

Responses

StatusDescription
200OK
400Malformed request or invalid parameters for the operation, Request payload failed schema validation; BAD_REQUEST: Malformed request or invalid parameters for the operation; VALIDATION: Request payload failed schema validation
401401 — UNAUTHORIZED: Missing or invalid authentication credentials
403403 — FORBIDDEN: Authenticated but not authorized for this resource or operation
404404 — NOT_FOUND: The requested resource (or a resource referenced by the operation) was not found
405405 — METHOD_NOT_SUPPORTED: HTTP method not supported for this resource
406406 — NOT_ACCEPTABLE: Requested representation is not acceptable
408408 — TIMEOUT: Request timed out
409409 — CONFLICT: Resource state conflict — concurrent modification or duplicate
412412 — PRECONDITION_FAILED: Resource state does not allow the requested operation
413413 — PAYLOAD_TOO_LARGE: Request payload exceeds the allowed size
415415 — UNSUPPORTED_MEDIA_TYPE: Request media type is not supported
422422 — UNPROCESSABLE_CONTENT: Request semantically valid but unprocessable
429429 — TOO_MANY_REQUESTS: Rate limit or quota exceeded for the operation
499499 — CLIENT_CLOSED_REQUEST: Client closed the request before the server finished
500500 — INTERNAL_SERVER_ERROR: Unexpected server error while processing the operation
501501 — NOT_IMPLEMENTED: The requested operation is not implemented
502502 — BAD_GATEWAY: Invalid response from an upstream dependency
503503 — SERVICE_UNAVAILABLE: Service temporarily unavailable — may be retried after Retry-After
504504 — GATEWAY_TIMEOUT: Timed out waiting for an upstream dependency

POST/api/v1/uploads

Ask to upload files for OCR

Declare 1 to 500 files you are about to send for a HELD purpose: ocr_page (a scanned page for the OCR operations, at most 2 GB). Each accepted file comes back as an upload with its piece plan and piece token; declined files come back with the reason — and when EVERY file is over its purpose's limit the ask itself is refused 413 with that limit's sentence, before a byte is sent. Then PUT each piece, call POST /v1/uploads/complete, and use the upload id in the operation. A file already on the web can be pulled by the server instead (POST /v1/uploads/from-url). Documents to IMPORT are declared with POST /v1/imports instead (purpose: document is answered 400).

Parameters

NameInTypeDescription
Idempotency-Key header string Optional idempotency key. When supplied, a repeat of the same request replays the original response instead of performing the write twice. A retry sent WITHOUT the header is a second write and CAN duplicate its effect — always send one on retries.

Request body

NameTypeDescription
purpose
required
one of "ocr_page" What the files are for. ocr_page: a scanned page image or PDF for the OCR operations. Documents to IMPORT are not uploaded here: declare them with POST /v1/imports.
files
required
array of object The files to upload, 1 to 500 per call. One call opens one upload group.

Responses

StatusDescription
201The accepted uploads with their piece plans, and the declined files
400Invalid request — see error.code for the specific failure mode
401Missing or invalid Bearer token
403Authenticated but not permitted to perform this action
404Resource not found
429Rate limit exceeded — see Retry-After and RateLimit-* headers

POST/api/v1/uploads/complete

Finish uploads

Finish uploads whose pieces are all sent (1 to 500 ids — an import's files and held uploads alike). The server assembles each file, checks its exact size, its SHA-256 (when you send it), its real type and our malware scan. Small files (a few, up to 32 MiB in total) are checked inside this call; others come back checking. An entry with missing_pieces still needs those pieces; deferred: true means call complete again. Ids that are not yours are left out.

Parameters

NameInTypeDescription
Idempotency-Key header string Optional idempotency key. When supplied, a repeat of the same request replays the original response instead of performing the write twice. A retry sent WITHOUT the header is a second write and CAN duplicate its effect — always send one on retries.

Request body

NameTypeDescription
uploads
required
array of object

Responses

StatusDescription
200Each upload's status after this call
400Invalid request — see error.code for the specific failure mode
401Missing or invalid Bearer token
403Authenticated but not permitted to perform this action
404Resource not found
429Rate limit exceeded — see Retry-After and RateLimit-* headers

POST/api/v1/uploads/from-url

Upload a file from a URL

concord.app fetches the file at an https URL and lands it through the upload path, like a file you upload yourself: its real type and our malware scan are checked. purpose says what the file is for: "ocr_page" (a page for recognize-handwriting or bulk OCR) or "document" (a document to import; poll the returned import_id with GET /v1/imports/{id}). The URL must be https, carry no user name or password, answer with a Content-Length and redirect at most three times. The call waits up to 20 seconds for the file to be checked: a small file comes back ready, its upload_id usable at once.

Parameters

NameInTypeDescription
Idempotency-Key header string Optional idempotency key. When supplied, a repeat of the same request replays the original response instead of performing the write twice. A retry sent WITHOUT the header is a second write and CAN duplicate its effect — always send one on retries.

Request body

NameTypeDescription
url
required
string The https URL of the file.
purpose
required
one of "ocr_page", "document" What the file is for.
file_name string The file's name with its extension (e.g. page-1.png); the URL's last path segment when omitted. The extension decides which file types are accepted.
folder_id string For purpose "document": the folder to import the document into.

Responses

StatusDescription
200OK
400Malformed request or invalid parameters, Request payload failed schema validation; BAD_REQUEST: Malformed request or invalid parameters; VALIDATION: Request payload failed schema validation
401401 — UNAUTHORIZED: Missing or invalid authentication credentials
403403 — FORBIDDEN: Authenticated but not authorized for this resource
404404 — NOT_FOUND: Requested resource does not exist
405405 — METHOD_NOT_SUPPORTED: HTTP method not supported for this resource
406406 — NOT_ACCEPTABLE: Requested representation is not acceptable
408408 — TIMEOUT: Request timed out
409409 — CONFLICT: Resource state conflict — concurrent modification or duplicate
412412 — PRECONDITION_FAILED: Resource state does not allow the requested operation
413413 — PAYLOAD_TOO_LARGE: Request payload exceeds the allowed size
415415 — UNSUPPORTED_MEDIA_TYPE: Request media type is not supported
422422 — UNPROCESSABLE_CONTENT: Request semantically valid but unprocessable — e.g. file format mismatch
429429 — TOO_MANY_REQUESTS: Rate limit exceeded — wait retryAfterSeconds before retrying
499499 — CLIENT_CLOSED_REQUEST: Client closed the request before the server finished
500500 — INTERNAL_SERVER_ERROR: Unexpected server error — the request should not be retried
501501 — NOT_IMPLEMENTED: The requested operation is not implemented
502502 — BAD_GATEWAY: Invalid response from an upstream dependency
503503 — SERVICE_UNAVAILABLE: Service temporarily unavailable — may be retried after Retry-After
504504 — GATEWAY_TIMEOUT: Timed out waiting for an upstream dependency

GET/api/v1/uploads/{id}

Get an upload

One upload's status: declared, receiving, checking, ready (usable), refused (with the reason), cancelled or expired.

Parameters

NameInTypeDescription
id
required
path string

Responses

StatusDescription
200The upload
400Invalid request — see error.code for the specific failure mode
401Missing or invalid Bearer token
403Authenticated but not permitted to perform this action
404Resource not found
429Rate limit exceeded — see Retry-After and RateLimit-* headers

See it on your contracts.

Book a demo

Trusted by teams at

  • 4M+ documents signed since 2014