cURL
Send an email with one HTTP request from your terminal.
Send an email with one HTTP request. Every SDK calls this same endpoint, so this is the quickest way to see the API work.
Prerequisites
- An API key.
- A verified domain to send from.
Set your API key
export NOTIX_API_KEY=notix_12345Send an email
Every endpoint lives under
https://app.usenotix.dev/apiand takes the key as a Bearer token.curl -X POST https://app.usenotix.dev/api/v1/emails \ -H "Authorization: Bearer $NOTIX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "from": "Acme <receipts@acme.com>", "to": "maria@example.com", "subject": "Your receipt for order 4471", "html": "<p>Thanks for your order, Maria.</p>" }'Check the response
A send that works answers
200with the email's id. Every webhook event for this email carries the same id.{ "emailId": "em_8f3k2" }A refused send answers with an HTTP status and an error body. Branch on the stable
code, and show or log themessage.{ "error": { "code": "UNAUTHORIZED", "message": "..." } }See Errors for every code.
Next steps
- Send many emails in one call with batch sending.
- Add an
Idempotency-Keyheader so a retry never sends twice. See idempotency keys. - Add files with attachments.
- Hear about deliveries and bounces with webhooks.
- See every field in Send an email.