Files and uploads from an agent
Before Talonic can read a document, the file has to reach it. This page shows the four ways an agent can do that, which one to use, and what to tell the user while a file is on its way.
Pick a way
- Already in the workspace. Use its
document_id. If the user names the file, find the id withtalonic_search(search by file name or one keyword). Free and instant. - On a public URL. Pass
file_url(https). Talonic fetches it. Good for links the user pastes. - On the user's machine, in a local install. Pass
file_path; the local server reads the file. Small files can also go asfile_data(base64) withfilename. - Anything else, especially in Claude.ai or ChatGPT. Call
talonic_request_uploadand give the user the link. They open it in their browser and drop the file.
file_data there arrives cut short and comes back with empty fields. Use an upload link instead.The upload link, step by step
- The agent calls
talonic_request_uploadwith thefilename. Passaccountto file it under one company, andadd_to_workspace: trueif the user will ask questions about it later (otherwise only its text is kept for the next extraction). - It returns
upload_url, adocument_idreserved for the file, andexpires_at. The agent shows the user the link and says when it expires. - The user opens the link and drops the file. The agent checks
talonic_get_documentevery few seconds. - When
statusiscompleted(orextractedwithoutadd_to_workspace), the file is ready: extract fields, read its text, or ask about it.
Status while a file is on its way
| Parameter | Type | Description |
|---|---|---|
| pending_upload | waiting | Link issued; the user has not dropped the file yet. |
| uploading | in progress | The file is arriving. Keep checking. |
| queued / extracting | in progress | Talonic is reading the file. |
| extracted | ready | Text is ready (uploads without `add_to_workspace`). |
| completed | ready | Fully processed and searchable. |
| ocr_failed / extraction_failed / error | failed | Stop checking and tell the user; the file could not be read. A clearer scan or the original file usually works. |
What files work
PDFs (text or scanned), images and phone photos, Word documents (DOCX) and emails. Long documents take longer; very large files are better sent as an upload link or a URL than as bytes.
Keeping companies apart
If the workspace holds documents for several companies (clients, portfolio companies, entities), pass account when uploading. Questions scoped to that account never mix in another company's files. talonic_list_accounts lists them; talonic_create_account adds one.
Cost
Issuing a link and checking status are free. Reading a new file uses credits, as in the web app; talonic_get_pricing shows the rates.
Frequently asked questions
Why does my agent ask me to open a link instead of reading the file I attached?+
How long is an upload link valid?+
expires_at time returned with it. If it expires, ask the agent for a new link; nothing is lost.