> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sublay.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Remove Member

> Remove a member (rank-bounded; sole-owner protected)

Removes a member from a workspace. Requires the `remove-member` capability and is **rank-bounded** (act only on strictly-lower ranks). Fires `workspace.member.removed`.

<Note>
  Owners have no member row, so removal targets member rows only. **Sole-owner protection:** the owner cannot be removed while sole owner — they must transfer ownership first.
</Note>

## Path Parameters

<ParamField path="id" type="string" required>
  The workspace UUID.
</ParamField>

<ParamField path="userId" type="string" required>
  The member to remove.
</ParamField>

## Body Parameters

<ParamField body="actingUserId" type="string" required>
  Service/master keys only — the **acting** user (sent in the body so the act-as-user path works on `DELETE`; the path `:userId` is the target). **Required for a key:** this route has no unbounded path, so a key that names nobody is refused with `400 workspace/missing-user-id`. The `remove-member` capability and the rank bound are enforced against the named user — act as the **owner** for an unrestricted removal.

  A plain user token omits it — the actor is the token's own user. The field is **not** ignored for such a token: sending your *own* user id is a harmless no-op, but sending **anyone else's** is a `403 workspace/unauthorized`. See [Acting on behalf of a user](/v8/sdk/workspaces/overview#acting-on-behalf-of-a-user).
</ParamField>

## Response

`204 No Content` on success.

## Error Responses

<AccordionGroup>
  <Accordion title="Insufficient Rank — 403">
    ```json theme={null}
    { "error": "You may only remove members ranked strictly below you.", "code": "workspace/insufficient-rank" }
    ```
  </Accordion>

  <Accordion title="Sole Owner — 409">
    ```json theme={null}
    { "error": "The workspace owner cannot be removed. Transfer ownership first.", "code": "workspace/sole-owner" }
    ```
  </Accordion>

  <Accordion title="Missing Acting User — 400">
    ```json theme={null}
    { "error": "Missing user ID", "code": "workspace/missing-user-id" }
    ```

    A service/master key called this route without naming an `actingUserId`. Removal is rank-bounded against the remover's own standing, so it must be performed *as* somebody — act as the owner for an unrestricted removal.
  </Accordion>

  <Accordion title="Acted as Another User — 403">
    ```json theme={null}
    { "error": "Unauthorized", "code": "workspace/unauthorized" }
    ```

    A plain user token sent an `actingUserId` naming a **different** user. Only a service/master key may act as someone else.
  </Accordion>

  <Accordion title="Invalid Path Parameter — 400">
    ```json theme={null}
    { "error": "Invalid workspace id: expected a UUID.", "code": "workspace/invalid-params" }
    ```

    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.
  </Accordion>
</AccordionGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.