Zoho: Restore multiple Recycle Bin records
Zoho recycleBin.restoreRecycleBinRecords: arguments, response, policy and SDK examples.
← Recycle bin operations · Get started
Operation zoho.restorerecyclebinrecords
Provider route: POST /crm/v8/settings/recycle_bin/actions/restore. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/zoho with npm, or alter-sdk-zoho with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { ZohoIntegration } from "@alter-ai/zoho";
async function execute(input: Parameters<ZohoIntegration["recycleBin"]["restoreRecycleBinRecords"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new ZohoIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.recycleBin.restoreRecycleBinRecords(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_zoho import ZohoIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = ZohoIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.recycle_bin.restore_recycle_bin_records(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
body | object | Required within parent | Request payload that specifies how to scope the restoration. Provide exactly one of ids, filters, or restore_all_records; supplying more than one results in an AMBIGUITY_DURING_PROCESSING error. Additional keys: not allowed |
body.filters | object | Optional | Specify the filter criteria to select recycle-bin records for restoration. Mutually exclusive with ids and restore_all_records. Restoration based on filters is always scheduled as a background job, regardless of the number of matching records. Additional keys: not allowed |
body.filters.group | array | Required within parent | Specify the list of filter conditions used to select recycle-bin records for restoration. Maximum items: 20 |
body.filters.group[] | object | Each item | Represents a single filter condition, including the field to filter on, the comparator, and the value to compare against. Additional keys: not allowed |
body.filters.group[].comparator | string | Required within parent | Specify the comparison operator to apply between the field and the value. Possible values: equal, not_equal, contains, not_contains, starts_with, ends_with, greater_than, less_than. The set of comparators supported depends on the field: display_name and deleted_by support equal, not_equal, contains, not_contains, starts_with, ends_with; module supports equal and not_equal; deleted_time supports equal, not_equal, greater_than, less_than. Maximum length: 50 |
body.filters.group[].field | object | Required within parent | Specify the field to filter on. The field is identified by its API name. Additional keys: not allowed |
body.filters.group[].field.api_name | string | Required within parent | Specify the API name of the field to filter on. Possible values: display_name, module, deleted_by, deleted_time. Maximum length: 100 |
body.filters.group[].value | JSON | Required within parent | Specify the value to compare the field against. The data type depends on the field being filtered. |
body.filters.group[].value (anyOf 1) | string | Alternative | String value used when filtering by display_name, module, deleted_by, or deleted_time. Maximum length: 500 |
body.filters.group[].value (anyOf 2) | number | Alternative | Numeric value used when filtering by a numeric attribute. |
body.filters.group[].value (anyOf 3) | boolean | Alternative | Boolean value used when filtering by a Boolean attribute. |
body.filters.group_operator | string | Required within parent | Specify the logical operator that combines the conditions inside the group array. Possible values: AND. One of: AND |
body.ids | array | Optional | Specify the unique IDs of the recycle-bin records you want to restore. Mutually exclusive with filters and restore_all_records. Maximum items: 200 |
body.ids[] | string | Each item | Represents the unique identifier of a single recycle-bin record to restore. Maximum length: 100 |
body.restore_all_records | boolean | Optional | Specify whether every record currently in the Recycle Bin should be restored. Possible values: true - Every record in the Recycle Bin is restored. This option cannot be combined with ids or filters and the operation is always scheduled as a background job. false - Either ids or filters must be supplied to scope the restoration. |
body (anyOf 1) | JSON | Alternative | Restore only the recycle-bin records whose IDs are listed in ids. |
body (anyOf 2) | JSON | Alternative | Restore the recycle-bin records that match the conditions defined in filters. |
body (anyOf 3) | JSON | Alternative | Restore every record currently in the Recycle Bin when restore_all_records is set to true. |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | Model | Alternative | Expand Restore a Recycle Bin record — response body |
$ (anyOf 2) | Model | Alternative | Expand Restore a Recycle Bin record — response body |
$ (anyOf 3) | Model | Alternative | Expand Delete recycle-bin records — response body — recycle bin |
Referenced models: Restore a Recycle Bin record — response body, Delete recycle-bin records — response body — recycle bin
Schemas
Section titled “Schemas”Restore a Recycle Bin record — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Wrapper that returns the per-item results of a recycle-bin operation under the **recycle_bin** array. Additional keys: not allowed |
recycle_bin | array | Required within parent | List of per-item results for the operation. Each entry is either a success result or a scheduled-job result. Maximum items: 200 |
recycle_bin[] | JSON | Each item | |
recycle_bin[] (anyOf 1) | Model | Alternative | Expand Restore a Recycle Bin record — response body — recycle_bin / item / code: SUCCESS, status: success |
recycle_bin[] (anyOf 2) | Model | Alternative | Expand Restore a Recycle Bin record — response body — recycle_bin / item / code: SCHEDULED, status: success |
Referenced models: Restore a Recycle Bin record — response body — recycle_bin / item / code: SUCCESS, status: success, Restore a Recycle Bin record — response body — recycle_bin / item / code: SCHEDULED, status: success
Delete recycle-bin records — response body — recycle bin
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Multi-status payload that combines per-item success and error entries when a bulk request partially succeeds. Additional keys: not allowed |
recycle_bin | array | Required within parent | Represents the list of per-item results, where each entry is either a **SuccessResponse** for a successful item or an **ErrorResponse** for a failed item. Maximum items: 200 |
recycle_bin[] | JSON | Each item | |
recycle_bin[] (anyOf 1) | Model | Alternative | Expand Restore a Recycle Bin record — response body — recycle_bin / item / code: SUCCESS, status: success |
recycle_bin[] (anyOf 2) | Model | Alternative | Expand Delete recycle-bin records — response body — recycle_bin / recycle_bin / item / status: error |
Referenced models: Delete recycle-bin records — response body — recycle_bin / recycle_bin / item / status: error, Restore a Recycle Bin record — response body — recycle_bin / item / code: SUCCESS, status: success
Restore a Recycle Bin record — response body — recycle_bin / item / code: SUCCESS, status: success
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Per-item result returned when a single recycle-bin record is processed successfully. Additional keys: not allowed |
code | string | Required within parent | Result code for the per-item operation. Possible values: **SUCCESS**. Known values: SUCCESS Maximum length: 100 |
details | object | Required within parent | Represents additional details about the per-item operation, including the affected record ID. Additional keys: not allowed |
details.id | string | Optional | Represents the unique identifier of the recycle-bin record that the per-item result refers to. Maximum length: 500 |
message | string | Required within parent | Represents the message that describes the outcome of the per-item operation. Maximum length: 500 |
status | string | Required within parent | Indicates that the per-item operation succeeded. Possible values: **success**. Known values: success |
Restore a Recycle Bin record — response body — recycle_bin / item / code: SCHEDULED, status: success
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Result returned when a recycle-bin operation is queued as a background job because it cannot complete synchronously. Additional keys: not allowed |
code | string | Required within parent | Result code indicating that the operation is scheduled. Possible values: **SCHEDULED**. Known values: SCHEDULED |
details | object | Required within parent | Represents additional details about the scheduled operation. This is typically an empty object or contains a record ID associated with the scheduled job. Additional keys: allowed |
message | string | Required within parent | Represents the message confirming that the operation has been queued as a background job. Maximum length: 500 |
status | string | Required within parent | Indicates that the request to schedule the operation succeeded. Possible values: **success**. Known values: success |
Delete recycle-bin records — response body — recycle_bin / recycle_bin / item / status: error
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Error payload returned when a recycle-bin request fails, including the error code, the error message, and context-specific details. Additional keys: not allowed |
code | string | Required within parent | Error code identifying why the request failed. Possible values: **INVALID_DATA**, **EXPECTED_FIELD_MISSING**, **EXPECTED_PARAM_MISSING**, **AMBIGUITY_DURING_PROCESSING**, **AUTHORIZATION_FAILED**. Known values: INVALID_DATA, EXPECTED_FIELD_MISSING, EXPECTED_PARAM_MISSING, AMBIGUITY_DURING_PROCESSING, AUTHORIZATION_FAILED |
details | object | Required within parent | Provides additional context about the error, such as the offending parameter, field, JSON path, expected data type, or record ID. The populated keys depend on the **code** value. Additional keys: not allowed |
details.ambiguity_due_to | array | Optional | List of factors that caused ambiguity when the error is **AMBIGUITY_DURING_PROCESSING**, typically because two or more mutually exclusive restoration modes were supplied. Maximum items: 2 |
details.ambiguity_due_to[] | object | Each item | Represents a single ambiguity factor, identified by its API name and JSON path. Additional keys: not allowed |
details.ambiguity_due_to[].api_name | string | Optional | Represents the API name of the ambiguity factor. Maximum length: 100 |
details.ambiguity_due_to[].json_path | string | Optional | Represents the JSON path of the ambiguity factor within the request body. Maximum length: 1000 |
details.api_name | string | Optional | Represents the API name of the field that caused the error. Maximum length: 100 |
details.expected_data_type | string | Optional | Represents the data type expected for the offending field when the error is due to an invalid data type. Possible values: **jsonarray**, **jsonobject**, **string**. Known values: jsonarray, jsonobject, string |
details.expected_fields | array | Optional | List of fields that are expected in the request body when the error is **EXPECTED_FIELD_MISSING**. Maximum items: 3 |
details.expected_fields[] | object | Each item | Represents a single expected field, identified by its API name and JSON path. Additional keys: not allowed |
details.expected_fields[].api_name | string | Optional | Represents the API name of the expected field. Maximum length: 100 |
details.expected_fields[].json_path | string | Optional | Represents the JSON path of the expected field within the request body. Maximum length: 1000 |
details.id | string | Optional | Represents the record identifier associated with the error. Format: int64 |
details.json_path | string | Optional | Represents the JSON path to the request body field that caused the error. Maximum length: 1000 |
details.param_name | string | Optional | Represents the name of the request parameter that caused the error. Possible values: **filters**, **ids**. Known values: filters, ids |
details.param_names | array | Optional | List of request parameter names that are expected but missing when the error is **EXPECTED_PARAM_MISSING**. Maximum items: 2 |
details.param_names[] | string | Each item | Name of an expected request parameter that was not supplied. Possible values: **filters**, **ids**, **restore_all_records**. Known values: filters, ids, restore_all_records |
details.resource_path_index | JSON | Optional | |
details.resource_path_index (anyOf 1) | integer | Alternative | Represents the zero-based index of the resource path segment that caused the error. Format: int32 |
details.resource_path_index (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
message | string | Required within parent | Message that describes the cause of the error. Maximum length: 500 |
status | string | Required within parent | Indicates that the API request failed. Possible values: **error**. Known values: error |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: zoho.restorerecyclebinrecords. Catalog operation: restoreRecycleBinRecords. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.