Skip to content

API reference

API overview

Base URL, authentication, errors, rate limits, idempotency, pagination and the rules every endpoint shares.

The isent API is a JSON API over HTTPS. This page covers what every endpoint shares; the reference pages in the sidebar list each endpoint. The same description is served as an OpenAPI 3 document at /api/openapi/json, for client generators and API tools.

Base URL

URL
https://isent.dev/api/v1

Send JSON bodies with Content-Type: application/json. Responses are JSON. Paths in these docs are relative to the base URL: POST /emails is POST https://isent.dev/api/v1/emails.

Authentication

Send an API key as a bearer token: Authorization: Bearer is_live_…. Full-access keys can call every endpoint; sending-access keys can only send email. See API keys.

Errors

Every error has the same body. name is stable: branch on it, not on message, which is written for people.

JSON
{
  "statusCode": 422,
  "name": "validation_error",
  "message": "to needs at least one address."
}
Error names
StatusNameWhen
400validation_errorThe body is not valid JSON.
400invalid_idempotency_keyThe Idempotency-Key header is empty or longer than 256 characters.
401missing_api_keyNo Authorization header.
401invalid_api_keyThe key is unknown or revoked.
401restricted_api_keyA sending-access key called another endpoint.
403restricted_api_keyA key limited to one domain sent from another.
403invalid_from_addressThe sender's domain is not in your team or not verified.
403forbiddenA dashboard user's role cannot do this.
403plan_limit_reachedAdding a domain, webhook endpoint, segment or contact past your plan.
404not_foundThe resource or route does not exist.
409conflictThe request clashes with the resource's state, such as canceling an email that already went.
409invalid_idempotent_requestAn idempotency key reused with a different body.
409concurrent_idempotent_requestsA request with the same idempotency key is still running.
422validation_errorA field is missing or not valid. message names it.
422invalid_attachment, invalid_scheduled_at, invalid_from_addressAn attachment, schedule or sender is not valid.
429rate_limit_exceededToo many requests. Wait for retry-after seconds.
429monthly_quota_exceededThe month's emails are used up.
500internal_server_errorSomething went wrong on our side. Retry with the same idempotency key.

Rate limits

10 requests per second per API key on Free, Pro and Scale, which share one API rate limit. Enterprise limits are set in your contract, which can raise the limit for every key on the team. Every response says where you stand:

Rate limit headers
HeaderValue
ratelimit-limitRequests allowed each second: your contract's limit on Enterprise.
ratelimit-remainingRequests left in the current second.
ratelimit-resetSeconds until the count resets.
retry-afterOn a 429 only: seconds to wait.

To send many emails, use POST /emails/batch (up to 100 per request) rather than many single calls. For higher limits, ask about Enterprise.

Quotas

  • Emails you send and receive count toward your plan's monthly emails. Broadcasts do not: marketing plans are priced by contacts.
  • Past the plan, paid plans with pay-as-you-go turned on keep sending, billed in buckets of 1,000 emails at the plan's rate. Otherwise sends answer 429 monthly_quota_exceeded until the next month or an upgrade.
  • Domains, webhook endpoints, segments and contacts are counted per plan; adding past the plan answers 403 plan_limit_reached.

Idempotency

POST /emails, POST /emails/batch and POST /events accept an Idempotency-Key header: any string up to 256 characters that is unique to the action, such as welcome-user-123. For 24 hours, a retry with the same key and the same body returns the first response, with the header idempotent-replayed: true, and sends nothing again.

  • The same key with a different body answers 409 invalid_idempotent_request.
  • A request that failed with an error releases its key, so you can retry it.
  • Keys are per team, so two services must not share key names.
curl -X POST https://isent.dev/api/v1/emails \
  -H "Authorization: Bearer $ISENT_API_KEY" \
  -H "Idempotency-Key: welcome-user-123" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "Acme <hello@mail.acme.com>",
    "to": "amira@acme.com",
    "subject": "Welcome to Acme",
    "text": "Thanks for signing up."
  }'

Pagination

List endpoints return the newest items first, 20 at a time. Pass limit (1 to 100) for more, and after with the last id you received for the next page. A page looks like this:

JSON
{
  "object": "list",
  "has_more": true,
  "data": [
    {
      "object": "email",
      "id": "em_7Hq2k9Wd"
    },
    {
      "object": "email",
      "id": "em_6Jr1m8Vc"
    }
  ]
}

Sending email

  • from must be on a verified domain of your team, as hello@mail.acme.com or Acme <hello@mail.acme.com>.
  • to, cc and bcc take an address or a list; together at most 50 addresses. Suppressed addresses are skipped; when nobody is left the email is stored as suppressed and not sent.
  • Give html, text, or both, or a template (see Templates).
  • reply_to takes an address or a list.

Batch

POST /emails/batch takes a JSON array of up to 100 emails, each shaped like a single send. They are validated together: if one is invalid, none is sent and the error says which (Email 3: …). Batch sends take no attachments and no scheduled_at. The response lists the new ids in order.

Attachments

attachments is a list of { filename, content, content_type }, with content in base64. Up to 20 files and 3 MB in total per email. content_type is worked out from the file name when you leave it out.

Scheduling

scheduled_at sends later: an ISO 8601 time such as 2026-12-01T09:00:00Z, or a phrase such as in 10 minutes, in 2 hours or in 1 day, up to 30 days ahead. Move it with PATCH /emails/{id} or cancel it with POST /emails/{id}/cancel while it is still scheduled.

Tags

tags is a list of { name, value } pairs, such as { "name": "category", "value": "receipt" }, that come back on the email and in its webhooks. Names and values use letters, digits, underscores and dashes; names starting with isent_ are reserved.

Headers

headers adds your own email headers, such as List-Unsubscribe or X-Entity-Ref-ID. Headers that come from the email's fields (From, To, Subject, Message-ID, Content-Type and the like) cannot be set this way.

Statuses

An email moves through queued or scheduled, then sent, delivered, opened and clicked, or ends as delivery_delayed, bounced, complained, suppressed, failed or canceled. GET /emails/{id} returns the status with every event and its time.

Reference