Skip to content

API reference

Send email with SendPelican

One HTTPS endpoint sends your email. Requests and responses are JSON. The base URL is https://sendpelican.com.

Authentication

Every /v1 request carries an API key as a Bearer token. Create keys in the dashboard under Settings, API Keys. A key is shown once, so store it as a secret. Keys expire after the period chosen when you create them (90 days unless you pick another); a request with an expired key returns 401.

Authorization: Bearer <YOUR_API_TOKEN>

Each key carries abilities. A key with full access has all of them. GET /v1/usage and GET /v1/account work with any key that has at least one ability outside the sandbox.

AbilityAllows
emails:sendPOST /v1/emails
bulk:sendPOST /v1/bulk/emails
emails:readGET /v1/emails and GET /v1/emails/{id}
domains:manage/v1/domains
suppressions:manage/v1/suppressions
webhooks:manage/v1/webhooks
sandbox:readReading the Email Sandbox: inboxes, messages, wait
sandbox:manageCreating, cleaning and deleting sandbox inboxes and messages
sandbox:sendPOST /v1/sandbox/inboxes/{id}/messages (capture over HTTP)

Send an email

POST /v1/emails needs the emails:send ability. The from address must be on a domain you have verified.

curl -X POST https://sendpelican.com/v1/emails \
  -H "Authorization: Bearer <YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "from": {
      "email": "hello@yourdomain.com"
    },
    "to": [
      "recipient@example.com"
    ],
    "subject": "Hello from yourdomain.com",
    "html": "<p>Sent with SendPelican.</p>",
    "text": "Sent with SendPelican.",
    "category": "welcome"
  }'

Request body

FieldTypeRequiredNotes
from.emailstringYesSender address. Its domain must be verified on your account.
from.namestringNoDisplay name.
toarray of stringsYes1 to 50 recipients. Each gets its own message, status and events.
subjectstringYesUp to 998 characters.
htmlstringOne of html, textHTML body.
textstringOne of html, textPlain-text body.
reply_tostringNoReply-To address.
headersobjectNoExtra headers, for example {"X-Campaign": "receipt"}. Names SendPelican sets itself (From, To, Bcc, Subject, Message-Id and similar) are refused.
tagsarray of stringsNoUp to 20 labels, returned in events and webhooks.
metadataobjectNoYour own key-value data, returned in events and webhooks.
track_opensbooleanNoOverrides the domain default for this request.
track_clicksbooleanNoOverrides the domain default for this request.
categorystringNoOne label for the kind of email, for example "Password reset". Up to 100 printable characters. The Email Categories stats group by it, and it is returned in events and webhooks.

The body must be under 10 MB. Recipients on your suppression list come back with status suppressed and use no quota.

Response

202 Accepted with one entry per recipient. Use each id with GET /v1/emails/{id} to read its status and events.

{
    "data": {
        "batch": "01k7a9w8e5n3c2b1x0z9y8v7u5",
        "messages": [
            {
                "id": "01k7a9w8e5n3c2b1x0z9y8v7u6",
                "to": "recipient@example.com",
                "status": "queued"
            }
        ]
    }
}

Send over SMTP

Any app or mail client that speaks SMTP can send through SendPelican. SMTP mail uses the same verified domains, quota, suppressions, tracking and webhooks as the API, and it can carry attachments, which the API cannot. Create a username and password under SMTP Credentials in the dashboard.

Give every message a unique Message-ID header; most libraries add one. If your client resends after a lost reply, SendPelican returns the messages it already accepted for that Message-ID and recipients instead of sending again. Without a Message-ID, an identical message to the same recipients within the same 15-minute window counts as a retry and is not sent twice.

To set the message's category, the same as the API's category field, add a X-Mailflow-Category header. SendPelican removes the header before sending, so recipients never see it. A value longer than 100 characters or with control characters is refused.

Hostsmtp.sendpelican.com
Ports
465 TLS (implicit, SMTPS)
587 STARTTLS
AuthenticationAUTH PLAIN or AUTH LOGIN, only after TLS is up. A plain-text connection cannot log in.
Limits10 MB per message and 50 recipients per message. Each recipient becomes its own message with its own status and events.
# Laravel 11+. On Laravel 10 or older, use MAIL_ENCRYPTION=tls in place of MAIL_SCHEME.
MAIL_MAILER=smtp
MAIL_SCHEME=smtp
MAIL_HOST=smtp.sendpelican.com
MAIL_PORT=587
MAIL_USERNAME=<SMTP_USERNAME>
MAIL_PASSWORD=<SMTP_PASSWORD>
MAIL_FROM_ADDRESS=hello@yourdomain.com

SMTP replies

A 4xx reply is temporary: retry later and nothing was sent. A 5xx reply is permanent: fix the cause before you resend. When SendPelican refuses a message, the reply maps from the same error code the API would return. A wrong username or password gets 535 5.7.8.

