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 becausefromis a reserved keyword in Python. It maps tofromon 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— baseAuthenticationError(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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file missioninbox-0.1.0.tar.gz.
File metadata
- Download URL: missioninbox-0.1.0.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43194529bf09efa2b8cd3bcd78d635b0f956a3d031bb3a70627814798ab35adf
|
|
| MD5 |
18f77507f0a6583555f49c3afe4a2c01
|
|
| BLAKE2b-256 |
bba8d1341727fd8e1bbf391e148c0b2db5c3eef710b0a85a7eed7e386d80fb04
|
Provenance
The following attestation bundles were made for missioninbox-0.1.0.tar.gz:
Publisher:
python-publish.yml on MissionInbox/sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
missioninbox-0.1.0.tar.gz -
Subject digest:
43194529bf09efa2b8cd3bcd78d635b0f956a3d031bb3a70627814798ab35adf - Sigstore transparency entry: 2697771501
- Sigstore integration time:
-
Permalink:
MissionInbox/sdk@f1a723a4ad7173d6f2b2923e0ca0dc494035a9be -
Branch / Tag:
refs/tags/python-v0.1.0 - Owner: https://github.com/MissionInbox
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@f1a723a4ad7173d6f2b2923e0ca0dc494035a9be -
Trigger Event:
push
-
Statement type:
File details
Details for the file missioninbox-0.1.0-py3-none-any.whl.
File metadata
- Download URL: missioninbox-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7646a97cccd3106b5170e8dc0b76683b14a35a97de031db97be0b765360a0af1
|
|
| MD5 |
b243d75e9bcd59b9072b74a1bbd8868f
|
|
| BLAKE2b-256 |
cd9c8fc257017d00a6d6b44d36d0d4a313e60fb9a073d9b5d20bfb06bfe64176
|
Provenance
The following attestation bundles were made for missioninbox-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on MissionInbox/sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
missioninbox-0.1.0-py3-none-any.whl -
Subject digest:
7646a97cccd3106b5170e8dc0b76683b14a35a97de031db97be0b765360a0af1 - Sigstore transparency entry: 2697771559
- Sigstore integration time:
-
Permalink:
MissionInbox/sdk@f1a723a4ad7173d6f2b2923e0ca0dc494035a9be -
Branch / Tag:
refs/tags/python-v0.1.0 - Owner: https://github.com/MissionInbox
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@f1a723a4ad7173d6f2b2923e0ca0dc494035a9be -
Trigger Event:
push
-
Statement type: