> For the complete documentation index, see [llms.txt](https://dnotifier.gitbook.io/product-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dnotifier.gitbook.io/product-docs/reference/chat-methods/python.md). Agents can also search and read this documentation through its [MCP server](https://dnotifier.gitbook.io/product-docs/~gitbook/mcp).

# Python

## `fetch_chat_history()`

```python
async def fetch_chat_history(
    sender_id: str,
    receiver_ids: list[str],
) -> Any
```

| Parameter      | Type        | Required | Description                 |
| -------------- | ----------- | -------- | --------------------------- |
| `sender_id`    | `str`       | ✅        | Requesting user id          |
| `receiver_ids` | `list[str]` | ✅        | Participant ids (non-empty) |

**Server metadata:** `type: 'text'`, `code: 201`

**Returns:** Direct response over HTTP; `on_message` over WebSocket.

```python
await notifier.fetch_chat_history(
    sender_id="user-alice",
    receiver_ids=["user-bob"],
)
```

## `delete_chat_history_message()`

```python
async def delete_chat_history_message(
    sender_id: str,
    message_id: str,
) -> Any
```

| Parameter    | Type  | Required | Description          |
| ------------ | ----- | -------- | -------------------- |
| `sender_id`  | `str` | ✅        | Requesting user id   |
| `message_id` | `str` | ✅        | Message id to delete |

**Server metadata:** `type: 'text'`, `code: 202`

```python
await notifier.delete_chat_history_message(
    sender_id="user-alice",
    message_id="msg-uuid-here",
)
```

## Errors

| Error                                 | Cause                |
| ------------------------------------- | -------------------- |
| `RuntimeError('Not connected')`       | Not connected        |
| `ValueError('sender_id required')`    | Missing sender       |
| `ValueError('receiver_ids required')` | Empty `receiver_ids` |
