Upload a file
Stores a file in the business's file store from its bytes, its text or a public link, with a download link.
$0.001 a call
From your agent’s balance. A call that fails costs nothing.
An example
Keep this photo of the new walnut sample in our files.
Your agent callsfiles_upload$0.001 a call
The example business is Halverson Cycle & Repair, a bike shop with a repair workshop in Portland, Oregon. The reply is the one the tool really gives.
{
"name": "walnut-sample.png",
"content_base64": "iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAFUlEQVR42mPUVlFgwAaYGHCAwSkBAFztAH+qHNFaAAAAAElFTkSuQmCC"
}Use it when
A file should be kept or passed to another tool: a logo, a PDF, a spreadsheet.
- For a file a person sends, or one over 1.5 MB, use
files_upload_link.
What it does
Store a file in the account's private file store and get a download link for it. Give exactly one of: content_base64 (the bytes, or a data: URL), text (for text files: Markdown, CSV, JSON...), or url (a public https link we fetch). Inline content is limited to 1.5 MB; for bigger files (up to 25 MB) use files_upload_link. 1 GB of storage is free. duplicate_of names a stored file with the same bytes; the upload is kept anyway.
What comes back
file: its file_id, name, type, size, checksum, when it was added, and a download link with its expiry; storage: how much is used and free; and duplicate_of when the same bytes are stored already. Every reply also carries cost_usd and balance_usd.
Inputs
| Name | Type | What it is |
|---|---|---|
nameRequired | string | File name, e.g. "quote.pdf". 1 to 200 characters. |
content_base64 | string | Up to 2,100,000 characters. |
text | string | Up to 1,500,000 characters. |
url | string | A public https:// link to the file. Up to 2,000 characters. |
content_type | string | e.g. "application/pdf". Guessed from the name when left out. Up to 120 characters. |
link_hours | integer | How long the download link works, in hours (up to 168, one week). 1 to 168. Default: 24. |
The call
Over MCP, call files_upload on https://api.conecto.chat/mcp/files. Over REST:
curl -X POST https://api.conecto.chat/v1/tools/files_upload \
-H "Authorization: Bearer $CONECTO_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"walnut-sample.png","content_base64":"iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAFUlEQVR42mPUVlFgwAaYGHCAwSkBAFztAH+qHNFaAAAAAElFTkSuQmCC"}'When it refuses
A refused call costs nothing and says what to do next.
| Code | When | What to do |
|---|---|---|
invalid_input400 | Not exactly one of content_base64, text or url was given, the base64 is not valid, or the file is empty. | Send exactly one of them. |
too_large413 | The file is over 1.5 MB inline, or over 25 MB at all. | Use files_upload_link for big files. |
invalid_url400 | The url is not a public https:// link. | Send a public https:// link. |
fetch_failed422 | The link could not be fetched, or did not answer with the file. | Check the link opens without signing in. |
storage_full409 | The file store has no room for the file. | Delete files with files_delete, or add room with files_add_storage. |
More Files tools
All 13 tools- Get an upload link
files_upload_linkA one-time link to upload one file of up to 25 MB, to use yourself or hand to a person.Free - Find files
files_listThe business's files, newest first, filtered by name, words inside, tags, type, correspondent, document date or fields.Free* - Get a file
files_getOne file's details and a fresh download link, with the text of a small text file if asked.Free* - Read a file's words
files_read_textThe words in a file as Conecto read them: text files, PDFs, office files, HTML, and scans once read with OCR.Free* - Say what files are
files_editSays what one file is, or up to 100 at once: title, notes, document date, correspondent, type, tags and fields.$0.005 per file changed - Define a tag, type, field or correspondent
files_defineAdds, renames or deletes a tag, a document type, a custom field or a correspondent to file things with.$0.001 a call - List tags, types, fields and correspondents
files_definitionsThe tags, document types, custom fields and correspondents the business files with, each with how many files use it, and the OCR settings.Free* - Read a scan with OCR
files_ocrReads the words in a scan with OCR: an image, or the pages of a PDF without text; the text is kept.$0.005 per page read
Give this to your agent.
Set up Conecto from https://conecto.chat/SKILL.md