Atomside docsThis page as Markdown

Upload a file: upload_file

Takes a file (PDF, Word, ODT, RTF, plain text, Markdown, HTML, JPG or PNG, up to 10 MB) as base64 and returns an id to use in quote_letter or check_letter pages. Kept for 24 hours unless a letter uses it. Free. For a letter you write yourself, pass text in the quote instead.

MCP toolupload_file
RESTPOST /v1/files
CLIatomside upload-file
Key needsQuote (letters:quote)
Changes anythingYes.
Idempotency keyNot used.

Example

A real call and its real answer, made against the API in test mode. A test runs it again and fails if the answer changes. Ids, keys and links are replaced with stand-ins.

A call that works

REST:

curl -X POST https://api.atomside.com/v1/files \
  -H "Authorization: Bearer $ATOMSIDE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "rent-review.txt",
  "content_base64": "RGVhciBNcyBTYW1wbGUsCgpZb3VyIHJlbnQgc3RheXMgdGhlIHNhbWUuCg=="
}'

MCP:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "upload_file",
    "arguments": {
      "name": "rent-review.txt",
      "content_base64": "RGVhciBNcyBTYW1wbGUsCgpZb3VyIHJlbnQgc3RheXMgdGhlIHNhbWUuCg=="
    }
  }
}

CLI:

atomside upload-file \
  --name rent-review.txt \
  --content-base64 'RGVhciBNcyBTYW1wbGUsCgpZb3VyIHJlbnQgc3RheXMgdGhlIHNhbWUuCg=='

The answer (HTTP 200; over MCP, the same JSON is the result's structuredContent):

{
  "file": "file_example000000001",
  "name": "rent-review.txt",
  "kind": "text",
  "size_bytes": 43,
  "sha256": "e10ae3aca4d6138ec91d6d76721b9b0b211bcff571a6be14c53fd94651fa0e36",
  "pages": null,
  "expires": "2026-11-17T09:30:00.000Z",
  "next": "Use { \"file\": \"file_example000000001\" } in the pages of check_letter or quote_letter."
}

Input

Over REST, fields in the path go in the path, GET fields in the query string, and POST fields in the JSON body. Over MCP, every field is an argument of the tool.

{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "The file name, with its extension."
    },
    "content_base64": {
      "type": "string",
      "maxLength": 13981016,
      "format": "base64",
      "contentEncoding": "base64",
      "pattern": "^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$",
      "description": "The file, base64 encoded."
    },
    "media_type": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    }
  },
  "required": [
    "name",
    "content_base64"
  ],
  "additionalProperties": false
}

Output

{
  "type": "object",
  "properties": {
    "file": {
      "type": "string",
      "description": "Use this in a quote: { \"file\": \"file_…\" }."
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "enum": [
        "text",
        "markdown",
        "html",
        "pdf",
        "docx",
        "odt",
        "rtf",
        "png",
        "jpg"
      ]
    },
    "size_bytes": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "sha256": {
      "type": "string"
    },
    "pages": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ],
      "description": "For a PDF, how many pages it has: choose some with \"pages\" in a quote. Else null."
    },
    "expires": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
      "description": "Kept until then unless a letter uses it."
    },
    "next": {
      "type": "string"
    }
  },
  "required": [
    "file",
    "name",
    "kind",
    "size_bytes",
    "sha256",
    "pages",
    "expires",
    "next"
  ],
  "additionalProperties": false
}

Refusals

Every refusal has the same shape. Branch on code, answer and retry; repeat say to your person.

CodeAnswerRetryHTTPWhat to do next
key_missingnoafter_fix401Send the key as "Authorization: Bearer as_test_…". Ask your person if you have none.
key_not_validnonever401Ask your person for a new key. There is no link: we cannot say whose it was.
scope_missingnoafter_person403Ask your person to give the key that permission.
invalid_requestnoafter_fix400Fix the field named in details.field. The same idempotency key is fine.
rate_limitednoat_time429Wait. The same idempotency key never sends twice.
try_again_shortlynoat_time503Try again after retry_after with the same idempotency key.
account_expirednonever401Start again with start_account if your person still wants this.
connection_endednoafter_person401Tell your person. To carry on, they connect Atomside again in your assistant.
file_not_usablenoafter_fix422details.problem says which page and what is wrong.
not_foundnoafter_fix404Check the name against the tool list or /v1/openapi.json.