Delete a workspace
DELETE/api/v2/workspace/:workspaceId
Deletes a workspace you own, together with everything it contains, and answers 204 without a body.
The deletion is physical and irreversible: there is no recycle bin and nothing can be restored afterwards. It is the same deletion the TOM web application performs.
What is deleted
- All the elements of the workspace: tabulations, Reach tables, targets, user variables, saved evaluations and any other element.
- The workspace menu and its folders.
- The surveys attached to the workspace, its settings and its survey groups.
- Its shares. If the workspace was shared (
ownershipSHARED_BY_MEinGET /api/v2/workspaces), the users it was shared with lose access to it without any notice.
Before you call it
workspaceId: a workspace you own, fromGET /api/v2/workspacesorPOST /api/v2/workspace. A workspace shared with you (SHARED_WITH_ME) cannot be deleted: only its owner can.- Check the
idtwice. Nothing asks for confirmation.
Behaviour
- No dependencies are checked. Elements that other workspaces or users reference (for example a saved target used elsewhere) are deleted with the workspace.
- Repeating a deletion that already succeeded answers
404, whenever you repeat it. A404after a retry means the workspace is gone. - The same answer is given for a workspace that does not exist, that is not visible to you and that was already deleted, so the existence of other users' workspaces is not revealed.
- It does not require any application module: owning the workspace is enough.
Errors
errorMessage is meant for people and may change. Base your error handling on errorCode.
| Status | errorCode | When |
|---|---|---|
| 400 | TW_ERR_500 | The X-API-Key value does not identify a TOM user. |
| 401 | E401 | The X-API-Key header is missing or empty. |
| 403 | AE_ERR_418 | The workspace is shared with you; only its owner can delete it. |
| 404 | AE_ERR_417 | The workspace does not exist, is not visible to you, or was already deleted. |
| 500 | GEN_ERR_500 | Unexpected error. Check GET /api/v2/workspaces before retrying. |
Request
Responses
- 204
- 400
- 401
- 403
- 404
- 500
The workspace and everything it contained were deleted. The response has no body.
The X-API-Key value does not identify a TOM user (TW_ERR_500).
The X-API-Key header is missing or empty.
The workspace is shared with the user: only its owner can delete it (AE_ERR_418).
The workspace does not exist, is not visible to the user, or was already deleted (AE_ERR_417). The answer is the same in the three cases.
Unexpected error.