Skip to main content
ScrubiMail

ScrubiMail API documentation

One REST API for two jobs: check whether an email address is real before you send, and send email from your own domain over HTTP or SMTP. Both use the same account and the same API key.

Related:Email validationEmail sendingSMTP relay

Checked against the API source on

Email validation checks syntax, DNS, the mailbox itself and risk signals such as disposable and role addresses, and returns a verdict with a 0 to 100 score. Email sending delivers transactional and campaign mail from a domain you have verified, with DKIM signing, suppression lists and one-click unsubscribe. The SMTP relay lets any application that speaks SMTP use the same sending pipeline.

Base URL

Base URL
https://api.scrubimail.com/scrubimail/api/v1
  • Requests and responses are JSON. Send Content-Type: application/json on requests with a body.
  • Paths end with a slash, for example /validate/. The server does not redirect a path without the slash, it answers 404.
  • Authenticate every request with the X-API-Key header. See Authentication.
  • Errors use one JSON shape with a stable error.code. See Errors and rate limits.

Quickstart

Three steps from nothing to a validated address and a sent email. The examples read the key from the SCRUBIMAIL_API_KEY environment variable, which keeps it out of your source code.

  1. Create an API key

    Sign in and open API keys in the app. Create a key, give it a name, and copy it into your secrets manager straight away: the full key is shown only once and cannot be viewed again. Leave the scopes empty for full access while you try things out, then narrow them later. New accounts include free validation credits; check pricing for the current allowance.

    Shell
    export SCRUBIMAIL_API_KEY="paste-your-key-here"
  2. Validate an address

    Call POST /validate/ with an address. The default is a deep check that includes a live mailbox check, so allow a few seconds. Add ?mode=fast for a quick syntax and DNS check.

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

    is_valid is true only when the mailbox was confirmed. Everything else is explained by verdict and sub_status; see the Validation API.

  3. Send an email

    Sending needs a verified domain first: add it, publish three DNS records, and verify. That is a one-time job covered in Sending setup. Then one call sends a message.

    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"
      }
    }'

    The API replies 202 with a message_id. Poll GET /send/status/{message_id}/ to watch it go from sending to delivered.

Where to go next

Something missing or wrong? Email [email protected].