Skip to main content
ScrubiMail

Sending API

Send one email or a whole campaign from a verified domain, then follow each message to delivery. Everything lives under /send/.

Related:Email sendingTransactional email

Checked against the API source on

Conventions

  • Base path: https://api.scrubimail.com/scrubimail/api/v1/send/. Authenticate with X-API-Key. Set up a domain first: Sending setup.
  • Ids are UUIDs. List endpoints (domains, templates, campaigns, suppressions, history) return {count, next, previous, results}, 20 items per page; pass page and page_size (maximum 100).
  • 1 sending credit = 1 email. Sending credits are separate from validation credits.
  • Messages are accepted with 202 and delivered asynchronously. The message status updates to delivered or bounced.

Send

Send one email

POST/send/
Scope: send1 sending credit

Sends a single email from a verified domain. The call returns 202 once the message is handed to the sending service; delivery happens asynchronously, so track it with the status endpoint.

from_email must be on the domain you reference in sending_domain_id. A From address on a different domain is rejected with 400. The message is DKIM-signed with that domain, so a From address elsewhere could not align under DMARC anyway.

If you leave out text_content, a plain-text part is generated from the HTML, because mailbox providers score HTML-only mail lower. The credit is taken when the call is accepted and given back if the message is refused or cannot be handed off.

Marketing mail needs one-click unsubscribe. Set list_unsubscribe to true, or put {{unsubscribe_url}} in the content, and the message gets the List-Unsubscribe headers and a visible link. Leave it off for transactional mail such as receipts and password resets.

Body

Send one email: Body
NameTypeRequiredDescription
sending_domain_idUUIDYesId of one of your sending domains. The domain must be verified.
from_emailstringYesSender address. Its domain must match the sending domain, or the request is rejected with 400.
from_namestringYesSender display name, up to 255 characters.
to_emailstringYesRecipient address. One recipient per call; use bulk for many.
subjectstringYesUp to 998 characters. May contain {{tags}}.
html_contentstringYesHTML body. May contain {{tags}}; values are HTML-escaped here.
text_contentstringNoPlain-text body. Generated from the HTML when omitted.
to_namestringNoRecipient display name. Feeds {{name}}, {{first_name}} and {{last_name}}.
reply_tostringNoReply-To address.
tagsstring[]NoFree-form labels stored in metadata.tags.
variablesobjectNoValues for custom {{tags}}. At most 50 keys, 1,000 characters per value; keys are letters, digits and underscores.
attachmentsobject[]NoUp to 10 files, 10 MB in total. See attachments.
list_unsubscribebooleanNoAdds one-click unsubscribe. Default false.

Request

curl -X POST "https://api.scrubimail.com/scrubimail/api/v1/send/" \
  -H "X-API-Key: $SCRUBIMAIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "sending_domain_id": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "from_email": "[email protected]",
  "from_name": "Your Company",
  "to_email": "[email protected]",
  "to_name": "Ada Lovelace",
  "subject": "Welcome, {{first_name|there}}!",
  "html_content": "<p>Hi {{first_name|there}}, thanks for joining {{company}}.</p>",
  "text_content": "Hi {{first_name|there}}, thanks for joining {{company}}.",
  "reply_to": "[email protected]",
  "tags": [
    "welcome"
  ],
  "variables": {
    "company": "Kofi Logistics"
  }
}'

Response

202 Accepted
{
  "id": "e5f6a7b8-1c2d-4e3f-8a9b-0c1d2e3f4a5b",
  "campaign": null,
  "to_email": "[email protected]",
  "to_name": "Ada Lovelace",
  "from_email": "[email protected]",
  "from_name": "Your Company",
  "subject": "Welcome, Ada!",
  "status": "sending",
  "message_id": "d4e5f6a7-2b3c-4d5e-9f01-a2b3c4d5e6f7",
  "sending_domain": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "metadata": {
    "tags": [
      "welcome"
    ]
  },
  "sent_at": "2026-11-16T07:30:00Z",
  "delivered_at": null,
  "bounce_type": null,
  "bounce_reason": "",
  "credits_consumed": 1,
  "created_at": "2026-11-16T07:30:00Z",
  "updated_at": "2026-11-16T07:30:00Z"
}

Errors

