Skip to main content

missioninbox

Official MissionInbox SDK for Python.

Install

pip install missioninbox

Requires Python 3.9 or newer.

Send a transactional email

import os
from missioninbox import MissionInbox

mi = MissionInbox(
    api_key=os.environ["MI_API_KEY"],
    base_url=os.environ["MI_API_URL"],  # provided by MissionInbox for your environment
)

result = mi.emails.send(
    from_="notifications@yourdomain.com",
    to="user@example.com",
    subject="Welcome",
    html="<p>Hi 👋</p>",
)

print("sent", result["id"])

from_ has a trailing underscore because from is a reserved keyword in Python. It maps to from on the wire.

The from_ address must be a registered sending identifier. Register one first:

mi.sending_identifiers.create(
    email_address="notifications@yourdomain.com",
    display_name="Acme Notifications",
)

Resources

The client exposes eight top-level resources:

Resource Purpose
mi.emails Send, look up status, fetch details, search
mi.email_queue Inspect / retry / cancel queued messages
mi.domains Register domains, verify DNS, push records, delete
mi.domains.redirects Set up URL redirects on a domain
mi.sending_identifiers Manage approved From: addresses
mi.projects Group domains into projects
mi.analytics Send activity overview and time-series graphs
mi.tasks Poll background tasks (bulk operations)
mi.health Unauthenticated liveness ping

Configuration

Argument Type Default Description
api_key str — Required. Your MissionInbox product API key.
base_url str — Required. The API URL for your environment.
timeout float 30.0 Per-request timeout in seconds.
max_retries int 2 Retries on 429 and 5xx (exponential backoff, honours Retry-After).
http_client httpx.Client new client Optional override for advanced transport control.

Errors

Every failure raises a subclass of MissionInboxError. Catch the specific class you care about:

from missioninbox import (
    AuthenticationError,
    UnregisteredSenderError,
    UnverifiedDomainError,
    SendLimitExceededError,
)

try:
    mi.emails.send(from_="...", to="...", subject="...", text="...")
except AuthenticationError:
    ...  # 401 — API key missing or invalid
except UnregisteredSenderError:
    ...  # 403 — `from` hasn't been registered
except UnverifiedDomainError:
    ...  # 403 — domain DNS not verified
except SendLimitExceededError:
    ...  # 403 — plan cap reached

Full hierarchy:

  • MissionInboxError — base
    • AuthenticationError (401)
    • PermissionError (403)
      • UnregisteredSenderError, UnverifiedDomainError, SubscriptionInactiveError, SendLimitExceededError, DomainBlacklistedError
    • ValidationError (400)
    • NotFoundError (404)
    • ConflictError (409)
    • SendError (422)
    • RateLimitError (429)
    • ServerError (5xx)
    • NetworkError (transport failure)

Bulk operations and tasks

Bulk endpoints dispatch a background task and return {"taskId": ..., "message": ...} immediately. Use tasks.wait_for() to block until the task finishes:

response = mi.domains.bulk_create(domains=[
    {"domainName": "acme.com"},
    {"domainName": "shop.acme.com"},
])

done = mi.tasks.wait_for(
    response["taskId"],
    poll_interval=3.0,
    timeout=5 * 60,
    on_progress=lambda t: print(f"{t['progress']}%"),
)

print(done["status"], done.get("result"))

Working with domains

domain = mi.domains.create(domain_name="acme.com")

verification = mi.domains.verify("acme.com")
if verification["fullyVerified"]:
    print("ready to send")

# If a DNS manager is connected:
mi.domains.push_dns("acme.com")

Analytics

overview = mi.analytics.get_overview()
print(overview["currentMonth"]["emailsSent"])

graph = mi.analytics.get_activity_graph(
    granularity="daily",
    start_date="2026-08-01T00:00:00Z",
    end_date="2026-08-31T23:59:59Z",
    counters=["outgoing", "bounces"],
)

Context manager

The client owns its underlying httpx.Client. Use it as a context manager to close it cleanly:

with MissionInbox(api_key=..., base_url=...) as mi:
    mi.emails.send(from_=..., to=..., subject=..., text=...)

Or call mi.close() explicitly.

License

MIT

Metadata

Release files for missioninbox 0.1.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 missioninbox 0.1.0
File Size Uploaded Provenance Actions
missioninbox-0.1.0.tar.gz 12.3 kB With provenance Details for missioninbox-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 30.2 kB

Release files / missioninbox-0.1.0.tar.gz

Download URL missioninbox-0.1.0.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
43194529bf09efa2b8cd3bcd78d635b0f956a3d031bb3a70627814798ab35adf
BLAKE2b-256 checksum
How to use checksums
bba8d1341727fd8e1bbf391e148c0b2db5c3eef710b0a85a7eed7e386d80fb04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.

Transparency log

Release files / missioninbox-0.1.0-py3-none-any.whl

Download URL missioninbox-0.1.0-py3-none-any.whl
Size 17.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7646a97cccd3106b5170e8dc0b76683b14a35a97de031db97be0b765360a0af1
BLAKE2b-256 checksum
How to use checksums
cd9c8fc257017d00a6d6b44d36d0d4a313e60fb9a073d9b5d20bfb06bfe64176
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.

Transparency log

Security for missioninbox 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for missioninbox-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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