# Change a member's role

`POST /v1/workspaces/{workspaceId}/members/{userId}/role`

Owners and admins can change roles. Only the owner can demote an admin. Making someone a guest removes them from every teamspace; they keep pages shared with them directly.

Scope: `docs:write`.

## Request

```bash
curl -X POST "https://api.lydie.co/v1/workspaces/01JCQ3TZ0WJ8K4M2X7T9R6N1PA/members/kG7qL2m9XzP4tR8w/role" \
  -H "Authorization: Bearer $LYDIE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "role": "admin"
  }'
```

## Path parameters

- `workspaceId` (string, required): (1–64 chars)
- `userId` (string, required): (1–64 chars)

## Body

- `role` (string, required): One of: `admin`, `member`, `guest`.

## Response

- `id` (string, required): (1–64 chars)
- `workspaceId` (string, required): (1–64 chars)
- `userId` (string, required): (1–64 chars)
- `role` (string, required): One of: `owner`, `admin`, `member`, `guest`.
- `name` (string, required)
- `email` (string, required)
- `image` (string, required, nullable)
- `createdAt` (timestamp, required)

```json
{
  "id": "string",
  "workspaceId": "01JCQ3TZ0WJ8K4M2X7T9R6N1PA",
  "userId": "kG7qL2m9XzP4tR8w",
  "role": "owner",
  "name": "Notes",
  "email": "ada@example.com",
  "image": null,
  "createdAt": "2026-11-12T09:30:00.000Z"
}
```

Errors use the envelope described at https://developers.lydie.co/errors.md.