Send one email: errors
StatusCodeWhen
400validation_errorA field is missing or invalid. error.details lists each one.
400-Hand-built messages, body {"error": "..."}: Sending domain is not verified., Recipient is on the suppression list., or the domain of from_email does not match the sending domain.
402-No sending credits left. Body is {"error": "Insufficient credits. Please purchase more credits."}, not the standard envelope.
404-{"error": "Sending domain not found"}: the id is not one of your domains.
502-{"error": "Sending service unavailable"}: the sending service could not be reached. The credit is returned; retry with backoff.
401authentication_requiredNo API key was sent. The response carries a WWW-Authenticate header.
401invalid_credentialsThe key is unknown, inactive, expired, or the request IP is not on the key's allow-list. The response carries a WWW-Authenticate header.
403permission_deniedThe key has scopes set and send is not one of them.

Send to many recipients

POST/send/bulk/
Scope: send:bulk1 sending credit per recipient

Creates a campaign from one message and a list of recipients and sends it in the background. Every recipient gets their own personalised copy with one-click unsubscribe added.

Bulk sends need a verified domain and a DMARC record on it (Gmail and Yahoo require one from bulk senders). Without DMARC the call fails with a 400 that tells you the record to publish. Single sends do not require DMARC.

Duplicate addresses and suppressed addresses are skipped. The whole list is charged up front, 1 credit per sendable recipient, and credits for recipients that could not be handed off are returned when the run finishes. If every recipient is suppressed the call fails with No sendable recipients after suppression filtering.

Body

Send to many recipients: Body
NameTypeRequiredDescription
campaign_namestringYesLabel for the campaign, up to 255 characters.
sending_domain_idUUIDYesA verified domain with a DMARC record.
from_emailstringYesSender address on that domain. A From address on any other domain is rejected with 400.
from_namestringYesSender display name.
subjectstringYesUp to 998 characters. May contain {{tags}}.
html_contentstringYesHTML body.
recipientsobject[]YesAt least one {email, name?, variables?}. variables holds that recipient's custom tag values.
text_contentstringNoPlain-text body. Generated when omitted.
reply_tostringNoReply-To address.
attachmentsobject[]NoSent with every message. Same limits as a single send.

Request

curl -X POST "https://api.scrubimail.com/scrubimail/api/v1/send/bulk/" \
  -H "X-API-Key: $SCRUBIMAIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "campaign_name": "November newsletter",
  "sending_domain_id": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "from_email": "[email protected]",
  "from_name": "Your Company",
  "subject": "News for {{first_name|you}}",
  "html_content": "<h1>November news</h1><p>Hi {{first_name|there}}, you are on the {{plan|free}} plan.</p>",
  "recipients": [
    {
      "email": "[email protected]",
      "name": "Ada Lovelace",
      "variables": {
        "plan": "Pro"
      }
    },
    {
      "email": "[email protected]",
      "name": "Grace Hopper"
    }
  ]
}'

Response

202 Accepted
{
  "id": "c3d4e5f6-0a1b-4c2d-8e3f-4a5b6c7d8e9f",
  "name": "November newsletter",
  "template_id": "b2c3d4e5-9f8e-4d7c-a6b5-c4d3e2f1a0b9",
  "sending_domain_id": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "from_name": "Your Company",
  "from_email": "[email protected]",
  "reply_to": null,
  "status": "sending",
  "total_recipients": 2,
  "sent_count": 0,
  "delivered_count": 0,
  "bounced_count": 0,
  "opened_count": 0,
  "clicked_count": 0,
  "scheduled_at": null,
  "started_at": null,
  "completed_at": null,
  "recipient_list": [
    {
      "email": "[email protected]",
      "name": "Ada Lovelace",
      "variables": {
        "plan": "Pro"
      }
    },
    {
      "email": "[email protected]",
      "name": "Grace Hopper"
    }
  ],
  "created_at": "2026-11-16T08:00:00Z",
  "updated_at": "2026-11-16T08:00:00Z"
}

Errors

Send to many recipients: errors
StatusCodeWhen
400validation_errorA field is missing or invalid. error.details lists each one.
400-{"error": "..."}: domain not verified, no DMARC record, no sendable recipients, or the domain of from_email does not match the sending domain.
402-No sending credits left. Body is {"error": "Insufficient credits. Please purchase more credits."}, not the standard envelope.
404-{"error": "Sending domain not found"}.
401authentication_requiredNo API key was sent. The response carries a WWW-Authenticate header.
401invalid_credentialsThe key is unknown, inactive, expired, or the request IP is not on the key's allow-list. The response carries a WWW-Authenticate header.
403permission_deniedThe key has scopes set and send:bulk is not one of them.

