Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

mailbot

Python SDK source for the mailbot API.

Default API base: https://agentmail.omyop.com/v1

Current status: package is prepared for public install once registry credentials are available.

Sync quick start

from mailbot import MailBot

client = MailBot(api_key="mb_xxx")
inbox = client.inboxes.create(username="support-bot")

Domain onboarding

domain = client.domains.create(domain="myapp.com")
print(domain["dns_records"])

records = client.domains.get(domain["id"])
print(records["dns_records"])

verified = client.domains.verify(domain["id"])
print(verified["data"]["status"])
print(verified["next_step"])

Async quick start

import asyncio
from mailbot import MailBot

async def main():
    async with MailBot(api_key="mb_xxx") as client:
        await client.http.arequest("GET", "/usage")

asyncio.run(main())

Webhook handling

import hmac
import hashlib

def verify_webhook(body: bytes, signature: str, secret: str) -> bool:
    expected = hmac.new(secret.encode(), body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, signature)

Compliance checking

client.compliance.check(domain="example.com")
client.compliance.readiness(inbox_id="inbox_123")

CI/email testing

result = client.messages.wait_for(
    "inbox_123",
    direction="inbound",
    subject_contains="Verify your account",
    timeout_ms=20000,
)

print(result["data"]["subject"])

Error handling

from mailbot import MailBot, AuthError, RateLimitError

client = MailBot(api_key="mb_xxx")

try:
    client.inboxes.list()
except AuthError:
    print("Invalid API key")
except RateLimitError:
    print("Too many requests")

Metadata

Release files for mailbot-sdk 0.1.0b2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mailbot-sdk 0.1.0b2
File Size Uploaded
mailbot_sdk-0.1.0b2.tar.gz 8.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mailbot-sdk 0.1.0b2
File Interpreter ABI Platform
mailbot_sdk-0.1.0b2-py3-none-any.whl Python 3 none any Details

Total release size: 18.8 kB

Release files / mailbot_sdk-0.1.0b2.tar.gz

Download URL mailbot_sdk-0.1.0b2.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7f097ac0ce255800a7e89224db373816e01ed4207f5416575559aa214fa25a57
BLAKE2b-256 checksum
How to use checksums
e2e544f57719b9969f18e1c867d579f3a23ba8763e6a59fcaf9e800402a6d783
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / mailbot_sdk-0.1.0b2-py3-none-any.whl

Download URL mailbot_sdk-0.1.0b2-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ae94f16eedb015020a1df84d29c87b7758f47905f7301f711d287707a7cb137
BLAKE2b-256 checksum
How to use checksums
c8ca7cc719ea3ff4adc0b935699ee1db1925e0342f2e2d1c95497558bb09c668
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.1.0b2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page