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

# Mute Conversation

> Set or clear the authenticated user's mute on a conversation

Sets or clears the acting user's mute on a conversation. Muting suppresses the `message` push for this conversation only — the message is still delivered, socket-emitted, and readable. Timed mutes expire lazily (push resumes once the window passes).

Requires authentication. **Acting-user-scoped:** an end-user token (`Authorization: Bearer <accessToken>`) mutes its own membership. A service/master key acts on behalf of a named user via the optional body `userId` — a service key without `userId` is rejected, and an end-user token may not name a different user (both consistent with every other per-user write). Requires the `chat` bundle.

## Path Parameters

<ParamField path="conversationId" type="string" required>
  The ID of the conversation to mute or unmute.
</ParamField>

## Body Parameters

<ParamField body="duration" type="string | null" required>
  The mute **duration choice** — send the choice, never a raw timestamp. One of:

  * `"8h"` — mute for 8 hours from now
  * `"24h"` — mute for 24 hours from now
  * `"1w"` — mute for 1 week from now
  * `"forever"` — mute indefinitely
  * `null` — clear the mute (unmute)

  The server resolves the window from its own clock, so client clock skew can't distort it.
</ParamField>

<ParamField body="userId" type="string">
  The acting user whose membership is muted. **Service/master keys only** — a service key must pass it (there is no implicit session user); an end-user token infers it from the auth token and may not name a different user.
</ParamField>

## Response

Returns `200` with the acting user's own (self-serialized) member row under `currentMember`. The `mutedUntil` / `mutedForever` fields reflect the new state.

```json theme={null}
{
  "currentMember": {
    "id": "mbr_abc123",
    "conversationId": "cnv_abc123",
    "userId": "usr_abc123",
    "role": "member",
    "mutedForever": true,
    "mutedUntil": null,
    "isActive": true
  }
}
```

<Warning>
  **"Forever" is an explicit signal.** A `forever` mute returns `mutedForever: true` with `mutedUntil: null` — the far-future storage sentinel is never exposed as a date. A timed mute returns `mutedForever: false` with a real ISO `mutedUntil`. An unmuted conversation returns `mutedForever: false`, `mutedUntil: null`. Read the boolean; never string-match a date.
</Warning>

## Error Responses

<AccordionGroup>
  <Accordion title="Unauthorized — 401 / 403">
    ```json theme={null}
    { "error": "Unauthorized", "code": "chat/unauthorized" }
    ```

    `403 chat/unauthorized` when an end-user token names a `userId` other than its own. A `401` is returned when no valid credential is present.
  </Accordion>

  <Accordion title="Missing User ID — 400">
    ```json theme={null}
    { "error": "Missing user ID", "code": "chat/missing-user-id" }
    ```

    Returned when a service/master key omits the required `userId` (it has no implicit session user).
  </Accordion>

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

  <Accordion title="Not a Member — 400">
    ```json theme={null}
    { "error": "You are not an active member of this conversation.", "code": "chat/not-a-member" }
    ```
  </Accordion>

  <Accordion title="Invalid Body — 400">
    ```json theme={null}
    { "error": "...", "code": "chat/invalid-body" }
    ```

    Returned when `duration` is not one of the accepted choices (or `null`).
  </Accordion>
</AccordionGroup>

## See Also

* [Notification Preferences & Mute](/notification-preferences)
* [`useMuteConversation`](/hooks/chat/conversations/use-mute-conversation)
* [Node SDK — `chat.muteConversation`](/node-sdk/push-notifications#muteconversation)
