Skip to main content
Delete Space
Permanently deletes a space. All entities, members, child spaces, rules, and reports belonging to the space are also deleted. The reputation users earned in the space and its sub-spaces is removed from their totals (see Reputation). Only the space’s owner (its userId) can perform this action: for a top-level space, the user who created it; for a sub-space, the root space’s creator. Whoever created a sub-space is its admin, not its owner, so they can’t delete it unless they also own the root space. The owner can’t delete it while they are banned from the space or from a space above it. A service key must name the user it acts as in actingUserId; the request then behaves exactly as that user’s own token.
This operation is irreversible. All associated data including child spaces will be permanently deleted.

Path Parameters

string
required
UUID of the space to delete.

Query Parameters

string
Required with a service key: the user this request acts as. The request behaves exactly as that user’s own token, so it is refused unless they own the space and are not banned from it or from a space above it. Sent in the query; a request with a body is refused (400 space/body-not-allowed). A user token always acts as its own user and must not send it (400 space/acting-user-not-allowed).

Response

204 No Content on success, with no body.

Error Responses

Returned when spaceId isn’t a valid UUID. Checked before sign-in, permissions and the endpoint’s other checks.
A user token sent actingUserId, even naming its own user. Only a service key names the user it acts as; a user token always acts as its own user.
The request carried a body. A DELETE takes no body: send actingUserId in the query string.
Returned when a service key names an actingUserId that isn’t a user in this project.
actingUserId is not a user id.
A service key sent no actingUserId in the query.
The space doesn’t exist, or the caller doesn’t own it and can’t see it (see Space visibility).
The caller (or the user named by actingUserId) isn’t the space’s owner: its creator for a top-level space, the root space’s creator for a sub-space.
The owner (or the user named by actingUserId) is banned from the space, or from a space above it.
See also: useDeleteSpace