Personalisation tags

Subjects, HTML bodies and text bodies of every send, bulk send, campaign and template are rendered per recipient. Write {{name}} where a value should go, and {{name|fallback}} to use a default when the value is missing or empty.

Personalisation syntax
You writeResult
{{first_name}}The value, or nothing when there is none.
{{first_name|there}}The value, or there when there is none.
{{ company }}Spaces inside the braces are ignored.
{{unsubscribe_url}}The recipient's one-click unsubscribe link. Using it turns on unsubscribe for a single send.
  • Built-in tags need no setup: email, name, first_name (the first word of name) and last_name (the rest).
  • Custom tags such as {{company}} or {{order_id}} take their values from variables: on a single send, or per recipient in a bulk send or campaign. Names are letters, digits and underscores and start with a letter or underscore; at most 50 variables per recipient and 1,000 characters per value. variables overrides a built-in of the same name.
  • Escaping. Values inserted into html_content are HTML-escaped, so recipient data can never inject markup. Subjects and text bodies get the raw value.
  • Anything that is not a valid tag, for example {{ 1st }}, is left exactly as written.
  • SMTP is different. Messages sent over the SMTP relay are sent as written. Fill in values in your own code first.

Attachments

attachments is accepted on POST /send/, POST /send/bulk/ and on templates (a campaign sends the template's files with every message). Each item is {filename, content, content_type, content_id?} where content is the file base64-encoded.

Attachment limits
LimitValue
Files per email10
Total size per email10 MB of file data before base64 (a base64 body is about a third larger)
Blocked file typesExecutables and scripts: exe, js, bat, cmd, com, msi, scr, vbs, ps1, jar, apk, dll, iso and similar. Zip the file or share a link instead.
Empty filesRejected.
Oversized request413 with error.code payload_too_large when the whole request body is too large.
Attachment and inline image
{
  "html_content": "<p>Your invoice is attached.</p><img src=\"cid:logo\" alt=\"Your Company\">",
  "attachments": [
    {
      "filename": "invoice-1042.pdf",
      "content": "JVBERi0xLjQK...",
      "content_type": "application/pdf"
    },
    {
      "filename": "logo.png",
      "content": "iVBORw0KGgo...",
      "content_type": "image/png",
      "content_id": "logo"
    }
  ]
}

Give a file a content_id to make it an inline image, referenced from the HTML as <img src="cid:YOUR_ID">. Each inline image needs a different content_id (letters, digits and . _ @ -). Over SMTP, attach files with your mail library as usual; the message limit there is 20 MB.

Track messages

Get a message

GET/send/status/{message_id}/
Scope: history

Delivery state of one message. The status moves queued, sending, then delivered, bounced or failed.

Path

Get a message: Path
NameTypeRequiredDescription
message_idstringYesThe message_id returned when the message was accepted.

Request

curl -X GET "https://api.scrubimail.com/scrubimail/api/v1/send/status/d4e5f6a7-2b3c-4d5e-9f01-a2b3c4d5e6f7/" \
  -H "X-API-Key: $SCRUBIMAIL_API_KEY"

Response

200 OK
{
  "id": "e5f6a7b8-1c2d-4e3f-8a9b-0c1d2e3f4a5b",
  "campaign": null,
  "to_email": "[email protected]",
  "to_name": "Ada Lovelace",
  "from_email": "[email protected]",
  "from_name": "Your Company",
  "subject": "Welcome, Ada!",
  "status": "delivered",
  "message_id": "d4e5f6a7-2b3c-4d5e-9f01-a2b3c4d5e6f7",
  "sending_domain": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "metadata": {
    "tags": [
      "welcome"
    ]
  },
  "sent_at": "2026-11-16T07:30:00Z",
  "delivered_at": "2026-11-16T07:30:02Z",
  "bounce_type": null,
  "bounce_reason": "",
  "credits_consumed": 1,
  "created_at": "2026-11-16T07:30:00Z",
  "updated_at": "2026-11-16T07:30:02Z"
}

Errors

Get a message: errors
StatusCodeWhen
404-{"error": "Message not found"}: no message with that id on your account.
401authentication_requiredNo API key was sent. The response carries a WWW-Authenticate header.
401invalid_credentialsThe key is unknown, inactive, expired, or the request IP is not on the key's allow-list. The response carries a WWW-Authenticate header.
403permission_deniedThe key has scopes set and history is not one of them.
Message statuses
statusMeaning
queuedCreated and waiting to be handed to the sending service. Campaign messages start here.
sendingHanded to the mail server. The state right after an accepted send.
deliveredThe recipient's mail server accepted the message.
bouncedThe recipient's server rejected it. bounce_type is hard or soft and bounce_reason has the server's response.
failedCould not be handed to the sending service. Nothing was delivered, and the credit is returned.

List sent messages

GET/send/history/
Scope: history

Your messages, newest first, 20 per page.

Query string

List sent messages: Query string
NameTypeRequiredDescription
statusstringNoqueued, sending, delivered, bounced or failed.
to_emailstringNoCase-insensitive substring match on the recipient.
campaign_idUUIDNoOnly messages from one campaign.
from_datedateNoYYYY-MM-DD. Sent on or after this day.
to_datedateNoYYYY-MM-DD. Sent on or before this day.
pageintegerNoPage number, starting at 1.
page_sizeintegerNoItems per page. Default 20, maximum 100.

Request

curl -X GET "https://api.scrubimail.com/scrubimail/api/v1/send/history/?status=bounced&page_size=50" \
  -H "X-API-Key: $SCRUBIMAIL_API_KEY"

Response

200 OK
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": "e5f6a7b8-1c2d-4e3f-8a9b-0c1d2e3f4a5b",
      "campaign": null,
      "to_email": "[email protected]",
      "to_name": "Ada Lovelace",
      "from_email": "[email protected]",
      "from_name": "Your Company",
      "subject": "Welcome, Ada!",
      "status": "bounced",
      "message_id": "d4e5f6a7-2b3c-4d5e-9f01-a2b3c4d5e6f7",
      "sending_domain": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
      "metadata": {
        "tags": [
          "welcome"
        ]
      },
      "sent_at": "2026-11-16T07:30:00Z",
      "delivered_at": null,
      "bounce_type": "hard",
      "bounce_reason": "550 5.1.1 user unknown",
      "credits_consumed": 1,
      "created_at": "2026-11-16T07:30:00Z",
      "updated_at": "2026-11-16T07:30:00Z"
    }
  ]
}