ReplyTextAPI error codeMeaning
535 5.7.8Authentication credentials invalidinvalid_credentials (401)The SMTP username or password is wrong, or the credential was revoked during the session.
554 5.7.1Account suspended; sending is disabledaccount_suspended (403)The account is suspended or closed and cannot send. A suspended account's sandbox still captures; a closed account's does not. Inbound inboxes of a suspended or closed account receive nothing.
550 5.7.1Sender domain is not verified on this accountdomain_not_verified (422)The from address is not on a verified domain of this account, or (domain page) an unverified domain cannot receive email.
550 5.7.1Sender headers not allowedsender_not_allowed (422)The SMTP message names its sender in a way SendPelican refuses: two From headers, a From with no address, several addresses or a group, or a Sender, Resent-From or Resent-Sender header. The SMTP server replies 550 5.7.1.
452 4.2.2Sending quota exceeded; try again laterquota_exceeded (429)The request would pass the daily or monthly limit of the plan. Nothing was sent or reserved.
452 4.2.2Monthly overage spending cap reached; raise the cap or wait for the next periodoverage_cap_reached (429)A variant of quota_exceeded on plans that bill overage: the request would pass the monthly quota plus the overage the account's spending cap allows. Nothing was sent or reserved. details has period, limit and overage_cap_pence (0 means no overage). The cap is set on the Usage & Limits page. The SMTP server replies 452 4.2.2.
452 4.2.2Domain warm-up limit reached for today; try again laterwarmup_limit (429)The from domain is warming up and the request would pass its daily warm-up cap. Nothing was sent or reserved. details has domain, stage, daily_cap, sent_today and resets_at.
552 5.3.4Message too largemessage_too_large (413)The SMTP message is over 10 MB, over the sandbox plan's message size, or over the size limit for received mail. The SMTP server replies 552.
550 5.6.0Message rejectedvalidation_failed (422)The message could not be accepted as sent, for example it has no From address or no recipients, or it is signed and sent with a bulk credential.
550 5.7.1Plan does not include this streamplan_upgrade_required (403)The credential is a bulk credential and the plan no longer includes bulk sending.
554 5.7.1Bulk sending is paused for this accountbulk_paused (403)Bulk sending is paused for the account because its bulk bounce or complaint rate passed the bulk limits. Transactional email still sends. Support resumes bulk after review. Over SMTP the server replies 554 5.7.1.
550 5.7.1Bulk email needs the account's company name and postal addressbulk_requires_postal_address (422)Bulk email must carry the sender's company name and postal address. Add both under Settings, Account. Over SMTP the server replies 550 5.7.1.
550 5.7.1Sender domain does not allow bulk emailbulk_not_allowed_for_domain (422)The from domain does not allow bulk email. Turn on "Allow bulk" in the domain's settings, ideally on a subdomain used only for bulk. Over SMTP the server replies 550 5.7.1.
452 4.2.2Sandbox email quota exceeded; try again next periodsandbox_quota_exceeded (429)The sandbox plan's emails per month are used up. Nothing was stored. The SMTP server replies 452 4.2.2.
452 4.2.2Sandbox storage is full; delete messages or upgradesandbox_storage_full (429)The sandbox plan's storage is full. Nothing was stored. Delete messages or inboxes, or upgrade. The SMTP server replies 452 4.2.2.
550 5.1.1No inbox has this addressunknown_recipient (404)No sandbox inbox or inbound inbox has this email address, its account is closed (or, for an inbound inbox, suspended), its domain no longer receives, or its account's sandbox plan no longer includes inbox addresses.
452 4.2.2This inbox's account has used its monthly email quota; try again laterinbound_quota_full (429)The inbound inbox's account has used its monthly emails (received mail shares them with sent mail, including the overage its spending cap allows). The sending server is told to retry later; nothing is dropped.
451 4.3.0Temporary server error; try again laterNoneSendPelican could not accept the message for any other reason. Retry; nothing was sent.
454 4.7.0Temporary authentication failure; try again laterNoneThe login could not be checked. Retry.
454 4.7.0Too many failed logins; try again laterNoneThis username had too many wrong passwords in a row.
530 5.7.0Authentication requiredNoneMAIL, RCPT or DATA was sent before AUTH.
454 4.7.0Too many failed logins from this address; try again laterNoneLogins from this IP address failed too often. One more attempt is allowed every few seconds (MAILFLOW_SMTP_AUTH_IP_REFILL).
421 4.7.0Too many failed logins; closing connectionNoneThis connection had too many refused logins. The server closes it.
450 4.7.1This inbox is receiving too much mail; try again laterNoneOn the inbound listener: one inbox received more messages than MAILFLOW_SANDBOX_INBOUND_BURST, refilled every MAILFLOW_SANDBOX_INBOUND_REFILL. The sending server retries later.
421 4.7.0Too many unknown recipients; closing connectionNoneOn the inbound listener: a connection tried 10 addresses no inbox has. The server closes it.
535 5.7.8This credential belongs to the other host (sending or sandbox)NoneA sending credential (mf_) was used on a sandbox port, or a sandbox inbox login (sb_) on a sending port. It counts as a failed login.

Bulk email

Newsletters, announcements and other mail to many people at once go on the bulk stream. Bulk sending is included in paid plans; on the Free plan it returns 403 plan_upgrade_required. Bulk and transactional email share your plan's monthly quota.

Bulk mail has its own queue, sending rate and reputation. A campaign of 50,000 emails waits in its own line, so it never delays a password reset sent through POST /v1/emails. Each account sends bulk at up to 10 emails per second; a large batch is spread out at that rate.

Send a batch

POST /v1/bulk/emails needs the bulk:send ability. The body is the /v1/emails body with recipients in place of to. The response has the same shape: one batch id and one entry per recipient.

curl -X POST https://sendpelican.com/v1/bulk/emails \
  -H "Authorization: Bearer <YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "from": {
      "email": "hello@yourdomain.com"
    },
    "recipients": [
      {
        "email": "ada@example.com",
        "variables": {
          "name": "Ada",
          "plan": "Pro"
        }
      },
      {
        "email": "grace@example.com",
        "variables": {
          "name": "Grace",
          "plan": "Starter"
        }
      }
    ],
    "subject": "News for you, {{ name }}",
    "html": "<p>Hi {{ name }}, here is what is new on your {{ plan }} plan.</p>",
    "text": "Hi {{ name }}, here is what is new on your {{ plan }} plan.",
    "category": "newsletter"
  }'

Laravel's Mail facade transport sends through /v1/emails, so its mail is transactional. For bulk from Laravel, call the endpoint with the HTTP client as in the Laravel tab above, or point Laravel's smtp mailer at a bulk SMTP credential.

FieldTypeRequiredNotes
recipientsarray of objectsYes1 to 500 recipients, in place of to. Each gets its own message, status and events. Addresses must differ, ignoring case.
recipients[].emailstringYesThe recipient address.
recipients[].variablesobjectNoUp to 50 values for this recipient's {{ name }} placeholders. Names start with a letter or underscore and hold letters, digits and underscores, up to 64 characters. Values are strings, numbers, booleans or null, up to 1000 characters.
subject, html, textstringAs /v1/emailsMay contain {{ name }} placeholders, filled per recipient.
from, reply_to, headers, tags, metadata, track_opens, track_clicks, categoryAs /v1/emailsThe same for every recipient of the batch.

