SpacePost
v0.2.2Send email and manage domains, contacts and webhooks on SpacePost, the Resend-compatible email API.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_emails List emails
List emails. Returns sent and scheduled emails, newest first, without bodies. Requires a `full_access` API key. API: `GET /emails` (operationId `listEmails`, Emails).
| Parameter | Type | Description |
|---|---|---|
after | string | Return items older than this id (next page). Cannot be combined with `before`. |
before | string | Return items newer than this id (previous page). Cannot be combined with `after`. |
limit | integer | Number of items to return. |
send_email Send an email
Send 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@ / c…
| Parameter | Type | Description |
|---|---|---|
from * | string | An email address, optionally with a display name: `Acme <hello@acme.com>`. At most 998 characters, display name included. A display name can't contain `<`, `>` or an encoded word, and a `from` name ca… |
subject * | string | |
to * | ||
attachments | array | |
bcc | ||
cc | ||
headers | object | |
html | string | |
idempotency_key | string | A unique key (1 to 256 characters) that makes the request safe to retry for 24 hours. |
reply_to | ||
scheduled_at | string | ISO 8601 date-time or natural language such as "in 1 hour" or "in 2 days". At most 30 days ahead. |
tags | array | |
tenant_id | string | 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. |
text | string |
send_batch_emails Send batch emails
Send batch emails. Sends up to 100 emails in one call. All-or-nothing, if any email is invalid none are sent. Attachments, `scheduled_at` and a per-email `tenant_id` are supported; the paused-tenant and tenant-cap errors apply to the whole batch. Put the emails in `body` as an array. Prefer send_email for a single message. Works with a `sending_access` or `full_access` API key. API: `POST /emails/batch` (operationId `sendBatchEmails`, Emails).
| Parameter | Type | Description |
|---|---|---|
body * | array | The JSON request body. |
idempotency_key | string | A unique key (1 to 256 characters) that makes the request safe to retry for 24 hours. |
get_email Retrieve an email
Retrieve an email. Requires a `full_access` API key. API: `GET /emails/{id}` (operationId `getEmail`, Emails).
| Parameter | Type | Description |
|---|---|---|
id * | string | The email id. |
update_email Reschedule an email
Reschedule an email. Changes `scheduled_at` of an email that is still `scheduled`. Requires a `full_access` API key. API: `PATCH /emails/{id}` (operationId `updateEmail`, Emails).
| Parameter | Type | Description |
|---|---|---|
id * | string | The email id. |
scheduled_at * | string | ISO 8601 date-time or natural language such as "in 1 hour" or "in 2 days". At most 30 days ahead. |
cancel_email Cancel a scheduled email
Cancel a scheduled email. Requires a `full_access` API key. API: `POST /emails/{id}/cancel` (operationId `cancelEmail`, Emails).
| Parameter | Type | Description |
|---|---|---|
id * | string | The email id. |
list_domains List domains
List domains. Requires a `full_access` API key. API: `GET /domains` (operationId `listDomains`, Domains).
| Parameter | Type | Description |
|---|---|---|
after | string | Return items older than this id (next page). Cannot be combined with `before`. |
before | string | Return items newer than this id (previous page). Cannot be combined with `after`. |
limit | integer | Number of items to return. |
create_domain Create a domain
Create a domain. Registers a domain and returns the DNS records to add (three DKIM CNAMEs, plus MX and SPF on the MAIL FROM subdomain). Domain names are globally unique. The number of domains is limited by your plan (Free 3, Pro 10, Scale 1,000). The response lists the DNS records (DKIM CNAMEs, MAIL FROM MX and SPF TXT) the user must add at their DNS provider; afterwards call verify_domain and then get_domain to see the new status. DNS changes can take minutes to hours. Requires a `full_access` API key. API: `POST /domains` (operationId `createDomain`, Domains).
| Parameter | Type | Description |
|---|---|---|
name * | string | Domain or subdomain you own. Lower-cased. |
custom_return_path | string | Subdomain used for the custom MAIL FROM (bounce handling and SPF). |
region | string | Accepted for compatibility. The region is chosen by the platform and returned on the domain. |
tenant_id | string | Platform mode. Make the domain tenant-owned (our tenant id or your `external_id`). Mail from it is attributed to that tenant. |
get_domain Retrieve a domain
Retrieve a domain. Requires a `full_access` API key. API: `GET /domains/{id}` (operationId `getDomain`, Domains).
| Parameter | Type | Description |
|---|---|---|
id * | string |
update_domain Update a domain
Update a domain. Toggles open and click tracking. Requires a `full_access` API key. API: `PATCH /domains/{id}` (operationId `updateDomain`, Domains).
| Parameter | Type | Description |
|---|---|---|
id * | string | |
click_tracking | boolean | |
open_tracking | boolean | |
tls | string |
delete_domain Delete a domain
Delete a domain. Requires a `full_access` API key. API: `DELETE /domains/{id}` (operationId `deleteDomain`, Domains).
| Parameter | Type | Description |
|---|---|---|
id * | string |
verify_domain Verify a domain
Verify a domain. Re-checks DNS now. Retrieve the domain afterwards to read the new `status` and per-record statuses. Requires a `full_access` API key. API: `POST /domains/{id}/verify` (operationId `verifyDomain`, Domains).
| Parameter | Type | Description |
|---|---|---|
id * | string |
list_api_keys List API keys
List API keys. Requires a `full_access` API key. API: `GET /api-keys` (operationId `listApiKeys`, API Keys).
| Parameter | Type | Description |
|---|---|---|
after | string | Return items older than this id (next page). Cannot be combined with `before`. |
before | string | Return items newer than this id (previous page). Cannot be combined with `after`. |
limit | integer | Number of items to return. |
create_api_key Create an API key
Create an API key. The `token` is returned only in this response. Requires a `full_access` API key. API: `POST /api-keys` (operationId `createApiKey`, API Keys).
| Parameter | Type | Description |
|---|---|---|
name * | string | |
domain_id | string | Restrict a `sending_access` key to one of your domains. Not allowed with `full_access`. |
permission | string |
delete_api_key Delete an API key
Delete an API key. The key stops working immediately. The response body is an empty object. Requires a `full_access` API key. API: `DELETE /api-keys/{id}` (operationId `deleteApiKey`, API Keys).
| Parameter | Type | Description |
|---|---|---|
id * | string |
list_webhooks List webhooks
List webhooks. Requires a `full_access` API key. API: `GET /webhooks` (operationId `listWebhooks`, Webhooks).
| Parameter | Type | Description |
|---|---|---|
after | string | Return items older than this id (next page). Cannot be combined with `before`. |
before | string | Return items newer than this id (previous page). Cannot be combined with `after`. |
limit | integer | Number of items to return. |
create_webhook Create a webhook
Create a webhook. In production the endpoint must use https and resolve to a public address. Requires a `full_access` API key. API: `POST /webhooks` (operationId `createWebhook`, Webhooks).
| Parameter | Type | Description |
|---|---|---|
endpoint * | string | Public URL that receives POST requests. https is required in production. |
events * | array |
get_webhook Retrieve a webhook
Retrieve a webhook. Requires a `full_access` API key. API: `GET /webhooks/{id}` (operationId `getWebhook`, Webhooks).
| Parameter | Type | Description |
|---|---|---|
id * | string |
update_webhook Update a webhook
Update a webhook. Requires a `full_access` API key. API: `PATCH /webhooks/{id}` (operationId `updateWebhook`, Webhooks).
| Parameter | Type | Description |
|---|---|---|
id * | string | |
endpoint | string | |
events | array | |
status | string |
delete_webhook Delete a webhook
Delete a webhook. Requires a `full_access` API key. API: `DELETE /webhooks/{id}` (operationId `deleteWebhook`, Webhooks).
| Parameter | Type | Description |
|---|---|---|
id * | string |
list_audiences List audiences
List audiences. Requires a `full_access` API key. API: `GET /audiences` (operationId `listAudiences`, Audiences).
| Parameter | Type | Description |
|---|---|---|
after | string | Return items older than this id (next page). Cannot be combined with `before`. |
before | string | Return items newer than this id (previous page). Cannot be combined with `after`. |
limit | integer | Number of items to return. |
create_audience Create an audience
Create an audience. Requires a `full_access` API key. API: `POST /audiences` (operationId `createAudience`, Audiences).
| Parameter | Type | Description |
|---|---|---|
name * | string |
get_audience Retrieve an audience
Retrieve an audience. Requires a `full_access` API key. API: `GET /audiences/{id}` (operationId `getAudience`, Audiences).
| Parameter | Type | Description |
|---|---|---|
id * | string |
delete_audience Delete an audience
Delete an audience. Also deletes its contacts. Requires a `full_access` API key. API: `DELETE /audiences/{id}` (operationId `deleteAudience`, Audiences).
| Parameter | Type | Description |
|---|---|---|
id * | string |
list_contacts List contacts
List contacts. Requires a `full_access` API key. API: `GET /audiences/{audienceId}/contacts` (operationId `listContacts`, Contacts).
| Parameter | Type | Description |
|---|---|---|
audience_id * | string | |
after | string | Return items older than this id (next page). Cannot be combined with `before`. |
before | string | Return items newer than this id (previous page). Cannot be combined with `after`. |
limit | integer | Number of items to return. |
create_contact Create a contact
Create a contact. Emails are lower-cased. An address can only appear once per audience. Requires a `full_access` API key. API: `POST /audiences/{audienceId}/contacts` (operationId `createContact`, Contacts).
| Parameter | Type | Description |
|---|---|---|
audience_id * | string | |
email * | string | |
first_name | string | |
last_name | string | |
unsubscribed | boolean |
get_contact Retrieve a contact
Retrieve a contact. Requires a `full_access` API key. API: `GET /audiences/{audienceId}/contacts/{idOrEmail}` (operationId `getContact`, Contacts).
| Parameter | Type | Description |
|---|---|---|
audience_id * | string | |
id_or_email * | string | The contact id or its (URL-encoded) email address. |
update_contact Update a contact
Update a contact. Requires a `full_access` API key. API: `PATCH /audiences/{audienceId}/contacts/{idOrEmail}` (operationId `updateContact`, Contacts).
| Parameter | Type | Description |
|---|---|---|
audience_id * | string | |
id_or_email * | string | The contact id or its (URL-encoded) email address. |
first_name | string | |
last_name | string | |
unsubscribed | boolean |
delete_contact Delete a contact
Delete a contact. Requires a `full_access` API key. API: `DELETE /audiences/{audienceId}/contacts/{idOrEmail}` (operationId `deleteContact`, Contacts).
| Parameter | Type | Description |
|---|---|---|
audience_id * | string | |
id_or_email * | string | The contact id or its (URL-encoded) email address. |
list_broadcasts List broadcasts
List broadcasts. Requires a `full_access` API key. API: `GET /broadcasts` (operationId `listBroadcasts`, Broadcasts).
| Parameter | Type | Description |
|---|---|---|
after | string | Return items older than this id (next page). Cannot be combined with `before`. |
before | string | Return items newer than this id (previous page). Cannot be combined with `after`. |
limit | integer | Number of items to return. |
create_broadcast Create a broadcast
Create a broadcast. Creates a draft. The `from` address must belong to a verified domain of your team and `audience_id` to one of your audiences. Requires a `full_access` API key. API: `POST /broadcasts` (operationId `createBroadcast`, Broadcasts).
| Parameter | Type | Description |
|---|---|---|
audience_id * | string | |
from * | string | An email address, optionally with a display name: `Acme <hello@acme.com>`. At most 998 characters, display name included. A display name can't contain `<`, `>` or an encoded word, and a `from` name ca… |
subject * | string | |
html | string | |
name | string | Internal name |
preview_text | string | |
reply_to | ||
text | string |
get_broadcast Retrieve a broadcast
Retrieve a broadcast. Requires a `full_access` API key. API: `GET /broadcasts/{id}` (operationId `getBroadcast`, Broadcasts).
| Parameter | Type | Description |
|---|---|---|
id * | string |
update_broadcast Update a broadcast
Update a broadcast. Only drafts can be updated. Request body: Any field of the create request; only drafts can be updated. Requires a `full_access` API key. API: `PATCH /broadcasts/{id}` (operationId `updateBroadcast`, Broadcasts).
| Parameter | Type | Description |
|---|---|---|
id * | string | |
audience_id | string | |
from | string | An email address, optionally with a display name: `Acme <hello@acme.com>`. At most 998 characters, display name included. A display name can't contain `<`, `>` or an encoded word, and a `from` name ca… |
html | string | |
name | string | |
preview_text | string | |
reply_to | ||
subject | string | |
text | string |
delete_broadcast Delete a broadcast
Delete a broadcast. Only drafts and broadcasts that are scheduled for the future can be deleted. Requires a `full_access` API key. API: `DELETE /broadcasts/{id}` (operationId `deleteBroadcast`, Broadcasts).
| Parameter | Type | Description |
|---|---|---|
id * | string |
get_broadcast_readiness Check a broadcast before sending
Check a broadcast before sending. SpacePost extension (not part of Resend). Returns a deliverability checklist: sender domain and DMARC, subject, Gmail clipping (HTML over 102 KB), image-heavy bodies, link shorteners, spam phrases, unsubscribe link and audience quality. `ready` is false when any check has level `error`; `POST /broadcasts/{id}/send` is then refused with `validation_error`. Warnings never block a send. Requires a `full_access` API key. API: `GET /broadcasts/{id}/readiness` (operationId `getBroadcastReadiness`, Broadcasts).
| Parameter | Type | Description |
|---|---|---|
id * | string |
send_broadcast Send or schedule a broadcast
Send or schedule a broadcast. Queues a draft for delivery to every subscribed contact of its audience. The broadcast needs `html` or `text`. Without `scheduled_at` it starts immediately; the status becomes `queued`, then `sending` and `sent`. Sends to every subscribed contact in the audience. Run get_broadcast_readiness first and confirm with the user. Requires a `full_access` API key. API: `POST /broadcasts/{id}/send` (operationId `sendBroadcast`, Broadcasts).
| Parameter | Type | Description |
|---|---|---|
id * | string | |
scheduled_at | string | ISO 8601 date-time or natural language such as "in 1 hour" or "in 2 days". At most 30 days ahead. |
list_suppressions List suppressions
List suppressions. Requires a `full_access` API key. API: `GET /suppressions` (operationId `listSuppressions`, Suppressions).
| Parameter | Type | Description |
|---|---|---|
after | string | Return items older than this id (next page). Cannot be combined with `before`. |
before | string | Return items newer than this id (previous page). Cannot be combined with `after`. |
limit | integer | Number of items to return. |
create_suppression Add a suppression
Add a suppression. Adds the address with reason `manual`. Adding an address that is already suppressed returns the existing entry. Requires a `full_access` API key. API: `POST /suppressions` (operationId `createSuppression`, Suppressions).
| Parameter | Type | Description |
|---|---|---|
email * | string |
delete_suppression Remove a suppression
Remove a suppression. Requires a `full_access` API key. API: `DELETE /suppressions/{idOrEmail}` (operationId `deleteSuppression`, Suppressions).
| Parameter | Type | Description |
|---|---|---|
id_or_email * | string | The suppression id or the (URL-encoded) email address. |
list_tenants List tenants
List tenants. Requires a `full_access` API key. API: `GET /tenants` (operationId `listTenants`, Tenants).
| Parameter | Type | Description |
|---|---|---|
after | string | Return items older than this id (next page). Cannot be combined with `before`. |
before | string | Return items newer than this id (previous page). Cannot be combined with `after`. |
limit | integer | Number of items to return. |
create_tenant Create a tenant
Create a tenant. Creates one of your customers, with its own SES tenant (isolated reputation). `external_id` must be unique within your account. Requires a `full_access` API key. API: `POST /tenants` (operationId `createTenant`, Tenants).
| Parameter | Type | Description |
|---|---|---|
name * | string | |
daily_limit | integer | null | Max recipients per day for this tenant. Omit or null for no cap. |
external_id | string | Your own id for the customer. Unique per account; accepted wherever a tenant id is. |
get_tenant Retrieve a tenant
Retrieve a tenant. Requires a `full_access` API key. API: `GET /tenants/{ref}` (operationId `getTenant`, Tenants).
| Parameter | Type | Description |
|---|---|---|
ref * | string | The tenant id or your own `external_id`. |
update_tenant Update a tenant
Update a tenant. Changes the name, `external_id` or `daily_limit` (`null` removes the cap). Requires a `full_access` API key. API: `PATCH /tenants/{ref}` (operationId `updateTenant`, Tenants).
| Parameter | Type | Description |
|---|---|---|
ref * | string | The tenant id or your own `external_id`. |
daily_limit | integer | null | Null removes the cap. |
external_id | string | |
name | string |
delete_tenant Delete a tenant
Delete a tenant. Fails with `422` while the tenant still has domains; delete those first. Requires a `full_access` API key. API: `DELETE /tenants/{ref}` (operationId `deleteTenant`, Tenants).
| Parameter | Type | Description |
|---|---|---|
ref * | string | The tenant id or your own `external_id`. |
pause_tenant Pause a tenant
Pause a tenant. Stops all sending for the tenant. Sends return `403 sending_paused`; emails already queued fail. The body is optional. Requires a `full_access` API key. API: `POST /tenants/{ref}/pause` (operationId `pauseTenant`, Tenants).
| Parameter | Type | Description |
|---|---|---|
ref * | string | The tenant id or your own `external_id`. |
reason | string | Stored as `paused_reason`. Defaults to a generic reason. |
unpause_tenant Unpause a tenant
Unpause a tenant. Resumes sending. A tenant that was paused by the reputation guard (bounce or complaint rate) can only be unpaused by a `trusted` or `internal` team; others get `403 invalid_access` and should contact support. Requires a `full_access` API key. API: `POST /tenants/{ref}/unpause` (operationId `unpauseTenant`, Tenants).
| Parameter | Type | Description |
|---|---|---|
ref * | string | The tenant id or your own `external_id`. |