Upload File
Purpose
To upload a CSV file in ZIP format for bulk write API. The response contains the file_id. Use this ID while making the bulk write request.
Endpoints
Request Details
Request URL
{api-domain}/crm/v3/upload
Header
Authorization: Zoho-oauthtoken 100xx.d92d4xxxxxxxxxxxxx15f52
feature: bulk-write - To indicate this is a bulk write job
X-CRM-ORG: zgid - The unique ID (zgid) of your organization obtained through the Organization API
Scope
scope=ZohoFiles.files.ALL
Input form-data
- filefile, mandatory
Choose the zip file you want to upload.
Sample Request
Copiedcurl "https://content.zohoapis.com/crm/v3/upload"
-X POST
-H "Authorization: Zoho-oauthtoken 100xx.d92d4xxxxxxxxxxxxx15f52"
-H "X-CRM-ORG: 78xxxxx37"
-H "feature: bulk-write"
-F "file=@file.csv.zip"
Possible Errors
- INVALID_FILE_FORMATHTTP 400
The file you uploaded is not in the zip format.
Resolution: Please upload your file only in zip format. - AUTHORIZATION_FAILEDHTTP 400
User does not have sufficient privilege to create.
Resolution: The user is not authorized to upload a file. Contact the system administrator. - INVALID_REQUEST_METHODHTTP 400
The http request method type is not a valid one
Resolution: The requested URL has an invalid method. Please request with a valid method. Refer to endpoints section above. - OAUTH_SCOPE_MISMATCHHTTP 401
Unauthorized
Resolution: The current request has no valid scope to upload a file. Create a client with scope ZohoFiles.files.ALL. Refer to scope section above. - NO_PERMISSIONHTTP 403
Permission denied to create
Resolution: The user has no permission to upload a file. Contact the system administrator. - INVALID_URL_PATTERNHTTP 404
Please check if the URL trying to access is a correct one
Resolution: The request URL is incorrect. Specify a valid request URL. Refer to request URL section above. - FILE_TOO_LARGEHTTP 413
The file size is too large to process
Resolution: Upload the file with maximum of 25MB. - INTERNAL_ERRORHTTP 500
Internal Server Error
Resolution: Unexpected and unhandled exception in Server. Contact the support team.
Refer to the Limitations to know the CSV file limits.
Sample Response
Copied{
"code": "FILE_UPLOAD_SUCCESS",
"details": {
"created_time": "2023-03-15T16:02:38+05:30",
"file_id": "5445605000001229001"
},
"message": "file uploaded.",
"status": "success"
}