# Recycle Bin

## List deleted resources

> Returns all resources deleted within the last 30 days, across all\
> resource types. Each entry includes a \`model\` discriminator\
> (PascalCase singular, e.g. \`Connection\`) and a \`doc\` object\
> containing the full resource document as it existed at deletion\
> time.\
> \
> Returns \*\*204 No Content\*\* when the recycle bin is empty.

```json
{"openapi":"3.1.0","info":{"title":"Recycle Bin","version":"1.0.0"},"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}}},"paths":{"/v1/recycleBinTTL":{"get":{"operationId":"listRecycleBin","tags":["Recycle Bin"],"summary":"List deleted resources","description":"Returns all resources deleted within the last 30 days, across all\nresource types. Each entry includes a `model` discriminator\n(PascalCase singular, e.g. `Connection`) and a `doc` object\ncontaining the full resource document as it existed at deletion\ntime.\n\nReturns **204 No Content** when the recycle bin is empty.","responses":{"200":{"description":"Array of deleted resource entries.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["model","doc"],"properties":{"model":{"type":"string","description":"PascalCase singular resource type discriminator.","enum":["Connection","Flow","Export","Import","Script","Integration","Stack","FileDefinition","LookupCache","Tool","Api","McpServer","EDIProfile","Agent"]},"doc":{"type":"object","description":"The full resource document as it existed at deletion\ntime. Fields vary by resource type.","properties":{"_id":{"type":"string"},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"lastModified":{"type":"string","format":"date-time"}},"additionalProperties":true}}}}}}},"204":{"description":"Recycle bin is empty (no body returned)."},"401":{"$ref":"#/components/responses/401-unauthorized"}}}}}}
```

## List deleted resources by type

> Returns deleted resources of a specific type from the recycle bin\
> (last 30 days). Unlike the unfiltered endpoint, these entries\
> return the resource document directly — there is no \`model\`\
> wrapper.\
> \
> Returns \*\*204 No Content\*\* when there are no deleted resources of\
> this type.\
> \
> The \`\_resourceType\` parameter is \*\*case-insensitive\*\* — \`scripts\`,\
> \`Scripts\`, and \`SCRIPTS\` all resolve to the same collection.

```json
{"openapi":"3.1.0","info":{"title":"Recycle Bin","version":"1.0.0"},"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}}},"paths":{"/v1/recycleBinTTL/{_resourceType}":{"get":{"operationId":"listRecycleBinByType","tags":["Recycle Bin"],"summary":"List deleted resources by type","description":"Returns deleted resources of a specific type from the recycle bin\n(last 30 days). Unlike the unfiltered endpoint, these entries\nreturn the resource document directly — there is no `model`\nwrapper.\n\nReturns **204 No Content** when there are no deleted resources of\nthis type.\n\nThe `_resourceType` parameter is **case-insensitive** — `scripts`,\n`Scripts`, and `SCRIPTS` all resolve to the same collection.","parameters":[{"name":"_resourceType","in":"path","required":true,"schema":{"type":"string","enum":["connections","flows","exports","imports","scripts","integrations","stacks","filedefinitions","lookupcaches","tools","apis","mcpservers","ediprofiles","agents"]},"description":"Resource type slug. The enum values use lowercase plural form\nbut the parameter is case-insensitive. An unrecognised value\nreturns **403** with code `invalid_arguments`."}],"responses":{"200":{"description":"Array of deleted resource documents.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"lastModified":{"type":"string","format":"date-time"}},"additionalProperties":true}}}}},"204":{"description":"No deleted resources of this type (no body returned)."},"401":{"$ref":"#/components/responses/401-unauthorized"},"403":{"description":"The given resource type is not supported by the Recycle Bin.","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}}}}
```

## Get a deleted resource

> Returns the full document of a specific deleted resource from the\
> recycle bin. The response is a \*\*single object\*\* (not an array),\
> and may include fields that the list endpoints omit (e.g.\
> \`content\` on scripts, \`queues\` on connections).

```json
{"openapi":"3.1.0","info":{"title":"Recycle Bin","version":"1.0.0"},"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}}},"paths":{"/v1/recycleBinTTL/{_resourceType}/{_id}":{"get":{"operationId":"getRecycleBinResource","tags":["Recycle Bin"],"summary":"Get a deleted resource","description":"Returns the full document of a specific deleted resource from the\nrecycle bin. The response is a **single object** (not an array),\nand may include fields that the list endpoints omit (e.g.\n`content` on scripts, `queues` on connections).","parameters":[{"name":"_resourceType","in":"path","required":true,"schema":{"type":"string","enum":["connections","flows","exports","imports","scripts","integrations","stacks","filedefinitions","lookupcaches","tools","apis","mcpservers","ediprofiles","agents"]},"description":"Resource type slug (case-insensitive). An unrecognised value\nreturns **403** with code `invalid_arguments`."},{"name":"_id","in":"path","required":true,"schema":{"type":"string"},"description":"The resource ID (24-character hex string)."}],"responses":{"200":{"description":"The deleted resource document.","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"lastModified":{"type":"string","format":"date-time"}},"additionalProperties":true}}}},"400":{"description":"Invalid `_id` format.","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"403":{"description":"The given resource type is not supported by the Recycle Bin.","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"Resource not found in the recycle bin. May have been restored\nor permanently purged.","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}}}}
```

## Restore a deleted resource

> Restores a resource from the recycle bin back to the account's\
> active resources. Returns \*\*204 No Content\*\* on success — there\
> is no response body. Any request body is ignored.\
> \
> Returns \*\*404\*\* if the resource has already been restored or\
> permanently purged.

```json
{"openapi":"3.1.0","info":{"title":"Recycle Bin","version":"1.0.0"},"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}}},"paths":{"/v1/recycleBinTTL/{_resourceType}/{_id}":{"post":{"operationId":"restoreRecycleBinResource","tags":["Recycle Bin"],"summary":"Restore a deleted resource","description":"Restores a resource from the recycle bin back to the account's\nactive resources. Returns **204 No Content** on success — there\nis no response body. Any request body is ignored.\n\nReturns **404** if the resource has already been restored or\npermanently purged.","parameters":[{"name":"_resourceType","in":"path","required":true,"schema":{"type":"string","enum":["connections","flows","exports","imports","scripts","integrations","stacks","filedefinitions","lookupcaches","tools","apis","mcpservers","ediprofiles","agents"]},"description":"Resource type slug (case-insensitive). An unrecognised value\nreturns **403** with code `invalid_arguments`."},{"name":"_id","in":"path","required":true,"schema":{"type":"string"},"description":"The resource ID (24-character hex string)."}],"responses":{"204":{"description":"Resource restored successfully (no body returned)."},"400":{"description":"Invalid `_id` format.","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"403":{"description":"The given resource type is not supported by the Recycle Bin.","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"Resource not found in the recycle bin. It may have already been\nrestored or permanently purged.","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}}}}
```

## Permanently delete a resource

> Permanently deletes a resource from the recycle bin. This action\
> cannot be undone — the resource data is irrecoverably removed.\
> \
> Returns \*\*204 No Content\*\* on success. Returns \*\*404\*\* if the\
> resource has already been restored or purged.

```json
{"openapi":"3.1.0","info":{"title":"Recycle Bin","version":"1.0.0"},"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}}},"paths":{"/v1/recycleBinTTL/{_resourceType}/{_id}":{"delete":{"operationId":"deleteRecycleBinResource","tags":["Recycle Bin"],"summary":"Permanently delete a resource","description":"Permanently deletes a resource from the recycle bin. This action\ncannot be undone — the resource data is irrecoverably removed.\n\nReturns **204 No Content** on success. Returns **404** if the\nresource has already been restored or purged.","parameters":[{"name":"_resourceType","in":"path","required":true,"schema":{"type":"string","enum":["connections","flows","exports","imports","scripts","integrations","stacks","filedefinitions","lookupcaches","tools","apis","mcpservers","ediprofiles","agents"]},"description":"Resource type slug (case-insensitive). An unrecognised value\nreturns **403** with code `invalid_arguments`."},{"name":"_id","in":"path","required":true,"schema":{"type":"string"},"description":"The resource ID (24-character hex string)."}],"responses":{"204":{"description":"Resource permanently deleted (no body returned)."},"400":{"description":"Invalid `_id` format.","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"403":{"description":"The given resource type is not supported by the Recycle Bin.","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"Resource not found in the recycle bin. It may have already been\nrestored or permanently purged.","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}}}}
```

## Cascade-restore a deleted resource and its dependents

> Restores a resource from the recycle bin \*\*and\*\* all of its dependent\
> resources (child flows, exports, imports, connections, scripts, etc.).\
> Returns \*\*204 No Content\*\* on success — there is no response body. Any\
> request body is ignored.\
> \
> Supported \`resourceType\` values: \`flows\`, \`integrations\`, \`exports\`,\
> \`imports\`, \`connections\`, \`scripts\`, \`mcpServers\`. Passing an unsupported\
> value returns \*\*403\*\* with code \`invalid\_arguments\`.

```json
{"openapi":"3.1.0","info":{"title":"Recycle Bin","version":"1.0.0"},"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}},"404-not-found":{"description":"Not found. The requested resource does not exist or is not visible to the caller.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}}},"paths":{"/v1/recycleBinTTL/{resourceType}/{_id}/doCascadeRestore":{"post":{"operationId":"cascadeRestoreRecycleBinResource","tags":["Recycle Bin"],"summary":"Cascade-restore a deleted resource and its dependents","description":"Restores a resource from the recycle bin **and** all of its dependent\nresources (child flows, exports, imports, connections, scripts, etc.).\nReturns **204 No Content** on success — there is no response body. Any\nrequest body is ignored.\n\nSupported `resourceType` values: `flows`, `integrations`, `exports`,\n`imports`, `connections`, `scripts`, `mcpServers`. Passing an unsupported\nvalue returns **403** with code `invalid_arguments`.","parameters":[{"name":"resourceType","in":"path","required":true,"schema":{"type":"string","enum":["flows","integrations","exports","imports","connections","scripts","mcpServers"]},"description":"Resource type slug. Only the values listed above support cascade\nrestore. An unsupported value returns **403** with code\n`invalid_arguments`."},{"name":"_id","in":"path","required":true,"schema":{"type":"string"},"description":"The resource ID (24-character hex string)."}],"responses":{"204":{"description":"Resource and all dependents restored successfully (no body returned)."},"401":{"$ref":"#/components/responses/401-unauthorized"},"403":{"description":"The given resource type does not support cascade restore.","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"$ref":"#/components/responses/404-not-found"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.celigo.com/api/api-reference/recycle-bin.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
