[Bird](/)

/

[Email](/email)

EMAIL API / STACK EVALUATION

# Email API for Python.

Use the synchronous Bird client in a script, web handler or worker that can wait for the API result. Treat a successful send call as acceptance and observe recipient outcomes separately.

[Start now ↗](/dashboard/signup?returnTo=%2Fdashboard%2Fw%2Femail)

[Read the Python quickstart](/docs/get-started/quickstarts/python/email)

[Explore Email API](/email-api)

Py

BIRD / EMAIL

From your code. To a traceable send.

Your application

A customer connection ↗

A little context. A clear next step.

## See the first send.

**Python**: `python -m pip install messagebird-sdk`

File: `send.py`

Run: `python send.py`

```python
from bird import APIError, Bird

with Bird() as client:
    try:
        message = client.email.send(
            from_={"email": "onboarding@messagebird.dev", "name": "Bird"},
            to=["delivered@messagebird.dev"],
            subject="Hello from Bird",
            html="<p>My first Bird email.</p>",
        )
        print(message.id, message.status)
    except APIError as err:
        print("send failed:", err)
```

Examples: [Python](/nl-nl/email-api/python.py.md)

Onboarding sender and sandbox recipient only. This page does not send an email or contain a key.

[Download the Python code sample](/downloads/email-python-sample.zip)

[Read the setup guide](/docs/get-started/quickstarts/python/email)

ZIP with the displayed request, setup notes and an empty key template. A sandbox code sample, not a complete application. SDK version in the sample: 0.66.0; review current maintained setup before adapting it.

ILLUSTRATIVE RESULT / 202 ACCEPTED

em_01ky7ma8y2es1s2akzk53tmjn0 accepted

The returned ID lets you retrieve the message and follow recipient events. Acceptance does not prove delivery or inbox placement.

### If your sender is not verified

A sender outside your verified domain or the onboarding domain is refused before sending. Correct the sender setup; a rejected request is not a delivery event.

[Sending domains guide](/docs/guides/email/sending-domains)

### If the response is missing

Keep the original operation unresolved and inspect its record before repeating it. The SDK reuses identity for retries within one call; a new invocation normally creates a new operation. Your application owns durable job identity and deliberate replay. Completed responses are retained for three hours; after expiry, the same key can start a new operation. Retention does not make side effects atomic. Follow the idempotency guide before replaying. This sample does not provide a retry queue.

[Idempotency and recovery guide ↗](/docs/guides/idempotency)

[SDK request and retry options](/docs/sdks/python)

[Full installation and run steps](/docs/get-started/quickstarts/python/email)

02

RUNTIME

## Runtime and installation.

Bird’s Python quickstart requires Python 3.10+ and messagebird-sdk. Its sample imports Bird from the bird package and uses the synchronous context manager.

03

DECISION

## Choose where to send.

A worker can store the accepted ID alongside its own task. In an async web path, assess event-loop blocking and use only an async API supported by the installed SDK; follow the synchronous example in Bird’s Python quickstart.

04

OPERATION

## Track delivery and retries.

The context manager closes the client. Handle APIError as a send failure; use the returned ID to inspect a later delivery result. A transport error or “send failed” log can leave acceptance unknown; reconcile the original operation before retrying.

AFTER ACCEPTANCE

## Prepare for production sending.

Verify a production domain, keep your key on the server, and follow the recipient outcome separately from request acceptance.

For example, 10,000 signups with one welcome and one follow-up imply 20,000 planned sends before other traffic. Confirm actual processed units and peak daily volume, then compare included units, domain/webhook limits, overage and the send ceiling. Count dedicated IPs or other Email products separately where applicable. Sandbox testing is not an unlimited free-production offer.

[Current Email plans and usage rates ↗](/products/email/pricing) · [Compare provider responsibilities and commercial units ↗](/products/email/compare)

[01 Configure the sender Workspace, key and a verified production domain. ↗](/products/email/getting-started)

[02 Send from your stack Installation, execution and request errors. ↗](/docs/get-started/quickstarts/python/email)

[03 Observe the result Recipient events and deliberate recovery. ↗](/docs/guides/email/events)

[Choose an Email product ↗](/email)

[Next.js ↗](/email-api/nextjs)

[Node.js ↗](/email-api/nodejs)

[Python ↗](/email-api/python)

YOUR NEXT CONNECTION

## Your next send. A supported beginning.

[Open the quickstart](/docs/get-started/quickstarts/python/email)

[Talk to sales](/demo?product=email&source_page=%2Femail-api%2Fpython)



## Related resources

- [Getting started with email](/learn/email/getting-started-with-email) (video)
- [Send your first email](/docs/get-started/send-your-first-email) (docs)
- [Build your first integration](/learn/paths/integration) (course)

[Get an implementation brief](/learn/workspace?topic=email)
