Skip to main content

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 (ownership SHARED_BY_ME in GET /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, from GET /api/v2/workspaces or POST /api/v2/workspace. A workspace shared with you (SHARED_WITH_ME) cannot be deleted: only its owner can.
  • Check the id twice. 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. A 404 after 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.

StatuserrorCodeWhen
400TW_ERR_500The X-API-Key value does not identify a TOM user.
401E401The X-API-Key header is missing or empty.
403AE_ERR_418The workspace is shared with you; only its owner can delete it.
404AE_ERR_417The workspace does not exist, is not visible to you, or was already deleted.
500GEN_ERR_500Unexpected error. Check GET /api/v2/workspaces before retrying.

Request​

Responses​

The workspace and everything it contained were deleted. The response has no body.