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

# Approve member

> Approve a pending membership request

## Overview

`useApproveMember` returns a callable function for approving a pending join request. Sets the membership status from `"pending"` to `"active"`. Requires the caller to be a moderator or admin.

## Usage Example

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

function PendingMemberRow({ spaceId, memberId }: { spaceId: string; memberId: string }) {
  const approve = useApproveMember();

  return (
    <button onClick={() => approve({ spaceId, memberId })}>
      Approve
    </button>
  );
}
```

## Parameters

**spaceId** `string` *required*

UUID of the space.

**memberId** `string` *required*

UUID of the membership record to approve.

## Returns

**message** `string`

Confirmation message.

**membership** `object`

Updated membership with `id`, `status: "active"`, and `joinedAt`.


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