Skip to content

Bulk delete integrated accounts


You can use this endpoint to delete multiple integrated accounts matching a given filter. The deleting happens asynchronously and the results are sent via webhooks which are subscribed to the following events --

  • batch_job:completed
  • batch_job:dry_run_completed
  • batch_job:failed
  • batch_job:dry_run_failed

You can also specify a dry_run attribute in the request body to perform a dry run of the batch job. In a dry run, the integrated accounts are not deleted, but the results are sent via the webhooks.

Examples

Deleting all integrated accounts for a tenant with ID acme-1 --

json
{
  "query": {
    "tenant_id": "acme-1"
  }
}

Deleting all integrated accounts for a tenant not in active state --

json
{
  "query": {
    "tenant_id": "acme-1",
    "status": {
      "ne": "active"
    }
  }
}

Deleting all Notion integrated accounts using SuperQuery --

json
{
  "query": {
    "integration.name": "notion",
    "features.super_query": {
      "in": ["apac", "wnam"]
    }
  }
}

Deleting all integrated accounts which either are not active or match a specific tenant pattern --

json
{
  "query": {
    "or": [
      {
        "status": {
          "ne": "active"
        }
      },
      {
        "tenant_id": {
          "like": "%demo%"
        }
      }
    ]
  }
}

Endpoint

http
POST /integrated-account/bulk-delete

Request Body

query
object
REQUIRED · 

The query to filter the integrated accounts by. This supports the same set of filters as the List endpoint. Specify the filters as an object.

Example: { "tenant_id": "acme-1" }
dry_run
boolean

Whether to perform a dry run of the batch job or not. In a dry run, the integrated accounts are not deleted, but the results are sent via the webhooks.

Response Body

success
boolean
Example: true