Errors

List sent messages: errors
StatusCodeWhen
401authentication_requiredNo API key was sent. The response carries a WWW-Authenticate header.
401invalid_credentialsThe key is unknown, inactive, expired, or the request IP is not on the key's allow-list. The response carries a WWW-Authenticate header.
403permission_deniedThe key has scopes set and history is not one of them.

Sending analytics

GET/send/analytics/
Scope: history

Account-wide totals and rates across all your messages. Rates are percentages rounded to two decimals.

Request

curl -X GET "https://api.scrubimail.com/scrubimail/api/v1/send/analytics/" \
  -H "X-API-Key: $SCRUBIMAIL_API_KEY"

Response

200 OK
{
  "total": 1500,
  "delivered": 1420,
  "bounced": 45,
  "failed": 35,
  "hard_bounces": 30,
  "soft_bounces": 15,
  "delivery_rate": 94.67,
  "bounce_rate": 3,
  "campaigns": 4,
  "suppressed": 52
}

Errors

Sending analytics: errors
StatusCodeWhen
401authentication_requiredNo API key was sent. The response carries a WWW-Authenticate header.
401invalid_credentialsThe key is unknown, inactive, expired, or the request IP is not on the key's allow-list. The response carries a WWW-Authenticate header.
403permission_deniedThe key has scopes set and history is not one of them.

Sending domains

Adding and verifying domains is covered step by step in Sending setup. The remaining operations, all with scope domains:

Domain endpoints
RequestWhat it does
POST /send/domains/Add a domain. Returns 201.
GET /send/domains/List your domains with their verification state.
GET /send/domains/{id}/One domain, including dkim_public_key and verification_details.
POST /send/domains/{id}/verify/Run the DNS checks.
DELETE /send/domains/{id}/Remove a domain. Returns 204.

Templates

A template stores a subject and body with {{tags}}. Use it in a campaign or fetch it to reuse the content in your own sends. Scope templates.

Create a template

POST/send/templates/
Scope: templates

Saves a reusable subject and body. variables in the response is read-only: it lists the custom {{tags}} the template uses (the built-ins are not listed), so you know what to supply at send time.

Body

Create a template: Body
NameTypeRequiredDescription
namestringYesTemplate name, up to 255 characters.
subjectstringYesUp to 998 characters.
html_contentstringYesHTML body.
text_contentstringNoPlain-text body.
attachmentsobject[]NoSent with every campaign message that uses the template.

