messages

Wait for an OTP or magic link

Blocks until a matching parsed message arrives, or returns empty when the window elapses. This is the "one call, wait for the code" primitive.

  • timeout: seconds to block (default 20, clamped to [1, 25]).
  • since: only messages received strictly after this point match. Accepted forms: an ISO-8601 datetime, a message public_id (resolved to that owned message's received_at), or a unix timestamp (seconds; values ≥ 1e12 are treated as milliseconds). Default: the request start time. Pass since=0 (the epoch) to mean "match messages already in the inbox".
  • require: otp (default) | link | any. Any other value is rejected with 422 validation_error (fields.require lists the allowed values); it is never silently coerced.
  • min_confidence: float, default 0.0; an OTP must have otp_confidence >= min_confidence. Clamped to [0, 1]. Ignored for require=link.

Waiting in a loop: every 200 and 204 carries a Mailsocket-Wait-Since header with the cutoff this call used (your since, or the request start). Pass this back as since on your next wait call to never miss a message. Without it, each new call starts a fresh cutoff, so a message that arrives between two calls is skipped.

A single wait occupies one gthread worker for up to timeout seconds. Concurrency is bounded by a per-account cap and a global cap, surfaced as the two distinct 429 codes below.

get/inboxes/{id}/messages/wait

Request

  • Base URL: https://dash.mailsocket.app/api/v1
  • URL: https://dash.mailsocket.app/api/v1/inboxes/{id}/messages/wait
  • Auth: HTTP bearer

Path parameters

idstring required

The inbox public ID (e.g. inbox_...).

Query parameters

timeoutnumber

Seconds to block. Default 20. Clamped to [1, 25].

sincestring

ISO-8601 datetime, a message public_id, or a unix timestamp. Only messages received strictly after this point match.

require'otp' | 'link' | 'any'

What counts as a match. Any other value -> 422 validation_error.

min_confidencenumber

Minimum otp_confidence for an OTP match. Default 0.0.

Response

A matching parsed message arrived.

Changes

No recorded changes to this operation across all 1 revision of this API.