Delete a workspace
Deletes a workspace the account owns, the one the key or the app belongs to or another one, with everything in it, and cancels its plan.
Runs the real call on your workspace.
DELETE /workspaces/{id}
Deletes a workspace the account owns, the one the key or the app belongs to or another one, with everything in it, and cancels its plan.
Example
Needs account:write. confirm is the name of the workspace, as the app asks the person to type it before deleting. Letter case and the spaces around it do not matter.
curl -X DELETE "$API/workspaces/6d2f8a41-9c3e-4b7a-8e15-2f0c9d4b7a63?confirm=Acme%20Support" -H "$AUTH"{ "object": "workspace", "id": "6d2f8a41-9c3e-4b7a-8e15-2f0c9d4b7a63", "deleted": true, "activeWorkspaceId": "10417196-e324-4283-af98-66ec62167c47"}It is for good: the domains, addresses, mail, members and keys of the workspace go with it. A key that deletes its own workspace stops working, and one that deletes another workspace goes on as before.
The id is the workspace the key or the app belongs to, or another one the account owns, as GET /workspaces lists them, so a program that made workspaces with POST /workspaces deletes them the same way. An access token acting for a member is refused with 403 owner_only, and a key or an app limited to particular addresses or domains with 422 capability_unsupported.
Another workspace takes a key with no role and no address or domain limit, made by the owner it acts for, or an app the owner connected with every address, or the call is a 403 beyond_caller_authority on id. That workspace keeps its own rules: one that requires two-factor sign-in while the owner has no second factor is a 403 two_factor_required, a suspended one a 403 workspace_suspended, and a workspace the account does not own a 404.
The first workspace an account made cannot be deleted (409 first_workspace), so delete the whole account in the app instead. One with a domain being moved into or out of it is a 409 domain_moving.
A wrong or missing confirm is a 422 invalid_parameter on confirm, and the message names the workspace.
An OAuth access token needs a verification code for this call. Until the app has verified one in the last 60 minutes, the call answers 403 step_up_required and changes nothing. An API key is never asked. The Authentication page shows how to ask for a code and verify it.