Try it live

Feel it in 30 seconds. No signup.

Click the button and get a real inbox address. Send any email with a code to that address, and watch wait_for_otp extract the OTP live.

The same call with your own key

The demo above uses a short-lived demo inbox. With your own API key and inbox, the equivalent call is:

curl
# remember the newest message id (0 if the inbox is empty) BEFORE
# you send the code, so a fast email still matches (needs jq)
SINCE=$(curl -s "https://dash.mailsocket.app/api/v1/inboxes/inbox_xxx/messages/latest" \
  -H "Authorization: Bearer $MAILSOCKET_API_KEY" | jq -r '.data.id // 0')
# send a code to your inbox, then wait up to 25s (204 = call again)
curl "https://dash.mailsocket.app/api/v1/inboxes/inbox_xxx/messages/wait?require=otp&since=${SINCE:?no cutoff, install jq and rerun the first line}&timeout=25" \
  -H "Authorization: Bearer $MAILSOCKET_API_KEY"

When you're ready, Start free to keep an inbox, create an API key, and use wait_for_otp in your tests. The demo inboxes here are short-lived and cleared automatically.