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

# Unban Member

> Unban a previously banned member

Sets a banned member's status back to `"active"`, in this space and in the child spaces where they are banned (a ban covers child spaces, and so does lifting it). A request that was pending or rejected in a child space before the ban stays as it was. Unbanning makes the person an active member of this space even if they were never approved, for example when their request was still pending at the time of the ban. The member gets each space's chat back the next time they open it. Requires the caller to be a moderator or admin. Moderators can only unban regular members, not other moderators or admins. Only the **space creator** (or a service or master key) can unban an admin, as only they can ban one.

## Path Parameters

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

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

## Response

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

<ResponseField name="membership" type="object">
  The updated membership record with `status: "active"`.
</ResponseField>

## Error Responses

<AccordionGroup>
  <Accordion title="Not Found — 404">
    ```json theme={null}
    { "error": "Banned membership not found.", "code": "space/membership-not-found" }
    ```
  </Accordion>

  <Accordion title="Banned in a Parent Space — 409">
    The member is still banned in a parent of this space. Lift that ban first; `bannedSpaceIds` lists where.

    ```json theme={null}
    { "error": "This member is banned in a parent of this space. Lift that ban first.", "code": "space/banned-in-parent", "bannedSpaceIds": ["…"] }
    ```
  </Accordion>

  <Accordion title="Insufficient Permissions — 403">
    A moderator unbanning someone who is a moderator or admin in this space or in one of the child spaces the unban covers.

    ```json theme={null}
    { "error": "Moderators can only unban regular members.", "code": "space/insufficient-permissions" }
    ```
  </Accordion>

  <Accordion title="Creator Required — 403">
    Unbanning someone who is an admin in this space or in one of the child spaces the unban covers, by anyone but the space creator or a service or master key.

    ```json theme={null}
    { "error": "Only the space creator can unban admins.", "code": "space/creator-required" }
    ```
  </Accordion>
</AccordionGroup>

See also: [useUnbanMember](/v8/hooks/spaces/use-unban-member)


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