---
title: "Upload a document into a source"
method: POST
path: "/v1/sources/{id}/documents"
tags: ["Sources"]
---

# Upload a document into a source

`POST /v1/sources/{id}/documents`

## Request

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

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.

## Path parameters

- `id` string, uuid, required

## Response `200`

Document ingested (or duplicate detected).

- IngestDocumentResponse
  - `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
    - `document` string
    - `source` string

## Other responses

- `400`: The request is invalid.
- `401`: Missing or invalid API key.
- `403`: The API key does not have the required scope.
- `404`: The requested resource was not found.
- `413`: The uploaded file exceeds the size limit.
- `429`: Daily rate limit exceeded.

---

[API](https://skmtc.dev/talonic/apis/talonic-api.md) · [All operations](https://skmtc.dev/talonic/apis/talonic-api/llms.txt) · [OpenAPI document](https://skmtc.dev/talonic/apis/talonic-api/revisions/678fe5f8c9c3?raw)
