Skip to content
Docs

Quickstart

Send your first email with the API

Verify a domain, create an API key and send your first email with cURL or an official SDK for Node.js, Python, PHP, Ruby, Go, Java, .NET or Rust.

Updated Oct 1, 2026

This quickstart takes you from a new account to a delivered email in about five minutes, plus the time your DNS provider needs to publish records. You’ll verify a domain, create an API key, send an email and find it in the dashboard.

Before you begin

  • An Emailit account. Sign up at dash.emailit.com.
  • A domain you can add DNS records to, such as acme.com. You can also use a subdomain, such as mail.acme.com.

Add and verify your domain

Emailit only sends from domains you’ve verified, so recipients’ mail servers can check that the email really comes from you.

  1. Add the domain. Go to Email APIDomains, select Add domain, enter acme.com and select Create.

  2. Publish the DNS records. The domain page lists the records to add at your DNS provider. Copy the exact values from that page. The three required records look like this:

    Type Name Value
    TXT emailit._domainkey.acme.com v=DKIM1; t=s; h=sha256; p=… (your key)
    TXT emailit.acme.com v=spf1 include:_spf.emailit.com ~all
    MX emailit.acme.com, priority 10 feedback-smtp.ffdc-1.emailit.com

    If your DNS is on Cloudflare, you can publish the records in one click instead. See Cloudflare.

  3. Check DNS. Select Check DNS. When SPF, DKIM and Return Path show OK, the domain is Verified. Most providers publish records within minutes, but it can take up to 48 hours.

On Pay as you go, a domain registered less than 30 days ago shows Pending verification until the Emailit team reviews it. See Add a domain for the details and optional records for DMARC, tracking and inbound email.

Create an API key

  1. Open API Keys. Go to Email APIAPI Keys and select Add API key.

  2. Name the key and choose a scope. Enter a name such as Quickstart. Sending Only can only send email. Full Access can also call the rest of the API. Either works for this quickstart.

  3. Copy the key. Select Create and copy the key. It starts with secret_ and is shown only once.

  4. Store it in an environment variable so it stays out of your code:

    Terminal
    export EMAILIT_API_KEY="secret_••••"

Send an email

Install the SDK for your language, or use cURL:

Terminal
# cURL is preinstalled on macOS, Linux and Windows 10 or later
curl --version

Then send an email. Use a From address on the domain you verified, and send it to the email address you signed up with:

Terminal
curl https://api.emailit.com/v2/emails \
  -H "Authorization: Bearer $EMAILIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "Acme <hello@acme.com>",
    "to": "ada@example.com",
    "subject": "Hello from Emailit",
    "html": "<p>This is my first email sent with Emailit.</p>"
  }'

Read the response

A successful request returns 200 with the new email:

JSON
{
  "object": "email",
  "id": "em_2pX7cN4kQ9vLm3RtB8yWd1Zs",
  "token": "2pX7cN4m8FqT1vKz6RbL3HwYd",
  "message_id": "<2pX7cN4m8FqT1vKz6RbL3HwYd@acme.com>",
  "from": "Acme <hello@acme.com>",
  "to": ["ada@example.com"],
  "subject": "Hello from Emailit",
  "status": "accepted",
  "scheduled_at": null,
  "created_at": "2026-10-01T09:30:12.418Z",
  "tracking": { "loads": false, "clicks": false }
}
Field Meaning
id The email’s ID. Use it to look the email up, cancel or retry it, and to match webhook events.
status accepted means Emailit has queued the email for delivery. It’s scheduled if you set scheduled_at.
message_id The Message-ID header of the email.
ids Only present with several recipients. Maps each recipient address to its own email ID.
tracking Whether opens (loads) and clicks are tracked for this email. Tracking needs a verified tracking subdomain.

accepted doesn’t mean delivered yet. Delivery happens in the background, and the status changes as it progresses.

Check it in the dashboard

Go to Email APIEmails. Your email is at the top of the Outgoing tab. Within a few seconds its status usually changes from accepted to delivered. Open it to see the headers, the content, every delivery attempt with the receiving server’s response, and the spam check results.

The request itself appears in Email APILogs, with the status code and the request and response bodies.

Troubleshooting

Response Cause Fix
401 API key required or Invalid API key The Authorization header is missing or the key is wrong Send Authorization: Bearer secret_… with a current key
403 unverified_workspace_recipient The workspace is in sandbox mode Send to a workspace member’s account email, or request production access
422 From/Sender domain is not valid or not verified The From domain isn’t verified in this workspace Verify the domain, or use an address on a verified domain
403 Domain not authorized The Sending Only key is restricted to a different domain Use a key for this domain, or an unrestricted key
402 Insufficient credits The workspace doesn’t have enough credits Add credits
429 Rate limit exceeded Too many emails this second or today Wait for the time in retry-after. See Rate limits.

Next steps

Get delivered, bounced and opened events in real time.
Design once in the dashboard and send by alias with variables.
Retry requests safely without sending twice.
What to check before you send to real recipients.

Was this page helpful?

Thanks for the feedback.

Thanks, we read every message.