Skip to main content

agenticemail (Python)

API-first email for AI agents.

pip install agenticemail
from agenticemail import AgenticEmail, verify_webhook

client = AgenticEmail(api_key="am_...", base_url="https://api.agenticemail.dev")

inbox = client.inboxes.create(username="support", domain="acme.io")

client.messages.send(
    inbox["id"],
    to=["customer@example.com"],
    subject="Hello",
    text="Sent from an agent.",
)

threads = client.threads.list(inbox["id"])

Resources: inboxes, messages, threads, drafts, webhooks, domains, api_keys. Responses are plain dicts (the API's snake_case JSON). Errors raise AgenticEmailError (.status, .code).

Verifying webhooks:

from agenticemail import verify_webhook

event = verify_webhook(raw_body, headers, secret)  # raises AgenticEmailError if invalid
if event["type"] == "message.received":
    ...

See examples/auto_reply.py for a polling auto-reply agent.

End-to-end encryption

Optional, opt-in, and agent-to-agent. The private key stays on your side, so neither the platform nor AWS can read the contents. Wire-compatible with the TypeScript SDK.

pip install 'agenticemail[e2e]'
from agenticemail import AgenticEmail
from agenticemail.e2e import generate_identity, serialize_identity, deserialize_identity

# Once: create an identity for this inbox and store the private key safely.
identity = generate_identity("agent@acme.io")
open("agent.key", "w").write(serialize_identity(identity))

# Later: load it and enable e2e on the client.
identity = deserialize_identity(open("agent.key").read())
client = AgenticEmail(
    api_key="am_...",
    e2e={"identity": identity, "auto_publish": True},
)

# Encrypts automatically when the recipient has a published key; otherwise
# sends plaintext (set "allow_plaintext_fallback": False to fail closed).
client.messages.send("agent@acme.io", to=["peer@other.io"], subject="secret", text="...")

# Reads decrypt automatically; sender is verified against the published key.
msg = client.messages.get("agent@acme.io", message_id)
msg["text"], msg["decrypted"], msg["sender_verified"]

The recipient must be an AgenticEmail inbox that has published its key (client.publish_public_key()); you cannot end-to-end encrypt to an external address like Gmail.

  • CLI: the same API as JSON-first shell commands — npm install -g agenticemail-cli, including wait-for-message for agent loops
  • TypeScript SDK: npm install agenticemail
  • Docs: guides, CLI, MCP server, and the interactive API reference

Metadata

Release files for agenticemail 0.2.0

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

Source distribution (sdist)

Source distribution for agenticemail 0.2.0
File Size Uploaded
agenticemail-0.2.0.tar.gz 120.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agenticemail 0.2.0
File Interpreter ABI Platform
agenticemail-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 129.8 kB

Release files / agenticemail-0.2.0.tar.gz

Download URL agenticemail-0.2.0.tar.gz
Size 120.0 kB
Tags Source
SHA-256 checksum
How to use checksums
34d701e12e5e480dcac03c98c42120411c7c6cfc84cd23c53d7f2ebe556e6568
BLAKE2b-256 checksum
How to use checksums
3e3c3c8fa2089a60be02120f2913570701eaee23fb1027a434a575a0ff8b0ec0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / agenticemail-0.2.0-py3-none-any.whl

Download URL agenticemail-0.2.0-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ecfc106a3ee834cb318b64efcbdbc6b95df6f93b5a06cee9f6c63f899a49f5ec
BLAKE2b-256 checksum
How to use checksums
befaa303c61378c6ac5e0bbcdd09249b2d1aff4d1f59cb868f416c010b26c488
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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