AssertInbox

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 namespace. No API key needed.

curl -s -X POST https://assertinbox.com/v1/keys
StatusMeaning
201Created
403signups_closed
429rate_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.

ParameterInTypeRequiredDescription
tagquerystringno Example: signup-1.
sincequeryintegernoUnix time in seconds; only messages received at or after it. Example: 1796464000.
fromquerystringnoCase-insensitive substring of the sender. Example: noreply@example.com.
subjectquerystringnoCase-insensitive substring of the subject. Example: verification.
afterquerystringnoA 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"
StatusMeaning
200OK
401unauthorized
403key_disabled
429rate_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.

ParameterInTypeRequiredDescription
tagquerystringno Example: signup-1.
curl -s -X DELETE -H "Authorization: Bearer $ASSERTINBOX_KEY" \
  "https://assertinbox.com/v1/messages"
StatusMeaning
200OK
401unauthorized
403key_disabled
429rate_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.

ParameterInTypeRequiredDescription
idpathstringyes Example: 2f1c0b1e-0000-4000-8000-000000000001.
curl -s -H "Authorization: Bearer $ASSERTINBOX_KEY" \
  "https://assertinbox.com/v1/messages/2f1c0b1e-0000-4000-8000-000000000001"
StatusMeaning
200OK
401unauthorized
403key_disabled
404not_found
429rate_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.

ParameterInTypeRequiredDescription
idpathstringyes 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"
StatusMeaning
200OK
401unauthorized
403key_disabled
404not_found: no such message in your namespace
429rate_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.

ParameterInTypeRequiredDescription
tagquerystringyes Example: signup-1.
sincequeryintegernoUnix time in seconds; only messages received at or after it. Example: 1796464000.
timeoutqueryintegerno Example: 20.
fromquerystringnoCase-insensitive substring of the sender. Example: noreply@example.com.
subjectquerystringnoCase-insensitive substring of the subject. Example: verification.
afterquerystringnoA 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"
StatusMeaning
200OK
400tag_required
401unauthorized
403key_disabled
408timeout
429rate_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"
StatusMeaning
200OK
401unauthorized
403key_disabled
429rate_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"
StatusMeaning
200Deleted
401unauthorized

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"
StatusMeaning
200New key
401unauthorized

Example 200 response:

{"api_key":"ai_fedcba9876543210","namespace":"k3x9a1bz"}