API reference
This page is generated from the OpenAPI description. Base URL https://assertinbox.com. Authenticated endpoints need Authorization: Bearer <api_key>. Every authenticated response carries X-RateLimit-Limit and X-RateLimit-Remaining, and every error body has error, message and docs. Limits are on the limits page; a guided introduction is in the docs.
Endpoints
POST /v1/keys: Create an API key and namespaceGET /v1/messages: List messages, newest firstDELETE /v1/messages: Delete messages for a tag, or allGET /v1/messages/{id}: Get one messageDELETE /v1/messages/{id}: Delete one messageGET /v1/wait: Long-poll for the newest matching message (max 25 s)GET /v1/me: Your namespace, usage today and limitsDELETE /v1/keys/me: Delete every message and usage row for your namespace and permanently disable the keyPOST /v1/keys/me/rotate: Issue a new API key for the same namespace; the old key stops working at once
POST /v1/keys
Create an API key and namespace. No API key needed.
curl -s -X POST https://assertinbox.com/v1/keys
| Status | Meaning |
|---|---|
| 201 | Created |
| 403 | signups_closed |
| 429 | rate_limited |
Example 201 response:
{"api_key":"ai_0123456789abcdef","namespace":"k3x9a1bz","address_template":"k3x9a1bz.<tag>@assertinbox.com"}
GET /v1/messages
List messages, newest first. Needs an API key.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
tag | query | string | no | Example: signup-1. |
since | query | integer | no | Unix time in seconds; only messages received at or after it. Example: 1796464000. |
from | query | string | no | Case-insensitive substring of the sender. Example: noreply@example.com. |
subject | query | string | no | Case-insensitive substring of the subject. Example: verification. |
after | query | string | no | A message id. Only messages that arrived after that one are returned (an unknown id adds no constraint). Example: 2f1c0b1e-0000-4000-8000-000000000001. |
curl -s -H "Authorization: Bearer $ASSERTINBOX_KEY" \
"https://assertinbox.com/v1/messages"
| Status | Meaning |
|---|---|
| 200 | OK |
| 401 | unauthorized |
| 403 | key_disabled |
| 429 | rate_limited: 2000 API requests per key per UTC day; see Retry-After |
Example 200 response:
{"messages":[{"id":"2f1c0b1e-0000-4000-8000-000000000001","tag":"signup-1","to":"k3x9a1bz.signup-1@assertinbox.com","ts":1796464450,"from":"noreply@example.com","reply_to":null,"subject":"Your code","text":"Your verification code is 482913","html":"","otp":"482913","magic_link":"https://example.com/verify?t=abc","links":["https://example.com/verify?t=abc"],"attachments":[]}]}
DELETE /v1/messages
Delete messages for a tag, or all. Needs an API key.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
tag | query | string | no | Example: signup-1. |
curl -s -X DELETE -H "Authorization: Bearer $ASSERTINBOX_KEY" \
"https://assertinbox.com/v1/messages"
| Status | Meaning |
|---|---|
| 200 | OK |
| 401 | unauthorized |
| 403 | key_disabled |
| 429 | rate_limited: 2000 API requests per key per UTC day; see Retry-After |
Example 200 response:
{"ok":true}
GET /v1/messages/{id}
Get one message. Needs an API key.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | Example: 2f1c0b1e-0000-4000-8000-000000000001. |
curl -s -H "Authorization: Bearer $ASSERTINBOX_KEY" \
"https://assertinbox.com/v1/messages/2f1c0b1e-0000-4000-8000-000000000001"
| Status | Meaning |
|---|---|
| 200 | OK |
| 401 | unauthorized |
| 403 | key_disabled |
| 404 | not_found |
| 429 | rate_limited: 2000 API requests per key per UTC day; see Retry-After |
Example 200 response:
{"id":"2f1c0b1e-0000-4000-8000-000000000001","tag":"signup-1","to":"k3x9a1bz.signup-1@assertinbox.com","ts":1796464450,"from":"noreply@example.com","reply_to":null,"subject":"Your code","text":"Your verification code is 482913","html":"","otp":"482913","magic_link":"https://example.com/verify?t=abc","links":["https://example.com/verify?t=abc"],"attachments":[]}
DELETE /v1/messages/{id}
Delete one message. Needs an API key.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | Example: 2f1c0b1e-0000-4000-8000-000000000001. |
curl -s -X DELETE -H "Authorization: Bearer $ASSERTINBOX_KEY" \
"https://assertinbox.com/v1/messages/2f1c0b1e-0000-4000-8000-000000000001"
| Status | Meaning |
|---|---|
| 200 | OK |
| 401 | unauthorized |
| 403 | key_disabled |
| 404 | not_found: no such message in your namespace |
| 429 | rate_limited: 2000 API requests per key per UTC day; see Retry-After |
Example 200 response:
{"ok":true}
GET /v1/wait
Long-poll for the newest matching message (max 25 s). Needs an API key.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
tag | query | string | yes | Example: signup-1. |
since | query | integer | no | Unix time in seconds; only messages received at or after it. Example: 1796464000. |
timeout | query | integer | no | Example: 20. |
from | query | string | no | Case-insensitive substring of the sender. Example: noreply@example.com. |
subject | query | string | no | Case-insensitive substring of the subject. Example: verification. |
after | query | string | no | A message id. Only messages that arrived after that one are returned (an unknown id adds no constraint). Example: 2f1c0b1e-0000-4000-8000-000000000001. |
curl -s -H "Authorization: Bearer $ASSERTINBOX_KEY" \
"https://assertinbox.com/v1/wait?tag=signup-1"
| Status | Meaning |
|---|---|
| 200 | OK |
| 400 | tag_required |
| 401 | unauthorized |
| 403 | key_disabled |
| 408 | timeout |
| 429 | rate_limited: 2000 API requests per key per UTC day; see Retry-After |
Example 200 response:
{"id":"2f1c0b1e-0000-4000-8000-000000000001","tag":"signup-1","to":"k3x9a1bz.signup-1@assertinbox.com","ts":1796464450,"from":"noreply@example.com","reply_to":null,"subject":"Your code","text":"Your verification code is 482913","html":"","otp":"482913","magic_link":"https://example.com/verify?t=abc","links":["https://example.com/verify?t=abc"],"attachments":[]}
GET /v1/me
Your namespace, usage today and limits. Needs an API key.
curl -s -H "Authorization: Bearer $ASSERTINBOX_KEY" \
"https://assertinbox.com/v1/me"
| Status | Meaning |
|---|---|
| 200 | OK |
| 401 | unauthorized |
| 403 | key_disabled |
| 429 | rate_limited: see Retry-After |
Example 200 response:
{"namespace":"k3x9a1bz","address_template":"k3x9a1bz.<tag>@assertinbox.com","created_at":1796460000,"activated":true,"messages_today":3,"api_calls_today":12,"limits":{"messages_per_day":200,"api_calls_per_day":2000,"retention_hours":24}}
DELETE /v1/keys/me
Delete every message and usage row for your namespace and permanently disable the key. Needs an API key.
curl -s -X DELETE -H "Authorization: Bearer $ASSERTINBOX_KEY" \
"https://assertinbox.com/v1/keys/me"
| Status | Meaning |
|---|---|
| 200 | Deleted |
| 401 | unauthorized |
Example 200 response:
{"deleted":true}
POST /v1/keys/me/rotate
Issue a new API key for the same namespace; the old key stops working at once. Needs an API key.
curl -s -X POST -H "Authorization: Bearer $ASSERTINBOX_KEY" \
"https://assertinbox.com/v1/keys/me/rotate"
| Status | Meaning |
|---|---|
| 200 | New key |
| 401 | unauthorized |
Example 200 response:
{"api_key":"ai_fedcba9876543210","namespace":"k3x9a1bz"}