Skip to main content
Uploads one file so a message can attach it. The body is the raw file; the name travels in a header.

Request

The Content-Type header is ignored. Maximum size is 25 MB.

Response

Pass this object unchanged as one entry of attachments on POST /message.

Recognised extensions

.txt .md .json .js .ts .py .sh .bash .yaml .yml .csv .html .xml .pdf .png .jpg .jpeg .gif .webp .sim Anything else is stored as application/octet-stream.

Errors

Gotchas

  • The returned name can differ from the one you sent: unsafe characters are replaced and a timestamp is appended.
  • One file per call. Loop for several.
  • Use --data-binary, not -d, so curl does not strip newlines.