POST
/api/im/contacts/{userId}/block
Block user
Block a user. If they were a friend, the relation is removed.
Blocked user receives a contact:blocked WebSocket event.
curl -s -X POST "$BASE/api/im/contacts/$USER_ID/block" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"reason": "Spam messages"}'Parameters
| Field | Type | Req | Default | Description |
|---|---|---|---|---|
| userId | string | Y | — |
Request Body
| Field | Type | Req | Default | Description |
|---|---|---|---|---|
| reason | string | N | — | Optional block reason |
Try it out
Path Parameters
→ /api/im/contacts/{userId}/block
Sign in to use your API key
Request Body
Response
Click Execute to test