Email API
Send email from a Laravel or Next.js app, a script or anything else that makes HTTP requests. It uses the same sending domains and monthly allowance as your WordPress websites.
Before you start
You need a verified sending domain and room in your monthly allowance. Creating keys needs the Manage email permission, which Owners and Admins have.
Create an API key
Open API keys
Open Email in the main sidebar, then API keys.
Name it
Name the key after the app that uses it, then choose Create key.
Copy it now
The key starts with
skydun_and is shown only once. Keep it in your app’s environment, never in code you commit.
A key can send from every verified domain in the workspace and read every email it sent, so give each app its own. The list shows when each key was Last used. To stop a key, choose Revoke key. Keys marked WordPress belong to websites using Skydun Email: leave those alone.
Send an email
Send a POST to https://manage.skydun.com/api/v1/emails with the key as a bearer token:
Send
curl https://manage.skydun.com/api/v1/emails \
-H "Authorization: Bearer skydun_..." \
-H "Content-Type: application/json" \
-d '{
"from": "Shop <[email protected]>",
"to": "[email protected]",
"subject": "Hello",
"html": "<p>It works.</p>"
}'The response is the email’s id, such as {"id": "9b1f…"}. The request takes the same fields as Resend’s send-email API:
| Field | Value |
|---|---|
from | An address at a verified domain, alone or as "Name <address>". Required. |
to | One address or a list. Required. |
cc, bcc, reply_to | One address or a list. |
subject | Required. |
html, text | The body. Send one or both. |
headers | Extra headers. Only names starting with X-. |
attachments | A list of { filename, content, content_type }, with content in base64. |
Scroll to see more
Limits:
- 50 recipients an email, across to, cc and bcc. Each counts against the allowance;
- 10 attachments an email, 10 MB in total;
- 600 requests a minute for each key.
Check what happened to an email
Check
curl https://manage.skydun.com/api/v1/emails/EMAIL_ID \
-H "Authorization: Bearer skydun_..."The response has the email’s from, to, subject, created_at and last_event: sent, delivered, bounced, complained or rejected. The same emails are under Email → Logs.
Errors
An error comes back as {"name": "…", "message": "…"}. Don’t retry it as it is: fix the cause first.
| Status | Name | What to do |
|---|---|---|
| 401 | invalid_api_key | Check the key. It may have been revoked. |
| 403 | domain_not_verified | Send from an address at a verified domain, or verify this one. |
| 403 | suspended | The allowance is used up or Amazon SES paused sending. See the Email page. |
| 422 | recipient_suppressed | The address bounced or reported spam before. See Suppressions. |
| 429 | quota_exceeded | The email doesn’t fit what’s left of this month’s allowance. |
| 502 | rejected | Amazon SES refused the email. The message says why. |
| 503 | not_available | Email sending isn’t available right now. Email us. |
A missing or invalid field returns 422 with a message and an errors object listing each field.
Scroll to see more
Refused emails aren’t logged
Emails refused with an error never reach Email → Logs, so log the error in your app.