Sources

Upload a document into a source

Upload a file directly into a source. The document is queued for extraction automatically. Duplicate files (by content hash) return a duplicate status with the existing document ID. A source's own key writes into that source only: any other source answers 404.

post/v1/sources/{id}/documents

Request

  • Base URL
    https://api.talonic.com
  • Auth
    HTTP bearer

Path parameters

id, string uuid required
Example:a1b2c3d4-e5f6-7890-abcd-ef1234567890

Resource UUID.

Request body multipart/form-data

object required
file, string binary required

The document file. Max 500 MB.

processing_mode, 'realtime' | 'batch'

"realtime" (default) — processed immediately. "batch" — 50% cost discount, results within 48 hours.

batch_id, string

Optional caller grouping key stamped on the document (documents.client_batch_id).

metadata, string

Optional JSON string of a FLAT object { [key]: string | number | boolean | null } (nested objects/arrays rejected 400; ≤50 keys, key ≤128, string value ≤1024), stamped on the document as documents.client_metadata.

Response

Document ingested (or duplicate detected).

IngestDocumentResponse required
document_id, string uuid

ID of the created document. When status is duplicate, this is the id of the linked-duplicate row created for this upload (see existing_document_id for the canonical document).

filename, string

The uploaded file's own name — present on both the queued and duplicate branches.

size_bytes, integer nullable

The uploaded file's own size in bytes — present on both the queued and duplicate branches.

status, 'queued' | 'duplicate'

queued if the document was accepted, duplicate if a matching file already exists.

source_id, string uuid
message, string

Present when status is duplicate.

existing_document_id, string uuid nullable

Present when status is duplicate — the canonical document this upload deduplicated to (the linked duplicate reads its extracted data from it). The document_id field carries the id of the linked-duplicate row created for this upload.

links, object

Example response

{
  "document_id": "f0e1d2c3-b4a5-9687-8765-432109876543",
  "filename": "invoice-042.pdf",
  "size_bytes": 148213,
  "status": "completed",
  "source_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "message": "Re-extraction started.",
  "existing_document_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}

Changes

No recorded changes to this operation across all 32 revisions of this API.