Registry / communication / resend

resend

JSON →
library2.41.0pypypi✓ verified 28d ago

Official Python SDK for the Resend transactional email API. Active, frequently updated. v2.0 (May 2024) added TypedDict-based type hinting. Module-level api_key pattern is the primary auth method. No class instantiation — all methods are called as class methods on resend.Emails, resend.Contacts, etc.

pip install resend
INSTALL
IMPORT
SIG · RESEND
R
resend
communicationpythonv2.41.0
Install
2.3s avg
Import
455ms
Disk
21MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.41.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.482s · 22.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.3s · import 0.428s · 23MB
21MB installed
● package 21MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ApiKey
from resend import ApiKey
import resend

'from' field must use a verified domain. Use 'onboarding@resend.dev' only for testing. The 'to' field must be a list even for single recipients.

import os import resend resend.api_key = os.environ['RESEND_API_KEY'] params: resend.Emails.SendParams = { 'from': 'Acme <onboarding@resend.dev>', 'to': ['delivered@resend.dev'], 'subject': 'Hello from Resend', 'html': '<strong>It works!</strong>' } email = resend.Emails.send(params) print(email['id']) # e.g. '49a3999c-0ce1-4ea6-ab68-b08b6e9a5fe2'
Debug
Known issues
gotchaNo client class to instantiate — resend.api_key is set at the module level, then all API calls are made as class methods (resend.Emails.send(), resend.Contacts.list(), etc.). Code from other SDKs that tries to instantiate a client object fails.
fix
import resend; resend.api_key = 'YOUR_KEY'; resend.Emails.send(params)
affects: all
gotchaThe 'to' field must always be a list, even for a single recipient. Passing a string raises a validation error.
fix
'to': ['user@example.com']  # not 'to': 'user@example.com'
affects: all
gotchaThe 'from' field must use a domain verified in the Resend dashboard. Using unverified domains or personal email addresses returns 403. The address 'onboarding@resend.dev' works only in testing with the test API key.
fix
Verify your domain at resend.com/domains before sending. Format: 'Name <email@yourdomain.com>'
affects: all
gotchaModule-level api_key is global state — in multi-tenant or async applications with different API keys, setting resend.api_key is not thread-safe. Concurrent requests may use the wrong key.
fix
For multi-key scenarios, serialize key setting + API call, or use separate processes/containers per API key.
affects: all
gotchaPip warnings detected in the test output, indicating 'Running pip as root' which can cause permission issues, and an 'outdated pip version'. These are environment-specific warnings during package management, not direct failures related to the resend library's functionality.
fix
It is recommended to use a virtual environment for pip operations (e.g., `python -m venv .venv && source .venv/bin/activate`) and to keep pip updated (`pip install --upgrade pip`).
affects: all
Upgrade
Version history
2.41.0latest on PyPI · released Aug 26, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
27 hits · last 30 days
node
24
Amazon
1
OpenAI (training)
1
Resources
resend — pip install resend · libregistry