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.

post/v1/sources/{id}/documents

Request

  • Base URL: https://api.talonic.com
  • URL: https://api.talonic.com/v1/sources/{id}/documents
  • Auth: HTTP bearer

Path parameters

idstring uuid required
Example:a1b2c3d4-e5f6-7890-abcd-ef1234567890

Resource UUID.

Response

Document ingested (or duplicate detected).

document_idstring 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).

filenamestring

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

size_bytesinteger 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_idstring uuid
messagestring

Present when status is duplicate.

existing_document_idstring 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.

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 1 revision of this API.