Skip to documentation

Quickstarts

Send with cURL / HTTP

Use the REST API without an SDK.

Prerequisites

Use a running installation, a verified sending domain, and a sending or full-access key. In the SES sandbox, verify the recipient too.

Configure your environment

bash
export OPENSEND_BASE_URL=https://api.example.com
export OPENSEND_API_KEY=os_replace_me

The API origin is your public Convex HTTP service, not the Next.js dashboard. Use the origin without an /api suffix.

Send

bash
curl "$OPENSEND_BASE_URL/emails" \
  -H "Authorization: Bearer $OPENSEND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"from":"Acme <hello@example.com>","to":["you@example.net"],"subject":"Hello from Opensend","html":"<p>Your first email is on its way.</p>"}'

Try it

A successful request returns an email ID:

json
{"id":"your_email_id"}

Open Emails to follow delivery. For a failed HTTP request, read statusCode, name, and message. Respect retry-after on a 429 and add an Idempotency-Key for retries of the same send.