# Members

> Requires owner or admin.

Source: https://warmerly.com/docs/workspaces/members

## Change a member's role

```text
PATCH /workspaces/{id}/members/{userId}
```

Requires `owner` or `admin`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `role` | `"owner"` \\| `"admin"` \\| `"member"` | Yes | New role for the member. |

```bash
curl https://app.warmerly.com/api/v1/workspaces/8f14e45f-ceea-4c6a-8c8d-6b1a5b5c9c1a/members/3c2b1a09-... \
  -X PATCH \
  -H "X-Api-Key: wmv_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "role": "admin" }'
```

```json
{ "ok": true }
```

Notes:

- Only an `owner` may set `role: "owner"`, doing so **transfers ownership**; the caller's own role becomes `admin`.
- An `admin` cannot change an `owner`'s role (`403 forbidden`).
- An invalid or missing `role` returns `400 bad_request`, and a user who is not a member returns `404 not_found`.

## Remove a member

```text
DELETE /workspaces/{id}/members/{userId}
```

Requires `owner` or `admin` to remove another member. A member may remove *themselves* (leave the workspace) regardless of role, except the `owner`: the owner must transfer ownership or delete the workspace first (`400 bad_request`). A user who is not a member returns `404 not_found`.

An `owner` can never be removed by another member (`403 forbidden`).

```json
{ "ok": true }
```

## More from Workspaces & Projects

- [Workspaces](https://warmerly.com/docs/workspaces/workspaces): Returns every workspace you're a member of.
- [Invites](https://warmerly.com/docs/workspaces/invites): Requires owner or admin.
- [Projects](https://warmerly.com/docs/workspaces/projects): A project hangs off a workspace and is what campaigns, mailboxes, and inbox data attach to via X-Project-Id.…
