Skip to the page

One address

Everything in OpenSend goes through one API. On our cloud it is at https://api.opensend.sh. On a server of your own it is at the address of that server. The dashboard, the SDK, the command line and agents all call that one address.

Make an API key

Open API keys in the dashboard and make a key. A key starts with os_ and is shown once, so store it when you make it.

A key with full access may call every method. A key with sending access may only send. Authentication has the details.

Set the address and the key

Every example in these docs reads two values from the environment. The SDK and the command line read the same two, and call our cloud when no address is set.

Shell
export OPENSEND_API_URL="https://api.opensend.sh"export OPENSEND_API_KEY="os_..."

Add a domain

An email is sent from an address on a domain you have verified. Add the domain, publish the DNS records the answer lists, then ask for them to be checked. Domains walks through it.

curl -X POST "$OPENSEND_API_URL/v1/domains" \  -H "Authorization: Bearer $OPENSEND_API_KEY" \  -H "Content-Type: application/json" \  -d '{  "name": "updates.example.com",  "region": "us-east-1"}'

Send an email

curl -X POST "$OPENSEND_API_URL/v1/emails" \  -H "Authorization: Bearer $OPENSEND_API_KEY" \  -H "Content-Type: application/json" \  -d '{  "from": "Acme <hello@mail.example.com>",  "to": "ada@example.com",  "subject": "Your receipt for November",  "html": "<p>Thanks for your order.</p>"}'

The answer is the email as the API keeps it. Its id finds it again, and status says where it is.

emails.send
{  "object": "email",  "id": "em_10",  "from": "Acme <hello@mail.example.com>",  "to": [    "ada@example.com"  ],  "subject": "Your receipt for November",  "status": "queued",  "mode": "live",  "domain": "mail.example.com",  "cc": [],  "bcc": [],  "replyTo": null,  "scheduledAt": null,  "createdAt": "2026-11-27T09:30:00.000Z",  "html": "<p>Thanks for your order.</p>",  "text": null,  "headers": {},  "tags": {},  "attachments": [],  "templateId": null,  "automation": null,  "events": [    {      "type": "queued",      "at": "2026-11-27T09:30:00.000Z",      "detail": "Accepted by the API and queued."    }  ]}

See what happened

An email moves from queued to sent and then delivered. Read it again to see where it is and what happened on the way.

curl "$OPENSEND_API_URL/v1/emails/em_02" \  -H "Authorization: Bearer $OPENSEND_API_KEY"

To be told instead of asking, add a webhook: your address gets a signed request for each event.

Use the SDK

In TypeScript the same request is one call. Every method of the API is a method of the client, with the same name and the same input.

TypeScript
import { OpenSend } from '@open-send/opensend' const opensend = new OpenSend() const email = await opensend.emails.send({  from: 'Acme <hello@mail.example.com>',  to: 'ada@example.com',  subject: 'Your receipt for November',  html: '<p>Thanks for your order.</p>',}) console.log(email.id, email.status)

The SDK page covers options, errors and webhooks.

Where to go next