# DELETE /api/v1/workspaces/:id

Auth: Bearer

HTML: https://cooperemail.com/docs/reference/workspaces-delete

## Summary

Remove a sub-account. When it still has inboxes, the call returns 409 workspace_not_empty unless delete_inboxes=true. That flag deletes direct inboxes, their messages, attachments, owners, and tasks, then the workspace API keys, OAuth tokens, webhooks, domains, and the child account. An approval inbox returns 409 owner_required and deletes nothing until its owner confirms. The response is {id, deleted:true, inboxes_deleted}. The child key then returns 401. Parent plan usage no longer counts that sub-account. Another parent's workspace returns 404 workspace_not_found. A sub-account key returns 403 permission_denied. Held message bodies stay withheld until release, and a suppressed address still cannot be mailed. MCP: cooper_delete_workspace.

## Request

This call has no JSON body.

## Response

HTTP 200. Sample values illustrate the schema.

```json
{
  "id": "inb_example",
  "deleted": true,
  "inboxes_deleted": 1
}
```

## Errors

- HTTP 409 workspace_not_empty
- HTTP 409 owner_required
- HTTP 404 workspace_not_found
- HTTP 403 permission_denied

The live `message` is the sentence for that code. Branch on `code`.

```json
{
  "error": {
    "type": "conflict",
    "code": "workspace_not_empty",
    "docs_url": "https://cooperemail.com/docs#workspace_not_empty"
  }
}
```

## Idempotency

This route does not document Idempotency-Key or client_id.
