> ## Documentation Index
> Fetch the complete documentation index at: https://docs.replyke.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update member role

> Update a member's role within a space

## Overview

`useUpdateMemberRole` returns a callable function for changing a space member's role. Only admins can update roles.

## Usage Example

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

function RoleSelector({ spaceId, memberId }: { spaceId: string; memberId: string }) {
  const updateRole = useUpdateMemberRole();

  return (
    <select onChange={(e) => updateRole({ spaceId, memberId, role: e.target.value as any })}>
      <option value="member">Member</option>
      <option value="moderator">Moderator</option>
      <option value="admin">Admin</option>
    </select>
  );
}
```

## Parameters

<ParamField path="spaceId" type="string" required>
  UUID of the space.
</ParamField>

<ParamField path="memberId" type="string" required>
  UUID of the membership record to update.
</ParamField>

<ParamField path="role" type="&#x22;admin&#x22; | &#x22;moderator&#x22; | &#x22;member&#x22;" required>
  The new role to assign.
</ParamField>

## Returns

<ResponseField name="message" type="string">
  Confirmation message.
</ResponseField>

<ResponseField name="membership" type="object">
  Updated membership with `id`, `role`, `status`, `joinedAt`, and `userId`.
</ResponseField>
