Delete a Function
Purpose
To delete a function from your Zoho CRM account. Use the Functions API to retrieve the function ID.
Endpoints
- DELETE /settings/functions/{function_identifier}
Here, {function_identifier} represents the unique ID or API name of the Function. You can obtain the Function ID or API name using the List Functions API.
Request Details
Request URL
{api-domain}/crm/{version}/settings/functions/{function_ID}
Here, {function_identifier} represents the unique ID or API name of the function. You can obtain the function ID or API name using the List Functions API.
Header
Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52
Scope
ZohoCRM.settings.functions.DELETE
(or)
ZohoCRM.settings.functions.ALL
(or)
ZohoCRM.settings.ALL
Note
- A function can be deleted only when it has no active associations with components such as Workflow Rules, Custom Buttons, or Schedules.
- If you try to delete a function that has active associations, the system returns the HTTP 400 - CANNOT_PERFORM_ACTION error.
Sample Request
Copiedcurl "https://www.zohoapis.com/crm/v8/settings/functions/5725767000011192310"
-X DELETE
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"Possible Errors
- CANNOT_PERFORM_ACTIONHTTP 400
Unable to delete the function
Resolutions:- Function has associations: Check whether the function has any associations, and remove the associations before retrying the request.
- Function has references: Check whether the function is referenced or used inside another function, and remove the references before retrying the request.
- Function is exposed as a REST API: Use the Get Function API to check whether ZAPI Key or OAuth authentication is enabled for the function. Disable the REST API exposure before retrying the request.
- INVALID_DATAHTTP 400
Invalid function ID
Resolution: Specify a valid function ID. Use the list of Functions to retrieve the function ID. - INVALID_REQUEST_METHODHTTP 400
The http request method type is not a valid one
Resolution: You have specified an invalid HTTP method to access the API URL. Specify a valid request method. Refer to the Endpoints section for more details. - OAUTH_SCOPE_MISMATCHHTTP 401
Unauthorized
Resolution: The client does not have a valid scope to delete the function. Create a new access token with the required scope. Refer to the Scope section for more details. - AUTHENTICATION_FAILUREHTTP 401
Authentication failed
Resolution: Pass the access token in the request header of the API call. - NO_PERMISSIONHTTP 403
Permission denied.
Resolution: The user does not have permission to publish the specified function. Contact your Zoho CRM administrator to obtain the required permissions. - INVALID_URL_PATTERNHTTP 404
Please check if the URL trying to access is a correct one
Resolution: The request URL specified is incorrect. Specify a valid request URL. Refer to the Request URL section for more details. - INTERNAL_ERRORHTTP 500
Internal Server Error
Resolution: Unexpected and unhandled exception in the server. Contact support team.
Response JSON
Copied{
"functions": [
{
"code": "SUCCESS",
"details": {
"id": "5725767000011192310"
},
"message": "function deleted successfully",
"status": "success"
}
]
}