API & integrations

SendInfinity developer documentation

Use this quickstart to authenticate, send transactional messages, receive deliverability events, and connect legacy SMTP flows. Samples now cover cURL, Python, Node.js, PHP, and C#.

Overview

SendInfinity’s REST API powers transactional messaging, reputation automation, and real-time analytics. Authenticate every request using your account API key, then pass JSON payloads to the endpoints below.

  • Base URL: https://api.sendinfinity.com
  • Authentication: Authorization: Bearer <API_KEY> or X-Server-API-Key: <API_KEY>
  • Format: JSON for REST endpoints

Send a transactional message

curl -X POST https://api.sendinfinity.com/v1/messages \
  -H 'Authorization: Bearer API_KEY_AQUI' \
  -H 'Content-Type: application/json' \
  -d '{
    "from": "transacional@seu-dominio.com",
    "to": ["destinatario@example.com"],
    "subject": "Teste",
    "html": "<strong>Olá</strong>",
    "tracking_domain": "links.seu-dominio.com"
  }'
import requests

url = 'https://api.sendinfinity.com/v1/messages'
headers = {
  'Authorization': 'Bearer API_KEY_AQUI',
  'Content-Type': 'application/json'
}
payload = {
  'from': 'transacional@seu-dominio.com',
  'to': ['destinatario@example.com'],
  'subject': 'Teste',
  'html': 'Olá',
  'tracking_domain': 'links.seu-dominio.com'
}
resp = requests.post(url, json=payload, headers=headers)
print(resp.status_code, resp.text)
import fetch from 'node-fetch';

const url = 'https://api.sendinfinity.com/v1/messages';
const res = await fetch(url, {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer API_KEY_AQUI',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    from: 'transacional@seu-dominio.com',
    to: ['destinatario@example.com'],
    subject: 'Teste',
    html: 'Olá'
  })
});
console.log(await res.text());
$ch = curl_init('https://api.sendinfinity.com/v1/messages');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'Authorization: Bearer API_KEY_AQUI',
  'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([/* payload */]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
curl_close($ch);
echo $res;
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;

var http = new HttpClient();
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "API_KEY_HERE");

var payload = new {
  from = "transacional@seu-dominio.com",
  to = new[] { "destinatario@example.com" },
  subject = "Teste",
  html = "Olá",
  tracking_domain = "links.seu-dominio.com"
};

var content = new StringContent(JsonSerializer.Serialize(payload), Encoding.UTF8, "application/json");
var response = await http.PostAsync("https://api.sendinfinity.com/v1/messages", content);

Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());

Webhooks

Register an HTTPS endpoint to stream delivery, engagement, and failure events. Verify every request using the X-SendInfinity-Signature header shared with Support.

import express from 'express';

const app = express();
app.post('/webhook', express.json(), (req, res) => {
  const token = req.get('X-SendInfinity-Signature');
  if (token !== process.env.SI_WEBHOOK_TOKEN) {
  return res.status(401).end();
  }

  const event = req.body;
  // TODO: handle delivered, bounced, etc.
  res.sendStatus(200);
});

app.listen(3000, () => console.log('Webhook receiver ready'));
import os
from flask import Flask, request, abort

app = Flask(__name__)

@app.route('/webhook', methods=['POST'])
def webhook():
  token = request.headers.get('X-SendInfinity-Signature')
  if token != os.getenv('SI_WEBHOOK_TOKEN'):
    abort(401)

  event = request.json
  # TODO: handle delivered, bounced, etc.
  return ('', 200)

if __name__ == '__main__':
  app.run(port=3000)

Need multiple destinations or replay support? Contact support@sendinfinity.com to activate advanced routing.

SMTP relay

Prefer SMTP? SendInfinity runs an authenticated relay with automated warm-up and deliverability safeguards. Default client port: 2525.

swaks --to destinatario@example.com --from transacional@seu-dominio.com \
  --server smtp.sendinfinity.com --port 2525 --auth LOGIN --auth-user SMTP_USER --auth-password SMTP_PASS