Upload File Cache

Open in ChatGPT Open in ChatGPT to ask questions about this page
Open in Claude Open in Claude to ask questions about this page
Copy as MarkdownCopy this page as markdown to use with AI assistants
View as Markdown Open this page as markdown in a new tab

Upload a file to ZeptoMail's File Cache. The uploaded file can be referenced in emails using the returned cache key, avoiding the need to re-upload the same file for every email.

Endpoint

post /files

Request URL

https://api.zeptomail.com/v1.1/files Copied!

Request Parameters

- Request Headers

SendMailTokenAPI Key

Send Mail Token. Pass it with the prefix: Zoho-enczapikey

- Query Parameters

namestringMandatory

Name of the file you are uploading to File Cache.

- Request Body

multipart/form-data
JSON Object
Show Sub-Attributes
filebinaryOptional

The file to upload.

Sample Request

Curl
Java
Python
Deluge
Copied!
curl --request POST \
  --url 'https://api.zeptomail.com/v1.1/files?name=invoice.pdf' \
  --header 'Authorization: REPLACE_KEY_VALUE' \
  --header 'content-type: multipart/form-data' \
  -F 'file=@file_path'

Sample Request Body

Copied!
file = <file>
Show full

Response Parameters

- HTTP code 200

Response Body - application/json
JSON Object
Show Sub-Attributes
dataJSON Object
Show Sub-Attributes
file_cache_keystring
messagestring

- HTTP code 400

Response Body - application/json
JSON Object
Show Sub-Attributes
dataJSON Object
Show Sub-Attributes
error_codestring
messagestring
messagestring

Possible Response Codes

200HTTP code

File uploaded to cache successfully.

400HTTP code

Bad Request

Sample Response: HTTP 200

Copied!
  {
    "data": {
      "file_cache_key": "fc-xxxx-xxxx"
    },
    "message": "OK"
  }
                
Show full

Sample Response: HTTP 400

Copied!
  {
    "data": {
      "error_code": "TM_3004",
      "message": "Invalid request"
    },
    "message": "error"
  }
                
Show full