Skip to main content

Official Python SDK for the AgentEmail API — create and manage email inboxes programmatically.

Project description

agentemail

Official Python SDK for the AgentEmail API.

Create and manage email inboxes programmatically for your AI agents and applications.

Installation

pip install agentemail

Quick Start

from agentemail import AgentemailApi

client = AgentemailApi(api_key="aem_your_api_key_here")

# List your inboxes
inboxes = client.sdk.sdk_list_inboxes()
print(inboxes.data)

# Create a new inbox
inbox = client.sdk.sdk_create_inbox(name="hello")
print(inbox.name)  # "hello"
# Full address: hello@agentemail.co

# List email threads
threads = client.sdk.sdk_list_threads(inbox.id)
for thread in threads.data:
    print(thread.subject, thread.message_count)

# Get a full thread with all messages
thread = client.sdk.sdk_get_thread(inbox.id, threads.data[0].id)
for message in (thread.messages or []):
    print(message.from_address, message.body_text)

# Check usage vs plan limits
usage = client.sdk.sdk_get_usage()
print(usage)

Async Usage

import asyncio
from agentemail import AsyncAgentemailApi

async def main():
    client = AsyncAgentemailApi(api_key="aem_your_api_key_here")
    inboxes = await client.sdk.sdk_list_inboxes()
    print(inboxes.data)

asyncio.run(main())

Authentication

Generate an API key from your AgentEmail dashboard.

import os
from agentemail import AgentemailApi

client = AgentemailApi(api_key=os.environ["AGENTEMAIL_API_KEY"])

API Reference

Inboxes

Method Description
client.sdk.sdk_list_inboxes(limit=None, offset=None) List all your inboxes (paginated)
client.sdk.sdk_create_inbox(name=...) Create a new inbox

Emails & Threads

Method Description
client.sdk.sdk_list_threads(inbox_id, limit=None, offset=None, unread_only=None) List email threads for an inbox
client.sdk.sdk_get_thread(inbox_id, thread_id, mark_read=None) Get a thread with all messages

Usage

Method Description
client.sdk.sdk_get_usage() Get current usage vs plan limits

Links

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentemail-0.1.2.tar.gz (29.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentemail-0.1.2-py3-none-any.whl (46.7 kB view details)

Uploaded Python 3

File details

Details for the file agentemail-0.1.2.tar.gz.

File metadata

  • Download URL: agentemail-0.1.2.tar.gz
  • Upload date:
  • Size: 29.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for agentemail-0.1.2.tar.gz
Algorithm Hash digest
SHA256 cf250a45a3682fce6065115d9aa68f4f372f9252831185fdffc18a593970a608
MD5 a53f0fa34320653eaa3f5d0df5c0ec14
BLAKE2b-256 68a0c7980d13756a1a1bc520e957268bd2d5473f2534df9bfa85f94ad0d11200

See more details on using hashes here.

File details

Details for the file agentemail-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: agentemail-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 46.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for agentemail-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 60f94fefef1ab76d542d296b97d95d499cc41a3da80afda76c8cb05f5b6f70d4
MD5 2953463dbedef0a46082415a05ab7c94
BLAKE2b-256 780df507fec7c410155d3ca4d397a1d1cb385f377d8f898121077b42188393e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page