Delete Recycle Bin Records
Purpose
To delete one or more records from the Recycle Bin in your CRM account.
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
scope= ZohoCRM.settings.recycle_bin.DELETE
Sample Request
Copiedcurl "https://www.zohoapis.com/crm/v7/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 on the right 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. - 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 request URL section above. - OAUTH_SCOPE_MISMATCHHTTP 401
Unauthorized
Resolution: Client does not have the required OAUTH SCOPE. Create a new client with valid scope. Refer to scope section above for more details. - INTERNAL_ERRORHTTP 500
Internal Server Error
Resolution: Unexpected and unhandled exception in Server. Contact support team. - 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 endpoints section above. - INVALID_DATAHTTP 403
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.
Sample Request using filters param
Copiedcurl "https://www.zohoapis.com/crm/v7/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"
}
]
}