Skip to content

StartAPI quick start

API quick start

Send your first email through the API in 5–10 minutes. It takes six calls: create a key, add a domain, publish DNS, verify, create a mailbox, send. The only wait is DNS propagation.

Last updated

Get your API key

Go to Developer > API keys in your dashboard and create a key. Copy it right away, because you only see it once.

export SHIPMAIL_API_KEY="sm_live_..."

Each key has scopes. For this walkthrough it needs domains:write, mailboxes:write and messages:send. See Authentication for the full list.

Add a domain

Add the domain you want to send and receive email on.

curl -X POST https://shipmail.to/api/v1/domains \
  -H "Authorization: Bearer $SHIPMAIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "example.com"}'

The response lists the DNS records you need to add. Keep them for the next step.

Configure DNS

Fetch the DNS records, then add all 6 at your DNS provider: MX, SPF, DKIM, DMARC, and two custom MAIL FROM records that align your outbound mail.

curl https://shipmail.to/api/v1/domains/DOMAIN_ID/dns-records \
  -H "Authorization: Bearer $SHIPMAIL_API_KEY"

See DNS records explained for what each record does and DNS setup by provider for where to paste them.

Verify the domain

Shipmail checks the 4 activation records every 30 seconds. Once they pass, the domain status turns verified. The DNS records endpoint shows the live status of all 6 records. To check right away instead of waiting:

curl -X POST https://shipmail.to/api/v1/domains/DOMAIN_ID/verification \
  -H "Authorization: Bearer $SHIPMAIL_API_KEY"

Alternative: use a webhook instead of polling

If your code sets up domains, subscribe to the domain.verified event instead of polling. Create the webhook before you add the domain, and carry on when the event arrives.

// 1. Create a webhook for domain events
const webhook = await shipmail.webhooks.create({
  url: "https://yourapp.com/api/webhooks/shipmail",
  events: ["domain.verified", "domain.verification_failed"],
});
// Save webhook.secret for signature verification

// 2. Add the domain
const domain = await shipmail.domains.create({ name: "example.com" });

// 3. Add DNS records at your provider, then wait for the webhook
// shipmail sends a domain.verified event when all records pass

The payload has the domain_id and verified_at timestamp. See webhooks for payload details and signature verification.

Create a mailbox

Create a mailbox on your verified domain.

curl -X POST https://shipmail.to/api/v1/mailboxes \
  -H "Authorization: Bearer $SHIPMAIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "domain_id": "DOMAIN_ID",
    "address": "hello",
    "display_name": "Hello",
    "password": "UniqueSecret123"
  }'

Send an email

Send your first email from the mailbox you just created.

curl -X POST https://shipmail.to/api/v1/messages \
  -H "Authorization: Bearer $SHIPMAIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "hello@yourdomain.com",
    "to": ["recipient@example.com"],
    "subject": "Hello from Shipmail",
    "text": "It works."
  }'

Next steps

Frequently asked questions

How long does the full setup take?

Account and mailbox setup takes about 3 minutes. Most domains can send 5–10 minutes after that. The rest is DNS propagation, and some providers are slower.

Do I need my own domain to send email?

Yes. You send from a mailbox on a domain you own and have verified. No domain yet? Register one at any registrar or through the API, then follow the domain steps.

I am not a developer. Can I still use Shipmail?

Yes. Create mailboxes in the dashboard, then read and send from the web inbox or an app like Apple Mail or Outlook. You only need the API to send from your own code.

Is the API key safe to put in my code?

Keep it out of public repositories and client-side code. Put it in a server-side environment variable, such as SHIPMAIL_API_KEY, and read it at runtime. If it leaks, rotate it from the dashboard.

What can I do with the API?

Manage domains, create and delete mailboxes, send email, read messages and threads, and set up webhooks for inbound email. Newsletters, calendars, automations and team members have endpoints too. Billing and domain purchase stay in the dashboard.

Is there a rate limit?

Yes, and it depends on your plan. Every response carries rate limit headers so you can watch your usage. If you hit the limit, wait until the time in the X-RateLimit-Reset header.

Can I use the API for transactional email?

Yes. Add a transactional sender and call messages.send from its address, for receipts, password resets and notifications. Solo includes 3,000 transactional emails a month, Pro 15,000, Team 30,000 and Scale 50,000, then $0.30 per 1,000, with no tiers. Email from a mailbox address counts as mailbox email, which has its own monthly pool per organization: 20,000 on Solo, 40,000 on Pro and 120,000 on Team. An organization created before these prices were published keeps its current rule until its owner allows extra sending: transactional email shares the plan's monthly sends. Daily limits and reputation checks also apply.

Which languages are supported?

There are SDKs for TypeScript and Python. The TypeScript SDK runs on Node.js 18+, Bun, and Deno. The Python SDK needs 3.10+ and has sync and async clients. Any other language can call the REST API directly.

How do I verify webhook signatures?

Each webhook request has a signature in the X-Shipmail-Signature header. Compute an HMAC-SHA256 of the raw request body with your webhook secret and compare the two. The TypeScript SDK exports verifyWebhook(), which does this for you.

Where can I find the full API reference?

The API reference is at shipmail.to/docs/api. The OpenAPI spec is at shipmail.to/openapi.json, ready for code generators or an import into Postman.