Documents

Create a browser-handoff upload session

Changed on

Creates a pending document row plus a short-lived upload token and returns a browser upload_url for it. This is the first half of the browser-handoff upload pair used by the hosted MCP connector: an agent creates the session, the user opens upload_url in a browser and picks the file, and the browser posts it to POST /v1/upload/{token}.

Auth is asymmetric across the pair. This route accepts an OAuth 2.1 bearer token or a tlnc_ API key with the extract scope. The upload route is unauthenticated because the short-lived token IS the credential. The token expires after 15 minutes by default and is single-use.

By default the document is targeted at extraction only (ingestion_target: extract): once uploaded, call POST /v1/extract with the returned document_id. Pass ingestion_target: ingest to add the file to the workspace instead: it is processed like an in-app upload (values, workspace fields, /v1/ask, query_data). At upload, tenant AI policy can reduce the requested target: ingest to extract, or either to store-only (upload). Call POST /v1/extract only when extraction is allowed.

post/v1/documents/upload-session

Request

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

Request body

object required
filename, string required

Filename of the file the user will upload.

account_id, string

Account (company) the document belongs to, by id, name or alias. See GET /v1/accounts.

ingestion_target, 'extract' | 'ingest'

extract: text only, for a following POST /v1/extract. ingest: full processing into workspace data.

parties, DocumentParty[]

The document's parties as your system has them, the same as PUT /v1/documents/{id}/parties. They decide the document's labels and so its place in the Collections tree.

parties_complete, boolean

parties names every party of the document.

Example request

{
  "filename": "invoice-2026-04.pdf",
  "account_id": "Filu",
  "parties": [
    {
      "id": "email:jane@acme.com"
    }
  ]
}

Response

Upload session created.

object required
document_id, string uuid required

Pending document row awaiting the upload.

upload_url, string required

Browser URL the user opens to pick and upload the file.

expires_at, string date-time required

Token expiry (15 minutes from creation by default).

Example response

{
  "document_id": "f0e1d2c3-b4a5-9687-8765-432109876543",
  "upload_url": "https://app.talonic.com/u/1f2e3d4c-5b6a-7980-abcd-ef0123456789"
}

Changes