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

# Messages

> Send messages and retrieve conversation history

## Send a message

```python theme={null}
result = await client.messages.send(
    conversation_id=91,
    content="Do you ship to Lagos?",
    metadata={"client_message_id": "msg_abc123"},  # optional
)

print(result.user_message.content)   # "Do you ship to Lagos?"
print(result.agent_message.content)  # "Yes, shipping is available."
```

## Retrieve conversation history

```python theme={null}
page = await client.messages.list(91)

for message in page:
    print(f"[{message.sender}] {message.content}")
```

## High-level shortcut

```python theme={null}
result = await client.chat(
    agent_id=7,
    external_user_id="user_12345",
    message="Do you ship to Lagos?",
)
```