Variables

Write {{ name }} in the subject, HTML or text, with or without spaces inside the braces. Each recipient's message gets that recipient's value. In the HTML body the value is HTML-escaped, so a value such as <b> shows as text and can never add markup or script. In the subject and text body it is used as is. A placeholder with no value for that recipient becomes empty. Email Logs show each recipient's subject as sent.

Limits

  • 500 recipients per request. The request body must be under 10 MB.
  • 50 variables per recipient, each up to 1000 characters.
  • The whole batch is accepted or refused. If your quota, the daily limit or a warming domain's cap cannot cover every recipient who is not suppressed, the request returns 429 and nothing is queued or counted.
  • An Idempotency-Key covers the whole batch: a retry with the same key returns the original messages and sends nothing new. Keys are shared with /v1/emails, so never reuse a key across the two endpoints.
  • A subject longer than 998 characters after its variables are filled is cut to 998.
  • While a domain warms up, bulk email may use at most 50% of its daily cap, so a campaign leaves room for the domain's transactional email.

Before you send bulk

  • Turn on Allow bulk on the domain's Bulk Sending tab. Otherwise the request returns 422 bulk_not_allowed_for_domain. Send bulk from a subdomain such as news.yourdomain.com: complaints about newsletters then stay off the domain your receipts and sign-in codes come from.
  • Add your company name and postal address under Settings, Account. Anti-spam laws require them in marketing email, and SendPelican adds them to the footer of every bulk email. Without them the request returns 422 bulk_requires_postal_address.

Unsubscribe and suppressions

Every bulk email carries an unsubscribe link in its footer and one-click List-Unsubscribe headers (RFC 8058), which Gmail and Yahoo require of bulk senders, whatever the domain's footer setting. A List-Unsubscribe header you set yourself is replaced on bulk email. Over SMTP a bulk message needs a text or HTML part to carry the footer. An unsubscribe from a bulk email suppresses the address for bulk email only, so the recipient still gets receipts and password resets. A hard bounce or a spam complaint suppresses the address for every stream. POST /v1/suppressions takes an optional stream: "bulk" or "transactional" suppresses for that stream only, and leaving it out suppresses for every stream. A scope only widens: an address already suppressed for every stream stays that way, and suppressing it for the other stream as well makes it every stream. Each suppression in GET /v1/suppressions shows its stream, null for every stream.

Bulk over SMTP

Create an SMTP credential with the Bulk stream. Every message sent with it is bulk email, with the same footer, headers and rules as the API. Connect to bulk.smtp.sendpelican.com on the same ports; the credential, not the host name, decides the stream. Signed messages (S/MIME, PGP, or your own DKIM signature) cannot be sent as bulk, because the footer would break the signature, and are refused with 550 5.6.0.

Bulk health

Bulk email has stricter limits than your account as a whole. If more than 4% of your bulk email bounces, or more than 0.08% draws spam complaints, over at least 200 bulk emails in 7 days, bulk sending is paused for your account. With fewer than 1251 bulk emails in the window, a single complaint is above 0.08%, so send bulk only to people who asked for it. Transactional email keeps sending. While paused, the bulk endpoint returns 403 bulk_paused and queued bulk email fails with that error. Contact support to resume.

Messages, events and webhooks carry a stream field, transactional or bulk, and GET /v1/emails?stream=bulk lists one stream.

Templates

Store an email's subject, HTML and text once, under Sending, Templates in the dashboard or through the API below, then send it by its ID with different values each time. Each template has an ID (a UUID), a stream it sends on, an optional category and, optionally, the one domain it may be sent from.

Send with a template

In POST /v1/emails, pass template_uuid and template_variables (a JSON object, nested objects and lists allowed, up to 64 KB) in place of subject, html, text and category. The subject, bodies and category always come from the template; sending any of those four with template_uuid is 422 validation_failed, so a request never half-overrides a template. Everything else (to, from, reply_to, headers, tags, metadata, tracking, Idempotency-Key) works as usual.

curl -X POST https://sendpelican.com/v1/emails \
  -H "Authorization: Bearer <YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "from": {
      "email": "hello@yourdomain.com"
    },
    "to": [
      "recipient@example.com"
    ],
    "template_uuid": "0199d6f2-6c1e-7a4b-9b1d-2f3c4d5e6f70",
    "template_variables": {
      "first_name": "Ada",
      "order": {
        "id": "A-1001"
      },
      "items": [
        {
          "name": "Kettle"
        }
      ]
    }
  }'

The template is rendered for each recipient when the email is sent, from the template as it was when the request was accepted, so editing a template never changes mail already queued. A variable with no value renders empty. A bulk template goes through POST /v1/bulk/emails: put shared values in template_variables and each recipient's own in recipients[].template_variables, which win name by name. Errors: 422 template_not_found, 422 template_stream_mismatch (a bulk template on the transactional endpoint, or the reverse) and 422 template_domain_mismatch. Email Logs and GET /v1/emails/{id} show the template_uuid each email was sent with.

Over SMTP

Add X-SP-Template: <template ID> and, if the template has variables, X-SP-Template-Variables: {"first_name": "Ada"} (one JSON object). The template replaces the message's subject and bodies; From, Reply-To and the recipients are kept, attachments are not sent, and both headers are removed before delivery. Leave out X-Mailflow-Category: the template sets the category.

