---
title: "Deprovision a tenant or workspace"
method: POST
path: "/provision/deprovision"
tags: ["Provisioning"]
---

# Deprovision a tenant or workspace

`POST /provision/deprovision`

## Request

- Base URL: `https://api.savanto.ai`
- URL: `https://api.savanto.ai/provision/deprovision`
- Auth: HTTP bearer

Tear down a tenant or single workspace. Supports two auth modes: admin (set tenantId in the body to deprovision any tenant) or tenant self-deprovision (authenticate with a tenant API key carrying tenant:admin; tenantId is derived from the auth context). Requires tenant:admin. Used by the Shopify app on app uninstall.

## Request body

- DeprovisionRequest
  - `tenantId` string: Required when authenticated as admin. Ignored when authenticated with a tenant API key (tenant:admin required) — the tenant is derived from the auth context.
  - `siteUrl` string: If provided, only this workspace is removed. Omit to fully deprovision the tenant (used by the Shopify app on uninstall).
  - `purgeData` boolean: When true, hard-deletes indexed data for the tenant/workspace.

## Response `200`

Tenant deprovisioned

- object
  - `object` 'deprovision', required
  - `requestId` string, required
  - `data` DeprovisionResult, required
    - `success` boolean, required
    - `message` string
    - `purge` object
      - `success` boolean
      - `openSearchDeleted` number
      - `dynamoDbDeleted` number

## Other responses

- `400`: Validation error
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `409`: Conflict
- `413`: Payload too large
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/savanto/apis/savanto-api.md) · [All operations](https://skmtc.dev/savanto/apis/savanto-api/llms.txt) · [OpenAPI document](https://skmtc.dev/savanto/apis/savanto-api/revisions/82437327a878?raw)
