Developers · API Reference
API Documentation
Technical reference for Sendarix HTTP APIs, authentication, and common integration patterns. Product overview: Email API.
# Send a critical email through a routing policy curl -sS -X POST 'https://app.sendarix.com/v1/email/send' \ -H 'Content-Type: application/json' \ -H 'X-API-Key: YOUR_API_KEY' \ -H 'Idempotency-Key: otp_8842' \ -d '{"to":"user@acme.com","template":"password_reset","routing_policy":"transactional-critical"}'
const sendarix = require("sendarix")(process.env.SENDARIX_KEY); await sendarix.email.send({ to: "user@acme.com", template: "password_reset", routingPolicy: "transactional-critical", idempotencyKey: "otp_8842" });
# Drop-in SMTP — keep your integration, gain a control plane host: smtp.sendarix.com port: 587 (STARTTLS) username: "your_sending_key" header: X-Sendarix-Policy: transactional-critical
Capability audit (this platform)
Counts below reflect what the application exposes to integrators today. Any language that can send HTTPS + JSON can call these endpoints; the page includes six copy-paste example stacks.
5
Integration surfaces
6
Example languages
6
Usage patterns
Surfaces: (1) Transactional send REST, (2) Client alerts ingest REST, (3) Deliverability Intel REST, (4) SMTP relay (protocol, not JSON), (5) Outbound engagement webhooks (you receive HTTPS POSTs from Sendarix). Dashboard session endpoints such as GET /api/keys are browser/session flows, not X-API-Key automation.
Integration surfaces
| Surface | Mechanism | Base / entry |
|---|---|---|
| Transactional send | POST JSON, account API key | POST /v1/email/send (alias /v1/send) |
| Client alerts | POST JSON, same key middleware as send | POST /v1/alerts/ingest |
| Deliverability Intel | GET/POST JSON, workspace deliverability API key | /api/deliverability/v1/* (7 routes) |
| SMTP relay | SMTP AUTH (host, port, username, password from dashboard) | See SMTP Relay |
| Engagement webhooks | Your HTTPS endpoint receives signed POSTs | Configure in app → Webhooks |
Authentication
- Account API key (send + alerts): header
X-API-Key: …orAuthorization: Bearer …. Optional query?api_key=is supported for tooling but headers are recommended. - Deliverability API key: header
X-API-Key(workspace-scoped; issued for Intel / deliverability monitor). - Idempotency (send): optional
Idempotency-Keyheader for safe retries.
Keys are created and rotated from the customer dashboard (API management). Scope modes are described in the application’s internal scope policy for restricted keys.
Send API
POST https://app.sendarix.com/v1/email/send
JSON body fields (required unless noted):
from— verified sender addressto— string or array of addressessubjecthtmland/ortext— at least one non-empty body is expected (plain text can be derived from HTML)
to, but the current transport path delivers to the first recipient. For multiple distinct deliveries, issue one request per recipient (or use SMTP for multi-RCPT workflows).Successful responses include identifiers such as message_id and sx_trace_id for correlation with logs and webhooks.
Client alerts ingest
POST https://app.sendarix.com/v1/alerts/ingest
Typical JSON fields: event_type, severity (info, warning, critical), source, message, optional entity_type, entity_id, context (object). Delivery depends on alert rules configured in the dashboard.
Deliverability Intel API
Base: /api/deliverability/v1/. Endpoints include workspaces, clients, domains, blacklist status, and report generation. All require the deliverability workspace API key.
GET | /workspaces |
GET | /clients |
POST | /clients |
GET | /domains |
POST | /domains |
GET | /blacklists/status |
POST | /reports/generate |
SMTP relay & inbound-style webhooks
SMTP uses standard mail submission with credentials from the dashboard—suitable for legacy apps and MTAs. Engagement webhooks are outbound from Sendarix to your URL for delivery and engagement events (see product page for payload and security).
Provider-facing inbound webhooks (e.g. Postal) are infrastructure endpoints, not customer integration targets.
Send API — examples (6 languages)
Replace YOUR_API_KEY and addresses. Same JSON for every stack.
# Bash — transactional send
curl -sS -X POST 'https://app.sendarix.com/v1/email/send' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Idempotency-Key: order-10042-reset' \
-d '{
"from": "noreply@example.com",
"to": "user@example.com",
"subject": "Password reset",
"text": "Use this link to reset your password.",
"html": "<p>Use this link to reset your password.</p>"
}'// Node 18+ (global fetch)
const res = await fetch('https://app.sendarix.com/v1/email/send', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'YOUR_API_KEY',
'Idempotency-Key': 'order-10042-reset',
},
body: JSON.stringify({
from: 'noreply@example.com',
to: 'user@example.com',
subject: "Password reset",
text: "Use this link to reset your password.",
html: "<p>Use this link to reset your password.<\/p>",
}),
});
console.log(await res.json());# Python 3
import json, urllib.request
req = urllib.request.Request(
'https://app.sendarix.com/v1/email/send',
data=json.dumps({
'from': 'noreply@example.com',
'to': 'user@example.com',
'subject': "Password reset",
'text': "Use this link to reset your password.",
'html': "<p>Use this link to reset your password.<\/p>",
}).encode(),
headers={
'Content-Type': 'application/json',
'X-API-Key': 'YOUR_API_KEY',
'Idempotency-Key': 'order-10042-reset',
},
method='POST',
)
with urllib.request.urlopen(req) as r:
print(r.read().decode())<?php
$ch = curl_init('https://app.sendarix.com/v1/email/send');
$payload = json_encode([
'from' => 'noreply@example.com',
'to' => 'user@example.com',
'subject' => 'Password reset',
'text' => 'Use this link to reset your password.',
'html' => '<p>Use this link to reset your password.</p>',
]);\ncurl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'X-API-Key: YOUR_API_KEY',
'Idempotency-Key: order-10042-reset',
],
CURLOPT_POSTFIELDS => $payload,
CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($ch);// Go
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
body, _ := json.Marshal(map[string]any{
"from": "noreply@example.com",
"to": "user@example.com",
"subject": "Password reset",
"text": "Use this link to reset your password.",
"html": "<p>Use this link to reset your password.<\/p>",
})
req, _ := http.NewRequest("POST", "https://app.sendarix.com/v1/email/send", bytes.NewReader(body))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-API-Key", "YOUR_API_KEY")
req.Header.Set("Idempotency-Key", "order-10042-reset")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
}# Ruby — net/http
require 'json'
require 'net/http'
uri = URI('https://app.sendarix.com/v1/email/send')
req = Net::HTTP::Post.new(uri)
req['Content-Type'] = 'application/json'
req['X-API-Key'] = 'YOUR_API_KEY'
req['Idempotency-Key'] = 'order-10042-reset'
req.body = {
from: 'noreply@example.com',
to: 'user@example.com',
subject: "Password reset",
text: "Use this link to reset your password.",
html: "<p>Use this link to reset your password.<\/p>",
}.to_json
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |h| h.request(req) }
puts res.body Usage patterns (6)
- One-shot send — single POST per message, no idempotency header.
- Idempotent retry — same
Idempotency-Key+ body on network failures. - Bearer auth — swap
X-API-KeyforAuthorization: Bearer YOUR_API_KEY. - HTML + text — supply both for multipart-alternative style rendering where supported.
- Alert fan-out — POST to
/v1/alerts/ingestfrom your monitors; routing is policy-driven in the UI. - Deliverability automation — poll or mutate Intel resources under
/api/deliverability/v1/*with the workspace key.
Related
Protect critical email across every tenant.
Move your most critical stream to Sendarix this week. Keep everything else exactly where it is.
