---
title: "Erase a tenant"
method: DELETE
path: "/v1/workspaces/{workspaceId}/tenants/{id}"
tags: ["TenantService", "Tenants"]
---

# Erase a tenant

`DELETE /v1/workspaces/{workspaceId}/tenants/{id}`

Destroys the tenant, its subjects, every objective associated with it and everything reachable from those objectives, and its widget sessions. This is the full erasure hammer, wider than `DELETE /widget_sessions`, which removes only what widget sessions created. The work runs in the background: this returns the tenant in STATE_ERASING rather than a count of what was removed, since a large tenant's history cannot be destroyed inside a request. Poll the tenant to follow it — STATE_ERASING while it runs, NotFound once it finishes. Erasure is terminal; a tenant cannot be recovered once it starts.

## Path parameters

- `workspaceId` string, required
- `id` string, required

## Response `200`

OK

- Tenant — Tenant is the customer's organization as a readable record rather than an echo. It carries no spec: a tenant is never configured, only asserted, so everything about it lives in the metadata envelope — `external_id` is the key the customer asserted it under, `name` is the most recent name they asserted, and `updated_at` is therefore when the tenant was last asserted.
  - `metadata` ResourceMetadata, required — Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
    - `id` string, required — Unique identifier for the resource (prefixed ULID, e.g., "agent_01HXK...")
    - `accountId` string, required — Account this resource belongs to for multi-tenant isolation (prefixed ULID)
    - `workspaceId` string, required — Workspace this resource belongs to for organizational grouping (prefixed ULID)
    - `name` string, required — Human-readable name for the resource (e.g., "Customer Support Agent", "Email Tool") Required for resources that users interact with directly
    - `externalId` string — External ID for the resource (e.g., a workflow ID from an external system)
    - `labels` object — Key-value pairs for categorization and filtering. Values are 0-63 alphanumeric characters with "-", "_", or "." allowed between; keys follow the same shape and additionally accept an optional DNS-subdomain prefix (e.g. "cadenya.com/") of at most 253 characters. Examples: {"environment": "production", "team": "platform", "version": "v2"}
    - `profileId` string, required — ID of the actor (user or service account) that created this resource
    - `createdAt` string, date-time, required — Timestamp when this resource was created
    - `updatedAt` string, date-time — Timestamp when this resource was last updated
  - `info` TenantInfo — TenantInfo provides read-only server-derived data about a tenant.
    - `subjectCount` integer — Number of subjects asserted under this tenant.
    - `objectiveCount` integer — Number of objectives associated with this tenant, across every surface — widget conversations and objectives created directly against the API alike. This is the footprint a delete would destroy, which is why it is worth the count query that populating `info` costs.
    - `widgetSessionCount` integer — Number of widget sessions minted for this tenant that still exist.
  - `state` 'STATE_UNSPECIFIED' | 'STATE_ACTIVE' | 'STATE_ERASING', enum, required — The current lifecycle state of the tenant. Output only.

## Other responses

- `default` — Default error response

---

[API](https://skmtc.net/cadenya/apis/cadenya-api.md) · [All operations](https://skmtc.net/cadenya/apis/cadenya-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cadenya/cadenya-api/versions/ac1a7f084068/schema)