Request

curl -X POST "https://api.scrubimail.com/scrubimail/api/v1/send/templates/" \
  -H "X-API-Key: $SCRUBIMAIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Welcome email",
  "subject": "Welcome to {{company|our platform}}, {{first_name|there}}!",
  "html_content": "<h1>Welcome, {{first_name|there}}!</h1><p>Your account at {{company}} is ready.</p>"
}'

Response

201 Created
{
  "id": "b2c3d4e5-9f8e-4d7c-a6b5-c4d3e2f1a0b9",
  "name": "Welcome email",
  "subject": "Welcome to {{company|our platform}}, {{first_name|there}}!",
  "html_content": "<h1>Welcome, {{first_name|there}}!</h1><p>Your account at {{company}} is ready.</p>",
  "text_content": "",
  "variables": [
    "company"
  ],
  "attachments": [],
  "created_at": "2026-11-16T07:45:00Z",
  "updated_at": "2026-11-16T07:45:00Z"
}

Errors

Create a template: errors
StatusCodeWhen
400validation_errorA field is missing or invalid. error.details lists each one.
401authentication_requiredNo API key was sent. The response carries a WWW-Authenticate header.
401invalid_credentialsThe key is unknown, inactive, expired, or the request IP is not on the key's allow-list. The response carries a WWW-Authenticate header.
403permission_deniedThe key has scopes set and templates is not one of them.
Template endpoints
RequestWhat it does
GET /send/templates/List your templates.
GET /send/templates/{id}/One template.
PUT or PATCH /send/templates/{id}/Update a template. variables is recalculated from the new content.
DELETE /send/templates/{id}/Delete a template. Returns 204.

List starter templates

GET/send/templates/starters/
Scope: templates

Eleven ready-made, email-client-safe templates you can copy into your account. Each lists the custom variables it uses.

Request

curl -X GET "https://api.scrubimail.com/scrubimail/api/v1/send/templates/starters/" \
  -H "X-API-Key: $SCRUBIMAIL_API_KEY"

Response

200 OK
[
  {
    "key": "welcome",
    "category": "Onboarding",
    "name": "Welcome email",
    "description": "Greets a new user and points them to their first step.",
    "subject": "Welcome to {{company|our platform}}, {{first_name|there}}!",
    "html_content": "<!doctype html>...",
    "text_content": "Welcome aboard, {{first_name|there}}!...",
    "variables": [
      "company",
      "action_url"
    ]
  }
]

Errors

List starter templates: errors
StatusCodeWhen
401authentication_requiredNo API key was sent. The response carries a WWW-Authenticate header.
401invalid_credentialsThe key is unknown, inactive, expired, or the request IP is not on the key's allow-list. The response carries a WWW-Authenticate header.
403permission_deniedThe key has scopes set and templates is not one of them.

Copy a starter template

POST/send/templates/from-starter/
Scope: templates

Copies a starter into your account as a normal template you can edit.

Body

Copy a starter template: Body
NameTypeRequiredDescription
keystringYesOne of welcome, verify_email, password_reset, security_alert, order_confirmation, shipping_update, invoice_reminder, newsletter, event_invitation, feedback_request, win_back.
namestringNoName for your copy. Defaults to the starter's name.

Request

curl -X POST "https://api.scrubimail.com/scrubimail/api/v1/send/templates/from-starter/" \
  -H "X-API-Key: $SCRUBIMAIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "key": "welcome"
}'

Response

201 Created
{
  "id": "b2c3d4e5-9f8e-4d7c-a6b5-c4d3e2f1a0b9",
  "name": "Welcome email",
  "subject": "Welcome to {{company|our platform}}, {{first_name|there}}!",
  "html_content": "<h1>Welcome, {{first_name|there}}!</h1><p>Your account at {{company}} is ready.</p>",
  "text_content": "",
  "variables": [
    "company"
  ],
  "attachments": [],
  "created_at": "2026-11-16T07:45:00Z",
  "updated_at": "2026-11-16T07:45:00Z"
}

Errors

Copy a starter template: errors
StatusCodeWhen
404-{"error": "Unknown starter template."}
401authentication_requiredNo API key was sent. The response carries a WWW-Authenticate header.
401invalid_credentialsThe key is unknown, inactive, expired, or the request IP is not on the key's allow-list. The response carries a WWW-Authenticate header.
403permission_deniedThe key has scopes set and templates is not one of them.

