---
title: Update a member role
description: Changes a member's role.
doc_version: 0.1.0-preview
last_updated: 2026-09-14
---

# Update a member role

`PATCH /v1/workspaces/{workspaceId}/members/{memberId}`

Changes a member's role. Requires an admin key. The last admin cannot become a viewer or editor.

## Authentication

Send `Authorization: Bearer <SPARK_API_KEY>`. Read the key from the
SPARK_API_KEY environment variable. Never print it.

## Path parameters

- `workspaceId` (string) — The workspace id.
- `memberId` (string) — The membership id.

## Request body

- `role` (string) — New role for the member. One of: viewer, editor, admin.

## Example request

```bash
curl --request PATCH \
  --url "https://api.beta.graphon.ai/v1/workspaces/wspQ7WsH2Np5L/members/memA1b2C3d4E5" \
  --header "Authorization: Bearer $SPARK_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"role":"editor"}'
```

## Example response

```json
{
  "id": "memA1b2C3d4E5",
  "workspaceId": "wspQ7WsH2Np5L",
  "userId": "usrB2c3D4e5F6",
  "displayName": "Ada Lovelace",
  "email": "ada@example.com",
  "role": "admin",
  "status": "active",
  "joinedAt": "2026-09-14T18:00:00.000Z",
  "revision": 1
}
```

## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
