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

# Manage Mutes

> This guide walks you through muting and unmuting users using the X API. Reference for the X API v2 standard tier covering quickstart.

This guide walks you through muting and unmuting users using the X API.

> [!NOTE]
>
> **Prerequisites**
>
> Before you begin, you'll need:
>
> * A [developer account](https://developer.x.com/en/portal/petition/essential/basic-info) with an approved App
> * User Access Token (OAuth 1.0a or OAuth 2.0 PKCE)

***

## Mute a user

**1. Get your user ID**

You need your authenticated user's ID. You can find it using the [user lookup endpoint](https://docs.x.com/x-api/users/lookup/introduction.md) or from your Access Token (the numeric part is your user ID).

**2. Get the target user ID**

Find the user ID of the account you want to mute using the [user lookup endpoint](https://docs.x.com/x-api/users/lookup/introduction.md).

**3. Send the mute request**

```bash cURL theme={null}
curl -X POST "https://api.x.com/2/users/123456789/muting" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"target_user_id": "9876543210"}'
```

```python title="Python SDK" lines wrap icon="python" theme={null}
from xdk import Client
from xdk.oauth1_auth import OAuth1

oauth1 = OAuth1(
    api_key="YOUR_API_KEY",
    api_secret="YOUR_API_SECRET",
    access_token="YOUR_ACCESS_TOKEN",
    access_token_secret="YOUR_ACCESS_TOKEN_SECRET"
)

client = Client(auth=oauth1)

# Mute a user
response = client.users.mute(
    source_user_id="123456789",
    target_user_id="9876543210"
)

print(f"Muting: {response.data.muting}")
```

```javascript title="JavaScript SDK" lines wrap icon="square-js" theme={null}
import { Client, OAuth1 } from "@xdevplatform/xdk";

const oauth1 = new OAuth1({
  apiKey: "YOUR_API_KEY",
  apiSecret: "YOUR_API_SECRET",
  accessToken: "YOUR_ACCESS_TOKEN",
  accessTokenSecret: "YOUR_ACCESS_TOKEN_SECRET",
});

const client = new Client({ oauth1 });

// Mute a user
const response = await client.users.mute("123456789", {
  targetUserId: "9876543210",
});

console.log(`Muting: ${response.data?.muting}`);
```

**4. Review the response**

```json theme={null}
{
  "data": {
    "muting": true
  }
}
```

***

## Unmute a user

Remove a mute from a user:

```bash cURL theme={null}
curl -X DELETE "https://api.x.com/2/users/123456789/muting/9876543210" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN"
```

```python title="Python SDK" lines wrap icon="python" theme={null}
from xdk import Client
from xdk.oauth1_auth import OAuth1

oauth1 = OAuth1(
    api_key="YOUR_API_KEY",
    api_secret="YOUR_API_SECRET",
    access_token="YOUR_ACCESS_TOKEN",
    access_token_secret="YOUR_ACCESS_TOKEN_SECRET"
)

client = Client(auth=oauth1)

# Unmute a user
response = client.users.unmute(
    source_user_id="123456789",
    target_user_id="9876543210"
)

print(f"Muting: {response.data.muting}")
```

```javascript title="JavaScript SDK" lines wrap icon="square-js" theme={null}
import { Client, OAuth1 } from "@xdevplatform/xdk";

const oauth1 = new OAuth1({
  apiKey: "YOUR_API_KEY",
  apiSecret: "YOUR_API_SECRET",
  accessToken: "YOUR_ACCESS_TOKEN",
  accessTokenSecret: "YOUR_ACCESS_TOKEN_SECRET",
});

const client = new Client({ oauth1 });

// Unmute a user
const response = await client.users.unmute("123456789", "9876543210");

console.log(`Muting: ${response.data?.muting}`);
```

**Response:**

```json theme={null}
{
  "data": {
    "muting": false
  }
}
```

***

## Mute vs Block

| Feature | Mute | Block |
| :- | :- | :- |
| See their Posts | No | No |
| They see your Posts | Yes | No |
| They can follow you | Yes | No |
| They can DM you | Yes | No |
| They know | No | Yes |

***

## Next steps

> [card] [Mutes lookup](https://docs.x.com/x-api/users/mutes/quickstart/mutes-lookup.md)
>
> Get your muted users

> [card] [Blocks](https://docs.x.com/x-api/users/blocks/quickstart.md)
>
> Block users instead

> [card] [API Reference](https://docs.x.com/x-api/users/mute-user-by-user-id.md)
>
> Full endpoint documentation