Campaigns

A campaign is a template, a recipient list and a verified domain with DMARC. POST /send/bulk/ creates and starts one in a single call. Use these endpoints when you want to stage it, edit it, pause it or resume it. Scope send:bulk. The opened_count and clicked_count fields exist but stay at 0: ScrubiMail does not track opens or clicks.

Create a campaign

POST/send/campaigns/
Scope: send:bulk

Builds a campaign from a saved template and a recipient list without sending it. Start it when you are ready. POST /send/bulk/ does both in one call.

Body

Create a campaign: Body
NameTypeRequiredDescription
namestringYesCampaign name.
sending_domain_idUUIDYesOne of your domains.
from_namestringYesSender display name.
from_emailstringYesSender address. Its domain must match the sending domain, or the request is rejected with 400.
template_idUUIDNoYour template. Required before the campaign can start.
recipient_listobject[]No{email, name?, variables?} entries. Required before the campaign can start.
reply_tostringNoReply-To address.

Request

curl -X POST "https://api.scrubimail.com/scrubimail/api/v1/send/campaigns/" \
  -H "X-API-Key: $SCRUBIMAIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Product launch",
  "template_id": "b2c3d4e5-9f8e-4d7c-a6b5-c4d3e2f1a0b9",
  "sending_domain_id": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "from_name": "Your Company",
  "from_email": "[email protected]",
  "recipient_list": [
    {
      "email": "[email protected]",
      "name": "Ada Lovelace"
    }
  ]
}'

Response

201 Created
{
  "id": "c3d4e5f6-0a1b-4c2d-8e3f-4a5b6c7d8e9f",
  "name": "November newsletter",
  "template_id": "b2c3d4e5-9f8e-4d7c-a6b5-c4d3e2f1a0b9",
  "sending_domain_id": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "from_name": "Your Company",
  "from_email": "[email protected]",
  "reply_to": null,
  "status": "draft",
  "total_recipients": 1,
  "sent_count": 0,
  "delivered_count": 0,
  "bounced_count": 0,
  "opened_count": 0,
  "clicked_count": 0,
  "scheduled_at": null,
  "started_at": null,
  "completed_at": null,
  "recipient_list": [
    {
      "email": "[email protected]",
      "name": "Ada Lovelace"
    }
  ],
  "created_at": "2026-11-16T08:00:00Z",
  "updated_at": "2026-11-16T08:00:00Z"
}

Errors

Create a campaign: errors
StatusCodeWhen
400validation_errorA field is missing or invalid. error.details lists each one.
400-The domain of from_email does not match the sending domain.
401authentication_requiredNo API key was sent. The response carries a WWW-Authenticate header.
401invalid_credentialsThe key is unknown, inactive, expired, or the request IP is not on the key's allow-list. The response carries a WWW-Authenticate header.
403permission_deniedThe key has scopes set and send:bulk is not one of them.

Start or resume a campaign

POST/send/campaigns/{id}/start/
Scope: send:bulk1 sending credit per recipient

Starts a draft, scheduled or paused campaign. The first start charges 1 credit per recipient up front; resuming a paused campaign does not charge again. Credits for recipients that end up unsent are returned when the run finishes. The domain must be verified and have DMARC.

Path

Start or resume a campaign: Path
NameTypeRequiredDescription
idUUIDYesThe campaign's id.

Request

curl -X POST "https://api.scrubimail.com/scrubimail/api/v1/send/campaigns/c3d4e5f6-0a1b-4c2d-8e3f-4a5b6c7d8e9f/start/" \
  -H "X-API-Key: $SCRUBIMAIL_API_KEY"

Response

202 Accepted
{
  "id": "c3d4e5f6-0a1b-4c2d-8e3f-4a5b6c7d8e9f",
  "name": "November newsletter",
  "template_id": "b2c3d4e5-9f8e-4d7c-a6b5-c4d3e2f1a0b9",
  "sending_domain_id": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "from_name": "Your Company",
  "from_email": "[email protected]",
  "reply_to": null,
  "status": "sending",
  "total_recipients": 2,
  "sent_count": 0,
  "delivered_count": 0,
  "bounced_count": 0,
  "opened_count": 0,
  "clicked_count": 0,
  "scheduled_at": null,
  "started_at": null,
  "completed_at": null,
  "recipient_list": [
    {
      "email": "[email protected]",
      "name": "Ada Lovelace",
      "variables": {
        "plan": "Pro"
      }
    },
    {
      "email": "[email protected]",
      "name": "Grace Hopper"
    }
  ],
  "created_at": "2026-11-16T08:00:00Z",
  "updated_at": "2026-11-16T08:00:00Z"
}

