> ## 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.

# Update workspace member

> Edit a member's access or profile fields, with two capability tiers

## Overview

`useUpdateWorkspaceMember` returns a callable that edits a direct [member](/v8/data-models/workspace-member) of a workspace.

**Authorization:** capability-gated + rank-bounded, in **two tiers by field sensitivity**:

* **Powerful fields** (`capabilities`, `permissions`, and rank — as either `rank` or `relativeRank`) require **`edit-member-access`**, plus the [rank rule](/v8/data-models/workspace-member#rank-semantics) and the [no-escalation](/v8/data-models/workspace-member#no-privilege-escalation) guard.
* **Cosmetic fields** (`title`, `metadata`) require only **`edit-member-profile`**. A member editing **their own `title`** needs no capability at all.

**Grant vs strip asymmetry:** you may only *add* a capability/permission you hold on the target node (resolved set, including via reach); *stripping* is governed by rank alone.

**Rank moves in either coordinate** — `rank` (absolute) or `relativeRank` (an offset from you), never both. Omitting **both** means **rank unchanged**: unlike the invite hook there is no value default here, so editing someone's capabilities never quietly moves them on the ladder. See [choosing a rank](/v8/sdk/workspaces/overview#choosing-a-rank).

## Usage Example

```tsx theme={null}
import { useUpdateWorkspaceMember } from "@sublay/react-js";

function MemberRow({
  workspaceId,
  targetUserId,
}: {
  workspaceId: string;
  targetUserId: string;
}) {
  const updateWorkspaceMember = useUpdateWorkspaceMember();

  const promote = async () => {
    const member = await updateWorkspaceMember({
      workspaceId,
      targetUserId,
      capabilities: ["view", "invite"],
      // Absolute. Use `relativeRank: 1` instead for "one rung below me",
      // or omit both to change capabilities without touching the ladder.
      rank: 3,
    });
    console.log("Updated:", member.id);
  };
}
```

## Parameters

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

<ParamField path="targetUserId" type="string" required>
  The **target** member's user id — a path param, not an acting user.
</ParamField>

<ParamField path="capabilities" type="WorkspaceCapability[]">
  New capability set (powerful — `edit-member-access`).
</ParamField>

<ParamField path="permissions" type="string[]">
  New opaque permission set (powerful — `edit-member-access`).
</ParamField>

<ParamField path="rank" type="number">
  New **absolute** rank, `0` – `2147483647` (powerful — `edit-member-access` + rank rules). Mutually exclusive with `relativeRank`; omitting both leaves rank unchanged.
</ParamField>

<ParamField path="relativeRank" type="number">
  New rank as an **offset from you**: `1` = one rung below me. Must be `1` – `2147483647`. Anchored on your own rank if you hold a member row on this workspace, apex otherwise. Resolved to an absolute number at write time and frozen — a **snapshot**, not a link to your rank. The resolved value is bounded too, so an offset that overflows once anchored is a `400`. No default: omitting both rank fields leaves rank unchanged.
</ParamField>

<ParamField path="title" type="string | null">
  New cosmetic title (`edit-member-profile`, or self for your own title).
</ParamField>

<ParamField path="metadata" type="Record<string, any>">
  New cosmetic metadata (`edit-member-profile`).
</ParamField>

## Returns

Returns the updated [WorkspaceMember](/v8/data-models/workspace-member) object.

## Error codes

| Code | Status | Meaning |
| - | - | - |
| `workspace/unauthorized` | 403 | You lack the capability tier for a field you touched. |
| `workspace/insufficient-rank` | 403 | Two rules share this code: you may only **manage** members ranked strictly below you, and you may only **set** ranks strictly below your own. The second is also what refuses `rank: 0` to anyone holding a row on this workspace — there is no separate rank-0 guard. |
| `workspace/no-escalation` | 403 | You tried to grant a capability/permission you do not hold. |

## Related

* [`useRemoveWorkspaceMember`](/v8/hooks/workspaces/use-remove-workspace-member)
* [Update Member API](/v8/api-reference/workspaces/members/update-member)


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