Skip to main content
Leave Workspace
Removes the caller’s own membership on this node only (self-service, no capability). Leaving a parent while still owning a child is fine — ownership is independent of membership. Fires workspace.member.removed.
An owner is not a member and cannot leave via this path — an owner exits by transferring ownership or deleting the workspace. Sole-owner protection blocks a sole owner from leaving without transferring first. If the caller has no direct member row here (only reaches in from an ancestor), leave is a no-op / 404.

Path Parameters

string
required
The workspace UUID.

Query Parameters

string
required
Service keys only — the user to act as, whose membership is removed. Required for a key: leaving is inherently self-service, so a key that names nobody is refused with 400 workspace/missing-user-id.A user token always acts as its own user and must not send it (400 workspace/acting-user-not-allowed). See Acting on behalf of a user.

Response

204 No Content on success.

Error Responses

The workspace doesn’t exist, or the acting user can’t see it (no relation to it at all: not a member, not an owner, no reach from an ancestor), including when it was deleted while this request was being handled. A workspace you can’t see answers exactly like one that doesn’t exist.
The acting user can see the workspace but has no direct member row on it (for example, they only reach in from an ancestor), so there is nothing to leave.
A service key called this route without naming an actingUserId. Leaving removes your own membership row; there is none for the app itself. To remove somebody else, use Remove Member.
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.
A DELETE takes every field, actingUserId included, in the query string, so any request body is refused: a JSON object with keys, a non-empty array, or a non-JSON payload such as multipart (then params is omitted). An absent body and {} pass.
Returned when a service key names an actingUserId that isn’t a user in this project.
Every path id on the workspaces bundle is checked for UUID shape before the route runs, so a malformed one is a plain 400 rather than a 500 from the database.