Send an email
send_emailSend an email.
Validates and queues one email. Each recipient counts towards your quota. Use scheduled_at to send later (up to 30 days ahead). Pass tenant_id to send on behalf of a tenant (not needed when the from domain belongs to one). Fails with 422 if tenant_id conflicts with the domain's tenant, 403 sending_paused if the tenant is paused and 429 daily_quota_exceeded if it reached its daily cap.
from must be on a verified domain (e.g. "Acme hi@acme.com"); call list_domains to find one. Provide html, text or both. Send to delivered@test.spacepost.dev (or bounced@ / complained@) to test without sending real mail. Delivered email cannot be recalled: confirm recipients and content with the user when unsure. Pass idempotency_key when retrying so the email is not sent twice.
Request body: Either html or text is required. reply_to is also accepted as replyTo and scheduled_at as scheduledAt.
Works with a sending_access or full_access API key. API: POST /emails (operationId sendEmail, Emails).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cc | No | ||
| to | Yes | ||
| bcc | No | ||
| from | Yes | An email address, optionally with a display name: `Acme <hello@acme.com>`. | |
| html | No | ||
| tags | No | ||
| text | No | ||
| headers | No | ||
| subject | Yes | ||
| reply_to | No | ||
| tenant_id | No | Platform mode. Our tenant id or your `external_id`. Optional when the `from` domain belongs to a tenant; a conflict with the domain's tenant is a 422. | |
| attachments | No | ||
| scheduled_at | No | ISO 8601 date-time or natural language such as "in 1 hour" or "in 2 days". At most 30 days ahead. | |
| idempotency_key | No | A unique key (1 to 256 characters) that makes the request safe to retry for 24 hours. |