# Remove a member

`DELETE /api/v1/workspaces/{workspaceId}/members/{userId}`

Removes a member from the workspace (owner or admin), or lets a member leave. The owner cannot be removed.

Sign-in: a dashboard session only. API tokens and OAuth sign-ins get `403 token.not_allowed`.

Section: Members and invites. Operation id in openapi.json: `remove_member`.

## Parameters

| Name | In | Required | Type | Description |
|---|---|---|---|---|
| `workspaceId` | path | yes | string (uuid) | The workspace's id. |
| `userId` | path | yes | string (uuid) | The member's user id. |

## Responses

Errors are `application/problem+json` (`Problem`); branch on `type`.

### 204

Removed.

### 400

Bad Request.

- `auth.credentials_conflict`: the request carries both a session cookie and a token

### 401

Unauthorized.

- `auth.unauthenticated`, `auth.session_expired`: no session, or it ended
- `token.invalid`: the token is malformed, unknown, revoked or expired, or its creator left the workspace

### 403

Forbidden.

- `auth.forbidden`: your role is too low for this
- `token.not_allowed`: this operation needs a signed-in session; tokens cannot call it
- `request.origin_mismatch`, `request.header_required`: a changing request with a session comes from another site or lacks `X-Monitorly-Request: 1`

### 404

Not Found.

- `request.not_found`: it does not exist, or you cannot see it

### 409

Conflict.

- `member.owner_protected`: the owner cannot be demoted or removed; only transfer is possible

### 429

Too Many Requests.

- `session.rate_limited`: more than 5 changes a second from your sessions

Schemas named above are listed with their fields in [the schema list](https://docs.monitorly.cloud/api/reference/schemas.md).
