Delete a sub-account
cooper_delete_workspaceUse this when a parent should remove a sub-account, its API key, and its mail. Requires auth. Destructive. Inputs: workspace_id (required), delete_inboxes (optional boolean). Returns {id, deleted:true, inboxes_deleted}. When the workspace still has inboxes and delete_inboxes is not true, the call returns 409 workspace_not_empty and deletes nothing. delete_inboxes true returns 409 owner_required and deletes nothing when any inbox is in approval mode, until that owner confirms deletion. Otherwise it removes those inboxes, their messages, attachments, owners, and tasks, then the workspace API keys, OAuth tokens, webhooks, domains, and the child account. 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. An inbox-scoped key returns 403 permission_denied.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspace_id | Yes | Workspace id (ws_…) created by this parent account | |
| delete_inboxes | No | Required when the workspace still has inboxes. true deletes those inboxes. Omit it and a non-empty workspace returns 409 workspace_not_empty. |