Errors

Start or resume a campaign: errors
StatusCodeWhen
400-{"error": "..."}: the campaign is not startable, has no template or recipients, or the domain is not verified or lacks DMARC.
402-No sending credits left. Body is {"error": "Insufficient credits. Please purchase more credits."}, not the standard envelope.
404not_foundNo campaign with that id on your account.
503-{"error": "Could not start the campaign. Please try again."}: the queue was unavailable. Credits are returned and the campaign stays a draft.
401authentication_requiredNo API key was sent. The response carries a WWW-Authenticate header.
401invalid_credentialsThe key is unknown, inactive, expired, or the request IP is not on the key's allow-list. The response carries a WWW-Authenticate header.
403permission_deniedThe key has scopes set and send:bulk is not one of them.

Pause a campaign

POST/send/campaigns/{id}/pause/
Scope: send:bulk

Pauses a sending or scheduled campaign. Resume it with start.

Path

Pause a campaign: Path
NameTypeRequiredDescription
idUUIDYesThe campaign's id.

Request

curl -X POST "https://api.scrubimail.com/scrubimail/api/v1/send/campaigns/c3d4e5f6-0a1b-4c2d-8e3f-4a5b6c7d8e9f/pause/" \
  -H "X-API-Key: $SCRUBIMAIL_API_KEY"

Response

200 OK
{
  "id": "c3d4e5f6-0a1b-4c2d-8e3f-4a5b6c7d8e9f",
  "name": "November newsletter",
  "template_id": "b2c3d4e5-9f8e-4d7c-a6b5-c4d3e2f1a0b9",
  "sending_domain_id": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "from_name": "Your Company",
  "from_email": "[email protected]",
  "reply_to": null,
  "status": "paused",
  "total_recipients": 2,
  "sent_count": 0,
  "delivered_count": 0,
  "bounced_count": 0,
  "opened_count": 0,
  "clicked_count": 0,
  "scheduled_at": null,
  "started_at": null,
  "completed_at": null,
  "recipient_list": [
    {
      "email": "[email protected]",
      "name": "Ada Lovelace",
      "variables": {
        "plan": "Pro"
      }
    },
    {
      "email": "[email protected]",
      "name": "Grace Hopper"
    }
  ],
  "created_at": "2026-11-16T08:00:00Z",
  "updated_at": "2026-11-16T08:00:00Z"
}

Errors

Pause a campaign: errors
StatusCodeWhen
400-{"error": "Cannot pause a <status> campaign"}.
404not_foundNo campaign with that id on your account.
401authentication_requiredNo API key was sent. The response carries a WWW-Authenticate header.
401invalid_credentialsThe key is unknown, inactive, expired, or the request IP is not on the key's allow-list. The response carries a WWW-Authenticate header.
403permission_deniedThe key has scopes set and send:bulk is not one of them.
Campaign endpoints
RequestWhat it does
GET /send/campaigns/List your campaigns with their counters.
GET /send/campaigns/{id}/One campaign.
PUT or PATCH /send/campaigns/{id}/Edit a campaign. Only draft and paused campaigns can be edited.
DELETE /send/campaigns/{id}/Delete a campaign.

Campaign status moves through draft, scheduled, sending, paused, completed and failed. Every campaign message includes one-click unsubscribe.

Suppressions

Your suppression list is a set of addresses ScrubiMail will not send to for you. Single sends to a suppressed address are refused, bulk sends and campaigns skip it, and none of that costs a credit. The list is yours alone: an address suppressed for another customer is not suppressed for you.

What adds an address to your suppression list
EventAdded?Reason
Hard bounce: the recipient's server permanently rejects the mailbox (for example 5.1.1 user unknown)Yes, automaticallybounce
The recipient clicks unsubscribe, or their mail app's one-click unsubscribeYes, automaticallyunsubscribe
The recipient reports spam at a provider that sends feedback-loop reports (Outlook, Hotmail, Yahoo, AOL)Yes, automaticallycomplaint
You add the address yourselfYesmanual, or the reason you pass
Soft bounce, full mailbox, spam or policy block, or delivery abandoned after retriesNo-
Spam report in GmailNo: Gmail does not report individual complaints. Add the address yourself.-