Template language

  • {{name}} inserts a value, HTML-escaped in the HTML body. {{{name}}} inserts it as is. The subject and text body are never escaped.
  • {{user.name}} reads into objects; inside a loop, {{../name}} reads the enclosing value and {{@root.name}} the top level.
  • {{#if paid}}…{{else if trial}}…{{else}}…{{/if}}, {{#unless}} and {{#with order}}. Empty strings, 0, false, null and empty lists or objects count as false.
  • {{#each items}}{{name}}{{/each}} loops over a list or an object, with {{this}}, {{@index}}, {{@first}}, {{@last}} and {{@key}}, and an optional {{else}} for an empty list.
  • {{! note}} and {{!-- note --}} are comments. {{__unsubscribe_url__}} is the recipient's one-click unsubscribe link.

Helpers, partials and other Handlebars extras are not supported: work the value out in your app and pass it in. A template with a syntax error cannot be saved; the error names its line (422 template_syntax_error over the API).

Templates API

These routes need the templates:manage ability. Your plan sets how many templates the account may hold; one more is 403 template_limit_reached.

MethodPathDoes
GET/v1/templatesYour templates, oldest first. Filters: category, limit (1 to 100). Pages with links.next like GET /v1/emails.
POST/v1/templatesCreate. Body: name, subject, html (required); text, category, stream (transactional or bulk), domain (one of your domain names, or null for any), test_data (an object).
GET/v1/templates/{id}One template with its subject, html, text and test data.
PATCH/v1/templates/{id}Change any of the fields above. Changing html or text of a drag-and-drop template turns it into an HTML template.
DELETE/v1/templates/{id}Delete. Sends that name it are refused from then on; mail already accepted still goes out.

Send later

Add send_at to POST /v1/emails or POST /v1/bulk/emails: an ISO 8601 date and time with a time zone, such as 2026-10-20T09:30:00Z or 2026-10-20T10:30:00+01:00, at most 72 hours ahead. Each recipient's email comes back with status scheduled and is sent at that time, within about a minute. A time up to five minutes in the past sends at once; anything earlier, later than 72 hours or without a time zone is 422 validation_failed. Over SMTP, use the header X-SP-Send-At with the same format; it is removed before delivery.

A scheduled email counts against your quota when you send the request, like any other email, so the request fails with 429 quota_exceeded then rather than at send time. Templates render at send time from the template as it was when you sent the request.

Cancel one before its time with DELETE /v1/emails/{id}/schedule (a key with emails:send or bulk:send), or with Cancel send in Email Logs. It becomes cancelled and is never sent; it still counts against the quota, as a failed email does. An email that has already left the schedule gets 409 not_scheduled. Webhooks can follow both steps with email.scheduled and email.cancelled.

Email Sandbox

The Email Sandbox catches the mail your development, staging and CI apps send and never delivers it. Each inbox has its own SMTP login (a username starting sb_). Point the app at smtp.sendpelican.com port 2525 with that login, and every message lands in the inbox, where you see its HTML, text, headers, raw source and attachments in the dashboard or through the API below.

The sandbox host and the sending host are separate doors. A sending credential on the sandbox port, or a sandbox login on a sending port, gets 535 5.7.8, so a staging app cannot send real mail by mistake.

Point your app at the sandbox

Create an inbox under Sandbox, Inboxes in the dashboard and copy its username and password into your app's mail settings in place of the placeholders. Nothing else changes: the From address can be on any domain, verified or not.

# Laravel 11+. On Laravel 10 or older, use MAIL_ENCRYPTION=tls in place of MAIL_SCHEME.
MAIL_MAILER=smtp
MAIL_SCHEME=smtp
MAIL_HOST=smtp.sendpelican.com
MAIL_PORT=2525
MAIL_USERNAME=<SMTP_USERNAME>
MAIL_PASSWORD=<SMTP_PASSWORD>
MAIL_FROM_ADDRESS=app@staging.example.com

Send to an inbox's email address

On paid Sandbox plans each inbox also has its own email address, shown on the inbox's Integration tab. Mail sent there from anything that sends email (a mail client, a CRM, another email service) lands in the inbox like mail sent over SMTP, and is never delivered. Unknown addresses are refused, and an inbox that receives a burst of mail is asked to wait, so a sender retries later.

Read an inbox with POP3

When the server offers POP3, each inbox's Integration tab shows the host and port (995, TLS from the start). Log in with the inbox's SMTP username and password using USER and PASS. RETR marks a message read; a message you DELE is deleted from the inbox when you QUIT.

What you see for each message

The rendered HTML (in a sandboxed frame that loads no remote content until you ask), the text part, the raw source, the headers and the attachments. HTML checks runs static rules over the markup and CSS: elements mail clients strip (scripts, forms, iframes, video), linked stylesheets, CSS position, flexbox, grid and media queries, a missing title or language, images without alt text, inline images over 100 KB, HTML over Gmail's 102 KB clipping size, a missing text part, and a missing unsubscribe link or header. It reads the HTML; it does not render it in real mail clients. When the server runs SpamAssassin, the Spam tab shows SpamAssassin's score and every rule that matched.

Sandbox API

The sandbox routes need the sandbox:read, sandbox:manage or sandbox:send ability. Developers on your team can create keys that carry only these abilities; such a key gets 403 missing_ability on every route outside /v1/sandbox, and it reaches only the projects and inboxes shared with the developer when the key was made: others are 404, and changing an inbox it only views is 403 forbidden. Keys made by owners and admins reach the whole sandbox.

MethodPathAbilityDoes
GET/v1/sandbox/projectssandbox:readYour projects, each with its number of inboxes.
POST/v1/sandbox/projectssandbox:manageCreate a project, body {"name": "Checkout"}.
PATCH/v1/sandbox/projects/{id}sandbox:manageRename a project, body {"name": "Shop"}.
DELETE/v1/sandbox/projects/{id}sandbox:manageDelete an empty project. With {"move_to": "<project id>"} its inboxes move there first; without it a project with inboxes gets 409 sandbox_project_not_empty.
GET/v1/sandbox/inboxessandbox:readYour inboxes, and the sandbox plan's usage this period.
POST/v1/sandbox/inboxessandbox:manageCreate an inbox, body {"name": "Staging", "project_id": "<optional project id>"}. Without a project it goes in your first one. The response holds the SMTP password, once.
DELETE/v1/sandbox/inboxes/{id}sandbox:manageDelete the inbox and every message in it.
POST/v1/sandbox/inboxes/{id}/cleansandbox:manageDelete every message, keep the inbox and its login.
GET/v1/sandbox/inboxes/{id}/messagessandbox:readNewest first. Filters: search, to, from, subject, since, unread, limit (1 to 100). Pages with links.next like GET /v1/emails.
GET/v1/sandbox/inboxes/{id}/messages/waitsandbox:readWait for a message. Filters: to, from, subject, search, since; timeout 1 to 30 seconds.
POST/v1/sandbox/inboxes/{id}/messagessandbox:sendCapture over HTTP: the POST /v1/emails body plus attachments [{filename, content_type, content_base64}].
GET/v1/sandbox/messages/{id}sandbox:readEnvelope, headers, attachment list and links to the parts.
GET/v1/sandbox/messages/{id}/raw, /html, /textsandbox:readThe .eml, the HTML part as sent, the text part.
GET/v1/sandbox/messages/{id}/attachments/{index}sandbox:readOne attachment, always as a download.
PATCH/v1/sandbox/messages/{id}sandbox:manageBody {"read": true} or {"read": false}.
DELETE/v1/sandbox/messages/{id}sandbox:manageDelete one message.
POST/v1/sandbox/messages/{id}/forwardsandbox:manageBody {"to": "qa@example.com"}: forward the message, attached, to a confirmed forward address.
GET/v1/sandbox/inboxes/{id}/forward-rulessandbox:manageThe inbox's auto-forward rules.
POST/v1/sandbox/inboxes/{id}/forward-rulessandbox:manageBody {"to": "qa@example.com", "field": "to|from|subject", "contains": "text"}: forward every matching captured message to a forward address. Without field every message matches.
DELETE/v1/sandbox/inboxes/{id}/forward-rules/{rule}sandbox:manageRemove an auto-forward rule.
GET/v1/sandbox/forward-addressessandbox:manageThe account's forward addresses and whether each is confirmed.
POST/v1/sandbox/forward-addressessandbox:manageBody {"email": "qa@example.com"}: add an address; it gets a link to confirm. Posting an unconfirmed one again sends a new link (at most every 5 minutes).
DELETE/v1/sandbox/forward-addresses/{id}sandbox:manageRemove a forward address.

Forwarding

To look at a captured email in a real mail client, forward it. A forward is a new email from SendPelican's sandbox address with the captured message attached unchanged as original.eml, and it goes only to an address on your forward list whose owner opened the emailed link and confirmed it. Forwards count against the sandbox plan's forwards per month; Sandbox Free has none. An address that bounced or complained before gets nothing.

On paid sandbox plans an inbox can also have auto-forward rules: each forwards every captured message whose To, From or Subject contains some text (or every message) to a confirmed forward address, within about a minute of capture. Each auto-forward uses one of the month's forwards; when they run out, auto-forwarding pauses until the next period.

A forward is sent and logged like any other email, so SendPelican keeps a copy of it, with the whole captured message, in the sending log of the account that sends forwards. That copy is not part of your sandbox: your plan's retention, deleting the message or inbox, and closing your account do not remove it. It is deleted 7 days after the forward. Forward only test mail you are willing to have kept that long.

Wait for an email in a test

GET .../messages/wait answers as soon as a matching message lands, with the same body as GET /v1/sandbox/messages/{id}, or with 404 not_found when timeout passes first. It matches mail that arrived at or after since, which defaults to five seconds before the call, so mail sent just before the call still counts. Each wait holds a server worker, so an account may have 5 waits open at once; one more gets 429 sandbox_wait_limit.

# The app under test sends through the sandbox: MAIL_HOST=smtp.sendpelican.com MAIL_PORT=2525,
# with the inbox's sb_ username and password. Then the test:
API=https://sendpelican.com/v1/sandbox
AUTH="Authorization: Bearer $SANDBOX_API_KEY"   # a key with sandbox:read and sandbox:manage

curl -sf -X POST "$APP_URL/signup" -d email=ada@example.com

# Blocks until the email lands (up to 30 s), else 404.
MESSAGE=$(curl -sf -H "$AUTH" "$API/inboxes/$SANDBOX_INBOX_ID/messages/wait?to=ada@example.com&subject=Confirm&timeout=30")
LINK=$(curl -sf -H "$AUTH" "$(jq -r .data.links.html <<<"$MESSAGE")" | grep -o 'https://[^"]*/confirm/[^"]*' | head -n 1)
curl -sf "$LINK"

# Start the next run with an empty inbox.
curl -sf -X POST -H "$AUTH" "$API/inboxes/$SANDBOX_INBOX_ID/clean"

Errors

Errors share one shape. code is stable and safe to branch on; message is for people.

{
    "error": {
        "code": "domain_not_verified",
        "message": "The from domain 'yourdomain.com' is not verified on this account.",
        "details": {
            "domain": "yourdomain.com"
        }
    }
}
StatusCodeWhereMeaning
404unknown_recipientthe inbound listener (SMTP 550)No sandbox inbox or inbound inbox has this email address, its account is closed (or, for an inbound inbox, suspended), its domain no longer receives, or its account's sandbox plan no longer includes inbox addresses.
429inbound_quota_fullthe inbound listener (SMTP 452)The inbound inbox's account has used its monthly emails (received mail shares them with sent mail, including the overage its spending cap allows). The sending server is told to retry later; nothing is dropped.
503inbound_unavailablePOST /v1/inbound/inboxes, /app inbound inboxes pageThe server has no shared inbound domain, so hosted inbox addresses cannot be created. Create the inbox on one of your own domains.
422inbound_domain_not_enabledPOST /v1/inbound/inboxes, /app inbound inboxes pageThe domain is not verified, Receive email is off on its domain page, or the server takes no mail for customer domains. details.domain names it.
403inbound_inbox_limit_reachedPOST /v1/inbound/inboxes, /app inbound inboxes pageThe Email API/SMTP plan allows no more inbound inboxes. Delete one or upgrade. details.max_inboxes is the limit.
409inbound_address_takenPOST /v1/inbound/inboxes, /app inbound inboxes pageAnother inbox already receives at this address, or the domain already has a catch-all inbox.
422validation_failedallThe request body or query failed validation. details maps each field to its messages.
401unauthenticatedallNo API key, or the key was revoked, has expired or is wrong.
403missing_ability/v1The API key lacks the ability this route needs. details.abilities lists it.
403account_suspendedPOST /v1/emails, POST /v1/bulk/emails, POST /v1/inbound/messages/{id}/reply and /forward, /internal/sandbox, /internal/inboundThe account is suspended or closed and cannot send. A suspended account's sandbox still captures; a closed account's does not. Inbound inboxes of a suspended or closed account receive nothing.
422domain_not_verifiedPOST /v1/emails, POST /v1/bulk/emails, POST /v1/inbound/messages/{id}/reply and /forward, /app domain pageThe from address is not on a verified domain of this account, or (domain page) an unverified domain cannot receive email.
429quota_exceededPOST /v1/emails, POST /v1/bulk/emailsThe request would pass the daily or monthly limit of the plan. Nothing was sent or reserved.
429overage_cap_reachedPOST /v1/emails, POST /v1/bulk/emails, /internal/smtpA variant of quota_exceeded on plans that bill overage: the request would pass the monthly quota plus the overage the account's spending cap allows. Nothing was sent or reserved. details has period, limit and overage_cap_pence (0 means no overage). The cap is set on the Usage & Limits page. The SMTP server replies 452 4.2.2.
429warmup_limitPOST /v1/emails, POST /v1/bulk/emailsThe from domain is warming up and the request would pass its daily warm-up cap. Nothing was sent or reserved. details has domain, stage, daily_cap, sent_today and resets_at.
429rate_limitedallToo many requests for this API key this minute (retry after the Retry-After header), or a forward address's confirmation link was sent less than 5 minutes ago (details.retry_after).
403domain_limit_reachedPOST /v1/domainsThe plan allows no more domains.
422template_not_foundPOST /v1/emails, POST /v1/bulk/emails, POST /v1/sandbox/inboxes/{id}/messages, /internal/smtpThe account has no template with that template_uuid (or X-SP-Template header). Nothing was sent.
422template_stream_mismatchPOST /v1/emails, POST /v1/bulk/emails, /internal/smtpThe template belongs to the other stream: send a bulk template through POST /v1/bulk/emails or a bulk SMTP credential, a transactional one through POST /v1/emails or a transactional credential.
422template_domain_mismatchPOST /v1/emails, POST /v1/bulk/emails, /internal/smtpThe template is limited to one domain and the From address is on another. details.domain names it.
409not_scheduledDELETE /v1/emails/{id}/scheduleThe email is not scheduled any more: it was already queued at its send_at, sent, or cancelled. details.status says which.
403template_limit_reachedPOST /v1/templates, /app templates pageThe plan allows no more templates. Delete one or upgrade. details.max_templates is the limit.
403template_image_limit_reached/app template editorThe account has the most template images allowed (500).
422template_syntax_errorPOST /v1/templates, PATCH /v1/templates/{id}, /app templates pageThe subject, HTML or text does not parse. details has field, line and reason. Nothing was saved.
422domain_owned_elsewherePOST /v1/domains/{id}/verifyAnother account has already verified this domain name.
403plan_upgrade_requiredPOST /v1/webhooks, POST /v1/bulk/emailsThe plan does not include this feature: webhooks, or bulk sending (Free plan). Over SMTP the server replies 550 5.7.1.
403bulk_pausedPOST /v1/bulk/emailsBulk sending is paused for the account because its bulk bounce or complaint rate passed the bulk limits. Transactional email still sends. Support resumes bulk after review. Over SMTP the server replies 554 5.7.1.
422bulk_requires_postal_addressPOST /v1/bulk/emailsBulk email must carry the sender's company name and postal address. Add both under Settings, Account. Over SMTP the server replies 550 5.7.1.
422bulk_not_allowed_for_domainPOST /v1/bulk/emailsThe from domain does not allow bulk email. Turn on "Allow bulk" in the domain's settings, ideally on a subdomain used only for bulk. Over SMTP the server replies 550 5.7.1.
403sandbox_inbox_limit_reachedPOST /v1/sandbox/inboxes, /app sandbox inboxes pageThe sandbox plan allows no more inboxes. Delete one or upgrade the Email Sandbox plan. details.max_inboxes is the limit.
403sandbox_project_limit_reachedPOST /v1/sandbox/projects, /app sandbox inboxes pageThe sandbox plan allows no more projects. Delete one or upgrade the Email Sandbox plan. details.max_projects is the limit.
409sandbox_project_not_emptyDELETE /v1/sandbox/projects/{id}The project still has inboxes. Pass move_to with another project id to move them, or delete them first.
409contact_existsPOST /v1/contactsA contact with this email already exists. Update it with PATCH /v1/contacts/{id}, or use POST /v1/contacts/upsert. details.email names it.
403contact_limit_reachedPOST /v1/contacts, POST /v1/contacts/upsert, POST /v1/contacts/import, /app contacts pageThe Email Marketing plan allows no more contacts, or an import would pass the limit, in which case nothing was imported. details.max_contacts is the limit.
403contact_field_limit_reached/app custom fields pageThe account has the most custom fields allowed (100).
409campaign_not_editable/app campaign pageThe campaign has started sending, so its content, sender and audience are fixed.
422campaign_not_ready/app campaign pageA pre-send check failed: sender domain, postal address, content, an excluded segment that no longer reads, audience, a paused list, the monthly marketing email limit, the plan's contacts or a bulk pause. details.checks names each one that failed.
409campaign_paused_for_abuse/app campaign pageThe campaign paused itself for its bounces or complaints; only support can let it resume.
404not_foundallNo such resource on this account.
405method_not_allowedallThe route exists but not with this HTTP method.
413payload_too_largeallThe server refused the request body as too large.
400bad_requestallThe request could not be read, for example malformed JSON.
403forbiddenallThe request is not allowed.
4xx/5xxhttp_errorallAny other HTTP error. The status code says which.
500server_errorallUnexpected server error. Safe to retry with the same Idempotency-Key.
401invalid_credentialsPOST /auth/loginEmail or password is incorrect.
403two_factor_requiredPOST /auth/login, /dashboardPOST /auth/login: the login uses two-factor authentication, which this endpoint does not take; sign in at /app/login. /dashboard: the account requires two-factor authentication and its grace period is over; set it up on the profile page.
419csrf_token_mismatch/auth, /dashboardThe session CSRF token is missing or stale. Call GET /sanctum/csrf-cookie again.
409already_subscribedPOST /dashboard/billing/checkoutThe account already has a subscription. Switch plans on the Billing page.
409payment_incompletePOST /dashboard/billing/checkoutA subscription is waiting for its first payment.
409billing_customer_missing/dashboard/billingThe account's Stripe customer no longer exists but the account has subscriptions on record. Contact support.
503billing_unavailable/dashboard/billingStripe returned an error. Nothing changed. Retry later.
404payment_method_not_found/app Payment & invoices pageThe card is not saved on this account's Stripe customer.
409payment_method_required/app Payment & invoices pageA subscription still bills this card: it is the default or the only one. Add or choose another card first.
409card_setup_incomplete/app Payment & invoices pageThe bank has not confirmed the card setup. Nothing changed.
422invoice_details_rejected/app Payment & invoices pageStripe refused the invoice details, such as a tax ID it could not validate. The message gives its reason.
422plan_not_purchasablePOST /dashboard/billing/checkoutThat plan cannot be bought through checkout.
422plan_not_switchable/app billing pageThe plan is the current one, not public, or has no Stripe price yet.
409not_subscribed/app billing pageThe account has no subscription to switch, keep or cancel.
409subscription_not_active/app billing pageThe subscription is past due or incomplete. Fix the payment in the billing portal before switching plans.
409subscription_cancelling/app billing pageThe subscription cancels at the end of the period. Renew it in the billing portal before switching plans.
409upgrade_awaiting_payment/app billing pageAn upgrade is waiting for its invoice to be paid. Pay it from the Billing page, or wait until it lapses, before switching again.
409quote_expired/app billing pageThe price quote in the switch dialog is more than 15 minutes old. Open the switch again.
413message_too_largePOST /v1/sandbox/inboxes/{id}/messages, /internal/smtp, /internal/sandbox, /internal/inboundThe SMTP message is over 10 MB, over the sandbox plan's message size, or over the size limit for received mail. The SMTP server replies 552.
503sandbox_forward_unavailable/v1/sandbox/forward-addresses, POST /v1/sandbox/messages/{id}/forwardForwarding is not set up on this server, or the account that sends forwards cannot send right now. Nothing was sent or counted; try again later.
403sandbox_auto_forward_not_includedPOST /v1/sandbox/inboxes/{id}/forward-rules, /app sandbox inbox pageThe sandbox plan has no auto-forward rules. Upgrade the Email Sandbox plan.
403sandbox_auto_forward_rule_limitPOST /v1/sandbox/inboxes/{id}/forward-rules, /app sandbox inbox pageThe inbox has as many auto-forward rules as the sandbox plan allows. details.max_rules is the limit.
403sandbox_forward_not_included/v1/sandbox/forward-addresses, POST /v1/sandbox/messages/{id}/forwardThe sandbox plan does not include forwarding (Sandbox Free). Upgrade the Email Sandbox plan.
403sandbox_forward_address_limitPOST /v1/sandbox/forward-addressesThe account has the most forward addresses allowed (10). Remove one first.
422forward_address_unverifiedPOST /v1/sandbox/messages/{id}/forwardThe to address is not a forward address of the account, or its emailed link was not confirmed yet. Nothing was sent.
429sandbox_forward_limitPOST /v1/sandbox/messages/{id}/forwardThe sandbox plan's forwards this month are used up. Nothing was sent.
429sandbox_wait_limitGET /v1/sandbox/inboxes/{id}/messages/waitToo many waits are open for the account (5) or on the server. Each wait holds a server worker until it returns; retry when one of yours has returned.
429sandbox_quota_exceededPOST /v1/sandbox/inboxes/{id}/messages, /internal/sandboxThe sandbox plan's emails per month are used up. Nothing was stored. The SMTP server replies 452 4.2.2.
429sandbox_storage_fullPOST /v1/sandbox/inboxes/{id}/messages, /internal/sandboxThe sandbox plan's storage is full. Nothing was stored. Delete messages or inboxes, or upgrade. The SMTP server replies 452 4.2.2.
422sender_not_allowed/internal/smtpThe SMTP message names its sender in a way SendPelican refuses: two From headers, a From with no address, several addresses or a group, or a Sender, Resent-From or Resent-Sender header. The SMTP server replies 550 5.7.1.
503smtp_internal_disabled/internal/smtpMAILFLOW_SMTP_INTERNAL_SECRET is not set, so the SMTP server cannot reach Laravel.
403wrong_key_type/v1An organization token was sent to an account route, or an account API key to /v1/org. Each kind works only on its own routes.
403sub_account_limit_reachedPOST /v1/org/accounts, /app sub-accounts pageThe organization has the most accounts allowed (100). details.max_accounts is the limit.

Idempotency

Send an Idempotency-Key header (1 to 100 characters) with POST /v1/emails so a retry after a timeout cannot send twice. A repeat with the same key returns the original messages with 200 OK and sends nothing. Use a new key for each distinct email, for example your order ID plus the email type.

Idempotency-Key: order-123-receipt

Rate limits and quotas

Each API key may make 600 requests a minute. Past that, requests return 429 rate_limited with a Retry-After header.

Your plan sets a monthly quota and, on the free plan, a daily limit. A send reserves one unit per recipient that is not suppressed, plus one per message when the domain has an auto BCC address. If either window would overflow, the whole request returns 429 quota_exceeded and nothing is sent. A newly verified domain also has a daily warm-up cap. GET /v1/usage shows what is left.

Domain warm-up

Mailbox providers such as Gmail and Outlook distrust a new domain that suddenly sends thousands of emails. SendPelican also sends every customer's mail through shared infrastructure, so one domain's bounces and complaints affect everyone. A newly verified domain therefore starts with a daily cap that grows as it proves it sends wanted mail. The cap counts the same way as your quota: suppressed recipients are free, and each auto BCC copy counts.

StageEmails a day from the domain
1200
2500
31,000
42,500
55,000
610,000
725,000
850,000
After stage 8Plan limits only

Every day at 01:00 UTC SendPelican looks at the domain's sends from the previous day. A day counts only when the domain sent at least half of that day's cap. Then:

  • Bounces under 2% and complaints under 0.05%: the domain moves up one stage. After the last stage, warm-up ends.
  • Bounces above 2.5% or complaints above 0.05%: the domain moves back one stage.
  • Anything in between, or too few sends: the domain stays where it is.

A request that would pass today's cap returns 429 warmup_limit, and nothing in it is sent or counted. Over SMTP the reply is 452 4.2.2, a temporary error, so SMTP clients queue the message and retry. Send the rest after resets_at, or spread sending through the day. GET /v1/domains/{id} shows the domain's warmup status, stage, cap and sends today, and the domain page in the dashboard shows the same.

{
    "error": {
        "code": "warmup_limit",
        "message": "'yourdomain.com' is warming up and has reached today's limit of 200 emails.",
        "details": {
            "domain": "yourdomain.com",
            "stage": 1,
            "daily_cap": 200,
            "sent_today": 199,
            "resets_at": "2026-10-15T00:00:00+00:00"
        }
    }
}

Moving a domain that already sends with a good reputation from another provider? Contact support and we can skip warm-up for it.

Tracking and unsubscribe

Each domain has open and click tracking defaults, both on until you change them on the domain's Tracking Settings tab. track_opens and track_clicks in a request override the default for that request.

With the unsubscribe link turned on for a domain, SendPelican appends a footer to the HTML and text bodies and adds List-Unsubscribe and List-Unsubscribe-Post: List-Unsubscribe=One-Click headers (RFC 8058). An unsubscribe suppresses the address for your account and sends an email.unsubscribed event. A List-Unsubscribe header you send yourself is kept as is.

Bulk email always carries the footer and headers, whatever the domain setting, and an unsubscribe from it stops bulk email only. See Bulk email.

Webhooks

Add endpoints in the dashboard or with POST /v1/webhooks. Endpoints belong to the account and receive events from all its domains and streams, unless you set stream (transactional or bulk) or domain (a domain id) to receive one only. For HTTP basic auth, put the credentials in the URL (https://user:password@example.com/hooks); responses show the password as ********, and sending that mask back keeps the stored password. SendPelican sends a POST with a JSON body for each event an endpoint subscribes to:

{
    "id": "evt_01k7a9x3q2m8v5r4t6y0w1z2b3",
    "type": "email.bounced",
    "created_at": "2026-10-14T09:30:00Z",
    "data": {
        "message_id": "01k7a9w8e5n3c2b1x0z9y8v7u6",
        "to": "ada@example.com",
        "stream": "transactional",
        "tags": [
            "receipt"
        ],
        "metadata": {
            "order_id": "123"
        },
        "category": "Receipt",
        "bounce": {
            "type": "Permanent"
        }
    }
}

The id stays the same across retries, so use it to drop duplicates. Answer with any 2xx status. A failed delivery is retried after 30 s, 2 min, 10 min, 30 min, 2 h, 6 h and 12 h, up to 8 attempts. An endpoint is turned off after 50 failures in a row. Send test in the dashboard posts a sample event with "test": true, signed the same way, and counts toward neither retries nor failures.

Verify the signature

Each request has a Mailflow-Signature: t=<unix seconds>,v1=<hex> header. v1 is the HMAC-SHA256 of <t>.<raw request body>, keyed with the endpoint secret (whsec_...) shown when you create the endpoint. Compute it over the raw bytes, before any JSON parsing, compare in constant time, and reject old timestamps.

function mailflowSignatureIsValid(string $header, string $rawBody, string $secret, int $toleranceSeconds = 300): bool
{
    if (! preg_match('/^t=(\d+),v1=([0-9a-f]{64})$/', $header, $m)) {
        return false;
    }
    $expected = hash_hmac('sha256', $m[1].'.'.$rawBody, $secret);

    return hash_equals($expected, $m[2]) && abs(time() - (int) $m[1]) <= $toleranceSeconds;
}

// In a controller: mailflowSignatureIsValid($request->header('Mailflow-Signature'), $request->getContent(), $secret)

Event types

Webhook typeSubscribe asMeaning
email.scheduledscheduledAccepted with send_at; waits until then. data.send_at says when.
email.queuedqueuedAccepted by the API and waiting for a worker; for a scheduled email, its time has come.
email.sentsentHanded to the sending provider.
email.delivereddeliveredThe recipient's mail server accepted the message.
email.bouncedbouncedThe message bounced. A permanent bounce suppresses the address.
email.complainedcomplainedThe recipient marked the message as spam. The address is suppressed.
email.openedopenedFirst open of the message (open tracking on).
email.clickedclickedFirst click on a link (click tracking on), once per link.
email.failedfailedSendPelican could not send the message. data.error says why.
email.suppressedsuppressedNot sent, because the address is on the suppression list.
email.unsubscribedunsubscribedThe recipient used the unsubscribe link or one-click header. The address is suppressed.
email.cancelledcancelledA scheduled email was cancelled before its time and will not be sent.
campaign.sentcampaign.sentEvery recipient of the campaign was accepted for sending. data.recipients counts them.
campaign.completedcampaign.completedThe last email of the campaign left the queue for delivery, or failed or was suppressed. data.stats has the totals so far.