## Leave a group chat

`chats.leave_chat(strchat_id)  -> ChatLeaveChatResponse`

**post** `/v3/chats/{chatId}/leave`

Removes your phone number from a group chat. Once you leave, you will no longer receive messages from the group and all interaction endpoints (send message, typing, mark read, etc.) will return 409.

A `participant.removed` webhook will fire once the leave has been processed.

**Supported**

- iMessage group chats with 4 or more active participants (including yourself)

**Not supported**

- DM (1-on-1) chats — use the chat directly to continue the conversation

### Parameters

- `chat_id: str`

### Returns

- `class ChatLeaveChatResponse: …`

  - `message: Optional[str]`

  - `status: Optional[str]`

  - `trace_id: Optional[str]`

### Example

```python
import os
from linq import LinqAPIV3

client = LinqAPIV3(
    api_key=os.environ.get("LINQ_API_V3_API_KEY"),  # This is the default and can be omitted
)
response = client.chats.leave_chat(
    "550e8400-e29b-41d4-a716-446655440000",
)
print(response.trace_id)
```

#### Response

```json
{
  "message": "Leave group chat queued",
  "status": "accepted",
  "trace_id": "trace_id"
}
```
