OpenAPI JSONDashboard

Get Started

Send your first email

This is the shortest possible loop: send one message, list the inbox, and fetch the message back. Five minutes end-to-end, assuming you've already installed the SDK and exported AGENTMAIL_API_BASE_URL and AGENTMAIL_TOKEN.

Send a message#

python
import os
from agentmail_client import AgentMailClient

client = AgentMailClient(
    base_url=os.environ["AGENTMAIL_API_BASE_URL"],
    token=os.environ["AGENTMAIL_TOKEN"],
)

result = client.send_mail(
    to="recipient@example.com",
    subject="Hello from Assmbl",
    body="This is the message body.",
)
print(result["correlation_id"])

Read your inbox#

python
page = client.list_inbox(limit=10)
for item in page.get("items", []):
    print(item["MessageID"], item["Subject"])

To fetch the full MIME for a single message:

python
msg = client.get_message(page["items"][0]["MessageID"])
print(msg["body_text"])

Next steps#