Files

Upload a file

files_upload · Changes data · Markdown

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.

With these arguments
{
  "name": "walnut-sample.png",
  "content_base64": "iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAFUlEQVR42mPUVlFgwAaYGHCAwSkBAFztAH+qHNFaAAAAAElFTkSuQmCC"
}
What comes back
{
  "file": {
    "file_id": "cc4a3738-fd9c-4418-a1a0-c5dd1876db58",
    "name": "walnut-sample.png",
    "content_type": "image/png",
    "size": "78 bytes",
    "size_bytes": 78,
    "sha256": "e5d9e4983b30319a1323ead2071cabd97613fc2dd87f411cb27461d9973d986f",
    "created_at": "2026-10-14T08:00:00+00:00",
    "download_url": "https://cncto.co/d/cc4a3738-fd9c-4418-a1a0-c5dd1876db58?t=eyJmIjoiY2M0YTM3MzgtZmQ5Yy00NDE4LWExYTAtYzVkZDE4NzZkYjU4IiwiZXhwIjoxNzkyMTYwNDgxfQ:1xHMKf:81nXm3ya6X9Yk1yswZRO1y5bt5bIGy95AkUcV938JVI",
    "link_expires_in_hours": 24
  },
  "storage": {
    "used": "78 bytes",
    "quota": "1 GB",
    "used_bytes": 78,
    "quota_bytes": 1073741824,
    "extra_blocks": 0
  },
  "duplicate_of": null
}

Use it when

A file should be kept or passed to another tool: a logo, a PDF, a spreadsheet.

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

NameTypeWhat it is
nameRequiredstringFile name, e.g. "quote.pdf". 1 to 200 characters.
content_base64stringUp to 2,100,000 characters.
textstringUp to 1,500,000 characters.
urlstringA public https:// link to the file. Up to 2,000 characters.
content_typestringe.g. "application/pdf". Guessed from the name when left out. Up to 120 characters.
link_hoursintegerHow 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:

Terminal
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.

CodeWhenWhat to do
invalid_input400Not 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_large413The file is over 1.5 MB inline, or over 25 MB at all.Use files_upload_link for big files.
invalid_url400The url is not a public https:// link.Send a public https:// link.
fetch_failed422The link could not be fetched, or did not answer with the file.Check the link opens without signing in.
storage_full409The file store has no room for the file.Delete files with files_delete, or add room with files_add_storage.

Give this to your agent.

Set up Conecto from https://conecto.chat/SKILL.md