# Delete a Workspace's data

## DELETE `/v1/workspaces/{id}`

Deletes everything an ARCHIVED Workspace holds: its experiences, uploaded documents, extracted claims, engrams, registry items, Connectors and their keys, and memberships. The Workspace's id stays reserved and its access audit is kept. Each call works for a bounded time; repeat it while it answers 202. Requires a person's sign-in with the organization owner or admin role; an API key is refused. Not reversible.

## Authentication

Use a person's Bearer access token or console session. See [Authentication](https://augenta.pages.dev/docs/authentication.md).

## Request example

```bash
curl --fail-with-body -X DELETE "https://api.augenta.ai/v1/workspaces/$AUGENTA_WORKSPACE_ID" \
  -H "Authorization: Bearer $AUGENTA_ACCESS_TOKEN"
```

## Parameters

<a id="request-parameters-id"></a>

### `request.parameters.id`

`string` · required

path parameter.

Min length: `1`.

## Response 200

Every store reads zero for this Workspace. A repeat answers the same.

Content-Type: `application/json`

```json
{
  "workspaceId": "ws-research",
  "status": "deleted",
  "pending": [],
  "counts": {
    "lake": 5744,
    "documents": 12,
    "cog.experience_nodes": 10942,
    "experience_arrivals": 5744,
    "workspace_members": 3
  }
}
```

<a id="response-200-workspaceid"></a>

### `response.200.workspaceId`

`string` · always present

<a id="response-200-status"></a>

### `response.200.status`

`string` · always present

`deleting`: call again (see `Retry-After`). `deleted`: every store reads zero for this Workspace.

Allowed values: `"deleting"`, `"deleted"`.

<a id="response-200-counts"></a>

### `response.200.counts`

`object` · always present

What has been deleted so far, by store and table, summed across calls. Counts only, never content.

<a id="response-200-pending"></a>

### `response.200.pending`

`array<string>` · always present

The stores this call left unfinished. Empty once deleted.

## Response 202

Deleting; call again.

Content-Type: `application/json`

```json
{
  "workspaceId": "ws-research",
  "status": "deleting",
  "pending": [
    "lake"
  ],
  "counts": {
    "lake": 5744,
    "documents": 12,
    "cog.experience_nodes": 10942,
    "experience_arrivals": 5744,
    "workspace_members": 3
  }
}
```

Response fields use the same schema as Response 200.

## Response 401

`unauthenticated`: missing, invalid or revoked credential.

Content-Type: `application/json`

<a id="response-401-error"></a>

### `response.401.error`

`object` · always present

<a id="response-401-error-code"></a>

### `response.401.error.code`

`string` · always present

Stable. The Errors page lists every code.

<a id="response-401-error-message"></a>

### `response.401.error.message`

`string` · always present

Human-readable. May change; don't parse it.

<a id="response-401-error-retryable"></a>

### `response.401.error.retryable`

`boolean` · always present

<a id="response-401-error-retryafterseconds"></a>

### `response.401.error.retryAfterSeconds`

`integer` · conditional

Capacity retry interval, also present as Retry-After before stream headers commit. SSE error events retain this field after HTTP 200 is committed.

Minimum: `1`.

<a id="response-401-error-billingurl"></a>

### `response.401.error.billingUrl`

`string` · conditional

Top-up action when error.code is insufficient_balance (HTTP 402).

<a id="response-401-requestid"></a>

### `response.401.requestId`

`string` · always present

The request's id, as in the `X-Request-Id` response header.

## Response 403

`forbidden`: an API key, or a person who is not an organization owner or admin.

Content-Type: `application/json`

Response fields use the same schema as Response 401.

## Response 404

`workspace_not_found`: no Workspace with this id in your organization.

Content-Type: `application/json`

Response fields use the same schema as Response 401.

## Response 409

`workspace_not_archived`: archive it first (`POST /v1/workspaces/{id}/archive`). `conflict`: a personal Default Workspace, which is deleted with its organization.

Content-Type: `application/json`

```json
{
  "error": {
    "code": "workspace_not_archived",
    "message": "archive workspace \"ws-research\" before deleting its data",
    "retryable": false
  },
  "requestId": "req_7f9c2b1e-6d0a-4b7e-9a51-2f0c8e7d4a10"
}
```

Response fields use the same schema as Response 401.

## Response 500

`internal_error`: an unexpected failure; quote the `requestId`.

Content-Type: `application/json`

Response fields use the same schema as Response 401.

## Response 503

`service_unavailable` (retryable): the memory service did not answer; what was deleted is kept, so call again. `service_unconfigured`: this environment cannot delete Workspace data. `workos_unavailable` (retryable).

Content-Type: `application/json`

Response fields use the same schema as Response 401.