Add a suppression

POST/send/suppressions/
Scope: suppressions

Blocks an address on your account. Sends to it are refused and bulk sends skip it, with no charge. Hard bounces, unsubscribes and spam complaints are added automatically.

Body

Add a suppression: Body
NameTypeRequiredDescription
emailstringYesThe address to block.
reasonstringYesOne of bounce, complaint, unsubscribe, manual.

Request

curl -X POST "https://api.scrubimail.com/scrubimail/api/v1/send/suppressions/" \
  -H "X-API-Key: $SCRUBIMAIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "[email protected]",
  "reason": "manual"
}'

Response

201 Created
{
  "id": "f1e2d3c4-b5a6-4978-8695-a4b3c2d1e0f9",
  "email": "[email protected]",
  "reason": "manual",
  "created_at": "2026-11-16T09:00:00Z",
  "updated_at": "2026-11-16T09:00:00Z"
}

Errors

Add a suppression: errors
StatusCodeWhen
400validation_errorA field is missing or invalid. error.details lists each one.
400-{"error": "Email already suppressed"}.
401authentication_requiredNo API key was sent. The response carries a WWW-Authenticate header.
401invalid_credentialsThe key is unknown, inactive, expired, or the request IP is not on the key's allow-list. The response carries a WWW-Authenticate header.
403permission_deniedThe key has scopes set and suppressions is not one of them.
Suppression endpoints
RequestWhat it does
GET /send/suppressions/List your suppressions.
GET /send/suppressions/{id}/One suppression.
DELETE /send/suppressions/{id}/Remove an address so you can send to it again. Do this only when you are sure the address is good and the person wants your mail.

SMTP, IPs and reputation

Get SMTP settings

GET/send/smtp/config/
Scope: send

The SMTP relay settings for your account. The password field is a reminder: use an API key with the send scope. See SMTP relay.

Request

curl -X GET "https://api.scrubimail.com/scrubimail/api/v1/send/smtp/config/" \
  -H "X-API-Key: $SCRUBIMAIL_API_KEY"

Response

200 OK
{
  "host": "smtp.scrubimail.com",
  "port": 587,
  "username": "[email protected]",
  "password": "Use your ScrubiMail API key as the password",
  "tls": true,
  "encryption": "STARTTLS",
  "instructions": "Configure your email client or application with these SMTP settings. Authenticate with your account email as the username and an API key as the password."
}

Errors

Get SMTP settings: errors
StatusCodeWhen
401authentication_requiredNo API key was sent. The response carries a WWW-Authenticate header.
401invalid_credentialsThe key is unknown, inactive, expired, or the request IP is not on the key's allow-list. The response carries a WWW-Authenticate header.
403permission_deniedThe key has scopes set and send is not one of them.

Reputation summary

GET/send/reputation/summary/
Scope: history

Delivery, bounce and complaint figures for the last 30 days and a reputation score. The score runs from 0 to 100 and is driven mainly by bounce and complaint rates; current_score is the latest day and average_score the mean. Higher is better. Snapshots are computed daily for the previous day, so today's mail is not included yet.

Request

curl -X GET "https://api.scrubimail.com/scrubimail/api/v1/send/reputation/summary/" \
  -H "X-API-Key: $SCRUBIMAIL_API_KEY"

Response

200 OK
{
  "period_days": 30,
  "emails_sent": 35000,
  "delivered": 33600,
  "bounced": 900,
  "hard_bounces": 610,
  "soft_bounces": 290,
  "complaints": 49,
  "delivery_rate": 96,
  "bounce_rate": 2.57,
  "complaint_rate": 0.14,
  "average_score": 94.1,
  "current_score": 94.17
}

Errors

Reputation summary: errors
StatusCodeWhen
401authentication_requiredNo API key was sent. The response carries a WWW-Authenticate header.
401invalid_credentialsThe key is unknown, inactive, expired, or the request IP is not on the key's allow-list. The response carries a WWW-Authenticate header.
403permission_deniedThe key has scopes set and history is not one of them.
Other read endpoints
RequestWhat it does
GET /send/reputation/Daily reputation snapshots for the last 30 days: counts, rates and reputation_score per day.
GET /send/ips/Dedicated IP addresses assigned to your account, with status, warm-up day and daily_limit. An empty list means you send from the shared pool.

Something missing or wrong? Email [email protected].