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

  1. Set your API key

    export NOTIX_API_KEY=notix_12345
    
  2. Send an email

    Every endpoint lives under https://app.usenotix.dev/api and 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>"
      }'
    
  3. Check the response

    A send that works answers 200 with 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 the message.

    {
      "error": {
        "code": "UNAUTHORIZED",
        "message": "..."
      }
    }
    

    See Errors for every code.

Next steps

Open in ClaudeOpen in ChatGPT