Skip to content
Sendtier Docs
Dashboard

Wait for the next message in an inbox

Requires a full key or an inbox key (bound inbox only). Returns the first matching message, or 204 when timeout seconds pass. after is a message id or a list cursor. Omit after to wait for a message received after this request starts. from is an exact sender address, ignoring case. subject_contains is a literal subject substring, ignoring case. The body is message metadata. Message bodies are not included. A missing, deleted, other-tenant or other-mode inbox is not found. Concurrent waits are limited per process and per tenant. A full limit returns 429. Messages and cursors are ordered by received_at and id, oldest matching first. received_at is the original mail receive time, not the time storage completes. A late retried delivery can arrive after a newer message while retaining an earlier received_at. It can fall before an advanced cursor or the request start time and will then be skipped. To reconcile retained messages, list messages again without a cursor and deduplicate by message id.

GET/v1/inboxes/{inbox_id}/messages/wait

Path parameters

ParameterDescription
inbox_idrequired
string

Query parameters

ParameterDescription
after
string

A message id or a next_cursor value. Absent waits for a message received after the request starts.

timeout
integer

Seconds to wait before returning 204.

from
string

Sender address. The match is exact and ignores case.

subject_contains
string

Literal subject substring. The match ignores case.

Full parameter schemas and constraints

Path Parameters

inbox_id*string

Query Parameters

after?string

A message id or a next_cursor value. Absent waits for a message received after the request starts.

timeout?integer

Seconds to wait before returning 204.

Range1 <= value <= 30
Default30
from?string

Sender address. The match is exact and ignores case.

subject_contains?string

Literal subject substring. The match ignores case.

Authorization

bearerAuth
headerAuthorizationBearer <token>

API key: st_live_... or st_test_...

Response Body

The first matching message, without bodies.

application/json
  1. response
id*string
inbox_id*string
thread_id*string
direction*string
Value in"inbound""outbound"
from*
to*array<string>
cc*array<string>
subject*string
preview*string
Lengthlength <= 200
size_bytes*integer
Formatint64
attachments*array<>
received_at*string
Formatdate-time
expires_at*string
Formatdate-time
authentication*
extracted*