Export records as a file
well_export_dataExport a full list of Well records (transactions, invoices, companies, people) as a file, and return the link that downloads it. Use it when the person asks for their whole list rather than an answer about it: "send me every transaction of June", "export my unpaid invoices".
Name the root and the fields as well_query_records takes them, with the same whereClause. Pass format for a PDF; a CSV comes back when you name none. An invoice, a credit note, or a document of a saved design, asked as a PDF, is well_generate_document, not this tool. For rows you built yourself rather than Well records, use well_export_rows_as_file.
The link lives 15 minutes and serves a few downloads. Share it only with the person who asked.
Returns url, or refusal_reason: "not_a_member" (the caller is not an active member of this workspace), "query_refused" (the query names something the records read model refuses; the error says what), "unavailable" (this deployment cannot serve files) or "failed" (Well could not make the file; the same call can be tried again).
When the token authorizes one workspace, call this directly — no workspace call is needed first. When it authorizes several, this read will not guess which one you mean: pass workspace_id on the call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kpis | No | Up to 3 figures Well computes and prints above the table. | |
| root | No | The records root to export, as well_query_records takes it: transactions, invoices, companies… | |
| title | Yes | The title the file prints, in the user's language: "Transactions de juin 2026". | |
| fields | No | The file's columns, in order, 1 to 8 field paths. | |
| format | No | Only when the person named a format: "pdf" for a PDF, "csv" for a CSV or a spreadsheet. Well then sends the file itself. Left out, the person picks the format under your message. | |
| source | No | "records" (the default) exports a records query. "cash_position" exports the bank accounts a cash position counted, each with its balance, read by Well: pass `title` and `account_types`, and no records query. | |
| orderBy | No | The row order: { "field": "executed_at", "direction": "desc" }. | |
| file_kind | No | Only when a skill names it: "receivables_aging" for the receivables aging file (`invoices` root). Well then names the file aging, the day, the time and the sources of its rows. Left out, the file is named after its root. | |
| partyScope | No | `invoices` root only: "purchase" for supplier invoices, "sales" for client invoices. | |
| as_of_month | No | Cash position only: the past month the answer read the balance at the end of, as `YYYY-MM`, when the person asked for a month end ("fin du mois dernier"). The file then prints each account's balance at that month end. Left out, the file prints the live balance. | |
| whereClause | No | The filter, as well_query_records takes it: { "executed_at": { "_gte": "2026-06-01", "_lt": "2026-07-01" } }. | |
| workspace_id | No | Target workspace. Omit when the token authorizes one workspace. Required when it authorizes several: this read reports one workspace's own figures and will not choose which. | |
| account_types | No | Cash position only: the account types the answer counted as cash, as the cash scope keys them (["deposit"]), never a label. Required for `source: "cash_position"`. | |
| column_labels | No | The column headings, in the user's language, one per field and in the same order. | |
| conversation_id | No | The conversation id returned by the previous Well result, in its meta under well/conversation_id, in its structuredContent, or in its JSON text block. Pass it back on every call in the same conversation, including a call a card makes, so the chosen workspace and the earlier answers still apply. It decides the conversation on its own: nothing the host states about the session replaces it. Omit it only on the first call of a conversation. | |
| workspace_scope | No | Restrict this call to the family: the token's primary workspace plus the company workspaces under it that you are a member of. Unrelated authorized workspaces drop out of the read; row reads merge across the family, while a per-workspace figure still reports exactly one workspace. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The link that downloads the export. Give it to the person exactly as returned. | |
| error | No | ||
| format | No | The format the file comes in. | |
| success | Yes | ||
| expires_at | No | When the link stops working, ISO 8601. | |
| refusal_reason | No | ||
| conversation_id | No | The conversation this result belongs to. Pass it back as the conversation_id argument on every later Well call in the same conversation. | |
| newly_connected | No | Tools that connected to this workspace since the last result and that no session was told about yet, oldest first. Present only when at least one tool is new. The connected-line rule says when to tell an entry; when it does, one line per entry, in the person's language: "<name> is connected.". Never fold several entries into one sentence. Each entry comes back once, on one result only: never repeat its line later. | |
| resolved_workspace | No | The workspace that answered, when the caller named none and the token authorizes several. | |
| conversation_id_note | No | Present only when the server opened a fresh lane, stating that no choice recorded earlier was read. | |
| conversation_id_source | No | Where the conversation id came from: the host's own request meta, the caller's argument, or a fresh lane the server opened. |