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 CPaaS'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://cpaas.zoho.com/v1.1/files Copied!

Request Parameters

- Request Headers

ApiKeyAuthAPI Key

API Key of an agent. Send the header as Authorization: Zoho-enczapikey {apiKey}.
Follow the steps here to generate an API key.

- Query Parameters

namestringMandatory

Name of the file you are uploading to File Cache.

Example
invoice.pdf

- 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://cpaas.zoho.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_keystringread-only
Example
fc-xxxx-xxxx
messagestringread-only
Example
OK

- HTTP code 400

Response Body - application/json
JSON Object
Show Sub-Attributes
dataJSON Object
Show Sub-Attributes
error_codestringread-only
Example
TM_3004
messagestringread-only
Example
Invalid request
messagestringread-only
Example
error

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