> ## Documentation Index
> Fetch the complete documentation index at: https://docs.i10.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> Base URL, authentication, error responses, and idempotency for the i10 API.

The i10 API is a JSON REST API generated directly from the schemas the server
validates against. The raw OpenAPI 3.1 document is also served at
`https://api.i10.tech/openapi.json`.

## Base URL

```text theme={null}
https://api.i10.tech
```

All requests use HTTPS and exchange `application/json` payloads.

## Authentication

Authenticate every request with an API key passed in the `Authorization` header
using the HTTP Bearer scheme:

```bash theme={null}
curl https://api.i10.tech/domains \
  -H "Authorization: Bearer i10_live_..."
```

Keys are prefixed `i10_live_` or `i10_test_` so they are recognisable in your
logs and greppable in a leak scan. A live key sends real mail. A test key never
does: see [Test mode](#test-mode).

> [!WARNING]
>
> Keep your API keys server-side. Never embed an API key in browser code,
> mobile apps, or public repositories.

Domain-restricted keys can send mail and retrieve messages for their allowed
domains (`POST /emails`, `POST /emails/batch`, and `GET /emails/{id}`), and can
read the webhook event catalog (`GET /webhook-event-types`), which holds no
workspace data. Every other workspace-level endpoint (domains, webhooks,
suppressions, and trusted templates) requires an unrestricted key.

## Test mode

Use a test key (`i10_test_`) to try the API, including the interactive
playground in these docs, without sending anything.

A test send goes through the same checks as a live one: the request is
validated, the `from` domain must be verified and allowed by the key's scope,
and suppressed recipients are refused. If a test send is accepted, the same
live send would be accepted too. The email is then stored and returned like a
real one, and `GET /emails/{id}` reports it with `"mode": "test"`, but it is
never handed to a mail server.

Instead, i10 simulates delivery. Every test email gets an `email.sent` and an
`email.delivered` event. To simulate other outcomes, send to these addresses:

| Recipient | Simulated outcome |
| - | - |
| `bounced@sandbox.i10.tech` | `email.bounced` (a permanent bounce) |
| `complained@sandbox.i10.tech` | `email.complained` (a spam complaint) |
| Any other address | `email.delivered` |

You can add a label after a `+`, for example `bounced+signup@sandbox.i10.tech`.
Simulated bounces and complaints never add the address to your suppression
list.

Events about test emails go to your webhook endpoints like any other event,
with `"test": true` in their `data`. Check that field if your handler should
ignore test traffic.

Test sends never count toward your plan's sending limits or your bill, and
never affect your sending reputation. They have their own daily limit of 1,000
units per workspace (resetting at midnight UTC). Each email costs one unit,
plus one more for every started 100 KB of attachments. Past the limit the API
returns `429` with `name: "test_quota_exceeded"`.

A test key can only:

* send email (`POST /emails` and `POST /emails/batch`),
* read test emails (`GET /emails/{id}`; a live email returns `404`),
* list and read domains (`GET /domains` and `GET /domains/{id}`).

Every other endpoint returns `403` with `name: "test_key_not_allowed"`. Use a
live key to change domains, webhooks, suppressions or trusted templates.

## Errors

Error responses are a JSON object with three fields:

```json theme={null}
{
  "statusCode": 422,
  "name": "validation_error",
  "message": "The request body failed validation."
}
```

| Field | Type | Description |
| - | - | - |
| `statusCode` | `integer` | HTTP status code of the response. |
| `name` | `string` | Stable, machine-readable error identifier. |
| `message` | `string` | Human-readable explanation of what failed. |

Two cases do not use this shape yet: a request body that is not valid JSON
gets a plain-text `400`, and on some endpoints an invalid parameter or body
field gets a `400` with a validation report instead of `422`. Treat any
`400` as a bad request that will not succeed if retried unchanged.

Common error names returned by public endpoints:

| Status | `name` | Meaning |
| - | - | - |
| `401` | `invalid_access` | The API key is missing, malformed, or unknown. |
| `403` | `ip_not_allowed` | The workspace only accepts API calls from listed IP addresses, and this one is not listed. |
| `403` | `restricted_api_key` | The key's scope does not permit this domain or resource. |
| `403` | `test_key_not_allowed` | Test keys cannot call this endpoint. Use a live key. |
| `403` | `domain_not_verified` | The sending domain has not finished verification. |
| `403` | `plan_limit_exceeded` | The workspace plan does not allow another resource. |
| `403` | `sending_paused` | Sending is paused for the workspace. |
| `403` | `sending_held` | Sending is held pending review. |
| `404` | `not_found` | No matching resource exists for this workspace. |
| `409` | `idempotency_conflict` | The `Idempotency-Key` was already used with a different request body. |
| `409` | `domain_already_exists` | That domain is already registered. |
| `409` | `domain_already_claimed` | Another workspace verified that domain first. |
| `409` | `template_already_submitted` | The same template is already waiting for review or approved. |
| `409` | `confirmation_required` | Removing a spam-complaint suppression needs `confirm=complaint`. |
| `409` | `validation_error` | The webhook endpoint or delivery is in a state that does not allow this action. |
| `413` | `validation_error` | The request body is too large. |
| `422` | `validation_error` | Request parameters or JSON body failed validation. |
| `429` | `daily_quota_exceeded` | Daily sending quota is exhausted. Do not retry automatically. |
| `429` | `monthly_quota_exceeded` | Monthly sending quota is exhausted. Do not retry automatically. |
| `429` | `test_quota_exceeded` | The workspace used its 1,000 daily test units (UTC). Try again after midnight UTC, or use a live key. |
| `500` | `internal_error` | An unexpected error on our side. |
| `503` | `service_unavailable` | API keys could not be checked right now. Retry after `Retry-After` seconds. |
| `503` | `internal_server_error` | A dependency of this endpoint is temporarily unavailable. Retry later. |

## Idempotency

`POST /emails` and `POST /emails/batch` accept an optional `Idempotency-Key`
request header so retries after a network error or timeout never send duplicate
mail:

```bash theme={null}
curl -X POST https://api.i10.tech/emails \
  -H "Authorization: Bearer i10_live_..." \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: reset-user-123-tok-456" \
  -d '{
    "from": "hello@yourdomain.com",
    "to": "someone@example.com",
    "subject": "Reset your password",
    "text": "Use this link to reset your password."
  }'
```

* Replaying a request with the same `Idempotency-Key` and identical body
  returns `200` with the original message id(s) without sending again.
* Reusing an `Idempotency-Key` with a different request body returns `409` with
  `name: "idempotency_conflict"`.
* Omitting `Idempotency-Key` treats every request as a distinct send.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.