API

Transmissionsv1

Submit mail via HTTP with async processing and outcomes.

POST Request
Bearer
POST/v1/transmissions

Create a transmission (send mail).

What this does

Creates a send request (a "transmission"). SendLib accepts the payload, queues delivery, and you observe outcomes asynchronously via webhooks and events.

Think async

A successful response means "accepted for processing", not "delivered". Use webhooks/events for delivery outcomes.

Request body

json
{
  "recipients": [{"email": "user@example.com", "name": "Ada"}],
  "content": {
    "subject": "Receipt #1042",
    "html": "<p>Thanks — your receipt is attached.</p>",
    "text": "Thanks — your receipt is attached."
  },
  "options": {
    "mail_type": "transactional",
    "tags": ["receipt"],
    "metadata": {"order_id": "1042"}
  }
}

Headers

HeaderRequiredNotes
AuthorizationYesBearer <API_KEY>
Content-TypeYesapplication/json
Idempotency-KeyNo (recommended)Prevents duplicates on retry.

Use idempotency on retries

If your client retries (timeouts, 502s, deploys), re-send the same request with the same Idempotency-Key.

Multi-language samples

bash
curl -X POST https://api.sendlib.com/v1/transmissions \
  -H "Authorization: Bearer $SENDLIB_API_KEY" \
  -H "Idempotency-Key: 0d6c2a6f-3f3c-4d4a-9c1a-2f7f9c1a1f0b" \
  -H "Content-Type: application/json" \
  -d '{
    "recipients": [{"email": "user@example.com"}],
    "content": {"subject": "Receipt #1042", "text": "Thanks — your receipt is attached."},
    "options": {"mail_type": "transactional", "tags": ["receipt"]}
  }'

Response

Typically returns 202 Accepted with a transmission identifier.

json
{
  "transmission_id": "f7e8d9c0-b1a2-4c3d-8e9f-0a1b2c3d4e5f",
  "items": []
}

Observe outcomes