Transactional email API reference by example

Updated

The transactional API is one endpoint. This page covers what it accepts, what it returns, and the failure modes worth handling. For the machine-generated schema, use the interactive reference.

Authentication

POST /api/v1/transactional/send
Authorization: Bearer ik_live_xxxxxxxxxxxxxxxx
Content-Type: application/json
  • Keys are created in the dashboard and shown in full once. Only a hash is stored.
  • The key must carry the transactional:send scope, otherwise you get HTTP 403.
  • A key can have an expiry date and IP allow or block lists. A request from a blocked or non-allowed IP gets HTTP 403.
  • Keep keys on the server. Never ship one in a browser or mobile app bundle.

Request fields

| Field | Required | Notes | |---|---|---| | to | yes | A single valid email address. | | from_email | yes | Must be a registered sender on a verified domain in your workspace. | | from_name | no | Display name. | | subject | yes without template_id | With a template it defaults to the template name. | | html_body | yes without template_id | Merge tags are applied. | | text_body | no | Sent as the plain-text part. Merge tags are not applied to it, so render it yourself. | | template_id | yes without html_body | UUID of one of your templates. | | template_data | no | Object of values for merge tags. All values are converted to strings. |

You must provide html_body or template_id. Merge tags look like , with optional inner spaces. A tag with no matching key is left in the message as-is, so test your data.

Inline HTML

curl https://api.inboxili.com/api/v1/transactional/send \
  -H "Authorization: Bearer $INBOXILI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "ada@example.com",
    "from_email": "billing@yourdomain.com",
    "subject": "Receipt {{order_id}}",
    "html_body": "<p>Thanks {{first_name}}, we received your payment.</p>",
    "template_data": { "first_name": "Ada", "order_id": "A-1042" }
  }'

From a template

curl https://api.inboxili.com/api/v1/transactional/send \
  -H "Authorization: Bearer $INBOXILI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "ada@example.com",
    "from_email": "hello@yourdomain.com",
    "template_id": "00000000-0000-0000-0000-000000000000",
    "template_data": { "first_name": "Ada" }
  }'

Response

Success is HTTP 200 when the email was handed to the delivery provider:

{ "status": "sent", "message_id": "0100018f..." }

Pacing and the queue (HTTP 202)

Each API key delivers at most 100 emails per minute, counted per calendar minute. The first 100 in a minute are sent immediately, exactly as above. If you send faster, Inboxili does not reject the extra emails. It accepts them and answers HTTP 202:

{ "status": "queued", "message_id": null, "queue_id": "7c1f0c52-..." }

Queued emails are delivered oldest first as each new minute's capacity opens up, so a bulk job of 6,000 emails takes about an hour. While a key has a backlog, new requests join the back of the queue, so delivery order matches request order.

  • Treat 202 as success. The email is accepted and will be sent. Do not retry it, or it will be sent twice.
  • message_id is null until delivery. Use queue_id to match the email later: it appears on the matching webhook events as queue_id, and the email shows in the dashboard's sending log once it is sent.
  • The queue holds up to 20,000 emails per key. Beyond that the API returns 429 with code queue_full: wait for the backlog to drain.
  • A queued email that has not been sent within 24 hours is dropped and recorded as failed ("Expired").
  • The plan check happens twice: when the email is accepted (queued emails count against your plan) and again when it is delivered. If the workspace has been suspended or has reached its plan limit by then, the email is recorded as failed instead of sent.

sent means the delivery provider accepted the message. It does not mean the inbox received it. Use the webhook events described below for delivered, bounced and complained.

Errors

Every error has the same shape:

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

| HTTP | code | Meaning | What to do | |---|---|---|---| | 401 | unauthorized | Missing, invalid, revoked or expired key | Fix credentials. Do not retry. | | 403 | forbidden | Missing scope, or IP not permitted | Fix the key's scope or IP rules. | | 422 | validation_error | Bad body, for example no html_body or template_id | Fix the request. | | 422 | sender_not_verified | from_email is not on a verified domain | Verify the domain and sender. | | 422 | send_failed | The provider rejected the send | Inspect message. Retry only if it looks transient. | | 429 | rate_limited | Over 600 requests per minute for this key | Back off, then retry. | | 429 | queue_full | 20,000 emails already waiting for this key | Wait for the queue to drain, then retry. |

Plan sending limits can also reject a request. Treat any 4xx as "do not retry unchanged" unless it is 429.

Webhook events for your sends

Register an endpoint in the dashboard and subscribe it to events. Inboxili sends an HTTP POST with a JSON body and these headers:

| Header | Value | |---|---| | X-Inboxili-Event | delivered, bounced or complained | | X-Inboxili-Signature | Hex HMAC-SHA256 of the raw body using the webhook's secret |

A transactional event looks like this:

{
  "source": "transactional",
  "transactional_email_id": "7c1f0c52-...",
  "queue_id": null,
  "email": "ada@example.com",
  "message_id": "010901a1...",
  "occurred_at": "2026-11-03T09:16:56+00:00"
}

message_id matches the message_id the send call returned, so you can tie an event back to your own record. For an email that was queued, queue_id matches the queue_id from the 202 response. A bounced event adds bounce_type (permanent, transient or undetermined), bounce_subtype and diagnostic_code. A permanent bounce or a complaint also puts the address on your suppression list. opened and clicked events are for campaigns only: transactional emails are not tracked for opens or clicks.

Respond with a 2xx status. Verify the signature before trusting the body, as shown on the Node.js, Python and PHP pages.

Retries and duplicates

There is no idempotency key. If your request times out you cannot know whether the email was sent or queued. For OTP and reset emails a duplicate is harmless. For receipts it is not, so record in your own database that an invoice email was sent, and check it before retrying.

Limits to design around

  • One recipient per call.
  • No attachments, CC, BCC or reply-to fields.
  • 100 emails delivered per minute per key. Faster sends are queued (HTTP 202), up to 20,000 waiting.
  • 600 requests per minute per key.
  • HTTPS only. There is no SMTP endpoint.

Next

Pick your stack: Node.js, Python, PHP. Or start from a workflow: OTP email.

Frequently asked questions

What is the base URL?
https://api.inboxili.com/api/v1. The send endpoint is POST /transactional/send.
How do I authenticate?
Send your API key as a Bearer token in the Authorization header. Keys start with ik_live_ and need the transactional:send scope.
What happens if I exceed the rate limit?
The API returns HTTP 429 with error code rate_limited. The request limit is 600 requests per minute per API key. Separately, each key delivers at most 100 emails a minute: faster sends are accepted with HTTP 202 and queued, not rejected.
What does HTTP 202 and status queued mean?
Your key sent faster than its delivery pace of 100 emails a minute, so the email was accepted and queued. It is delivered in order as capacity frees up, normally within minutes. The response has a queue_id instead of a message_id.
Is there an official SDK?
Not yet. The endpoint is a single JSON POST, so a plain HTTP client is enough. The language guides show working examples.

Get an API key

Create a workspace, verify a domain, and make your first API call.

Related