Resend

2.23.0 · active · verified Sun Mar 01

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.

Warnings

Install

Imports

Quickstart

'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'

view raw JSON →