Delete Recycle Bin Records
Purpose
To delete one or more records from the Recycle Bin in your Zoho CRM account.
Endpoints
- DELETE /settings/recycle_bin/{record_ID}
- DELETE /settings/recycle_bin?ids={record_ID1,record_ID2,...}
- DELETE /settings/recycle_bin?filters={filter_value}
Request Details
Request URL
To delete a specific record by ID:
{api-domain}/crm/{version}/settings/recycle_bin/{record_ID}
To delete a list of records:
{api-domain}/crm/{version}/settings/recycle_bin?ids={record_ID1, record_ID2, record_ID3,...}
To delete records based on filters param:
{api-domain}/crm/{version}/settings/recycle_bin?filters={filter_value}
Header
Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52
Scope
ZohoCRM.settings.recycle_bin.DELETE
Sample Request
Copiedcurl "https://www.zohoapis.com/crm/v8/settings/recycle_bin?ids=4876876000003274910,4876876000003278075,4876876000003280538"
-X DELETE
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
Note
- When you delete a record from the Recycle Bin, all its associated records in the Recycle Bin will also be deleted. For example, when a Leads record is deleted, its associated Notes and Attachments will also be removed from the Recycle Bin. In such cases, if there are more than 1000 records (including the parent record), a delete job will be scheduled.
Parameters
- idsstring, optional
To delete specific records based on their unique ID. You can specify up to 100 records IDs to be deleted.
Possible values: Valid unique IDs of records, in comma separated format. Example: 4150868000001944196,487687600000327055 - filtersJSON object, optional
To delete records that meet the defined criterion, using logical operators and comparators to filter by fields such as display name, module, deleted by, and deleted time.
Note : Make sure to encode the filters parameter value before making the API call.
JSON keys in filters param:
- group_operator string, optional
Defines how to combine the multiple conditions defined in the group array.
Possible Value:AND - groupJSON array, mandatory
An array of filter conditions, where each condition specifies the field, comparator and value.
- fieldJSON object
Represents the field by which the records should be filtered. Refer to the Filter Attributes section to know the possible values.
- comparatorstring
Represents the comparator operator, such as equal, not_equal, contains, etc. Refer to the Filter Attributes section to know the possible values for each field.
- valuestring/JSON object
Represents the value to compare the field against. This can be a string or a JSON object, depending on the field. Refer to the sample section for more details.
Filter Attributes:
- display_name
The display name of the record. The conditions that can be applied for display_name are equal, not_equal, contains, not_contains, starts_with, and ends_with.
- module
The API name of the module. Records from this module in the recycle bin will be filtered for deletion. The conditions that can be applied for module are equal and not_equal
- deleted_by
The name of the user who deleted the record. The conditions that can be applied for deleted_by are equal, not_equal, contains, not_contains, starts_with, and ends_with.
- deleted_time
The date and time the record was deleted, in ISO 8601 DateTime format. The conditions that can be applied for deleted_time are equal, not_equal, greater_than, and less_than.
Note
When you use the filters parameter to delete records based on defined criteria, the process is asynchronous, and a delete job will be scheduled.
Sample Response
Copied{
"recycle_bin": [
{
"code": "SUCCESS",
"details": {
"id": "4876876000003274910"
},
"message": "record deleted",
"status": "success"
},
{
"code": "SUCCESS",
"details": {
"id": "4876876000003278075"
},
"message": "record deleted",
"status": "success"
},
{
"code": "SUCCESS",
"details": {
"id": "4876876000003280538"
},
"message": "record deleted",
"status": "success"
}
]
}
Possible Errors
- INVALID_DATAHTTP 400
- The ID given seems to be invalid.
Resolution: Specify valid record ID. - The given group operator not supported. Only 'AND' operator is supported
Resolution: Construct the filters parameter value with AND group operator. - The given API name seems to be invalid
Resolution: Specify valid API names for the fields in the filters parameter.
- The ID given seems to be invalid.
- INVALID_REQUEST_METHODHTTP 400
The request method is incorrect.
Resolution: Use the HTTP DELETE method to make this API call. Any other request method will result in this error. - OAUTH_SCOPE_MISMATCHHTTP 401
The access token you have used to make this API call does not have the required scope.
Resolution: Generate a new access token with the required scopes for this API. Refer to the Scope section at the beginning of this page for the list of required scopes. - INVALID_URL_PATTERNHTTP 404
The request URL is incorrect.
Resolution: Specify a valid request URL. Refer to the request URL section at the beginning of this page for more details. - INTERNAL_ERRORHTTP 500
Unexpected and unhandled exception in the server.
Resolution: Contact the support team at support@zohocrm.com.
Sample Request using filters param
Copiedcurl "https://www.zohoapis.com/crm/v8/settings/recycle_bin?filters=%7B%22group_operator%22%3A%22AND%22%2C%22group%22%3A%5B%7B%22field%22%3A%7B%22api_name%22%3A%22display_name%22%7D%2C%22comparator%22%3A%22contains%22%2C%22value%22%3A%22Paul%22%7D%2C%7B%22field%22%3A%7B%22api_name%22%3A%22module%22%7D%2C%22comparator%22%3A%22equal%22%2C%22value%22%3A%22Leads%22%7D%5D%7D"
-X DELETE
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
Sample Response
Copied{
"recycle_bin": [
{
"code": "SCHEDULED",
"details": {},
"message": "Bulk deletion of records based on filters has been scheduled",
"status": "success"
}
]
}