inboxes

Send yourself a test code

Puts one sample OTP email (a random 6-digit code) straight into one of your own inboxes. It does NOT go through the mail server: the message is stored and parsed exactly like real inbound mail, so a pending messages/wait returns it, it counts toward the monthly message usage and it fires the inbox's webhook. Use it to prove the wait loop end to end when you cannot send real email (for example, outbound port 25 is blocked).

To run the steps one call at a time (no second shell), take a cutoff BEFORE this call and pass it to the wait as since: read GET /inboxes/{id}/messages/latest and use its data.id (or 0 when it returns 404 because the inbox is empty), then call test-code, then GET /inboxes/{id}/messages/wait?require=otp&since=<that id>. The wait returns this test code even though it arrived before the wait started, and never an older code already in the inbox. Without since, the wait only sees mail that arrives while it runs, so then start the wait first and call test-code from another shell while it is pending.

Same feature and the same limits as the dashboard "Send a test code" button, and the two share one quota: 5 per inbox and 20 per account per hour. The per-inbox limit is checked first, so a refused request never uses up the account-wide budget. Foreign, deleted and unknown inbox ids all return the same 404, and nothing is charged.

post/inboxes/{id}/test-code

Request

  • Base URL: https://dash.mailsocket.app/api/v1
  • URL: https://dash.mailsocket.app/api/v1/inboxes/{id}/test-code
  • Auth: HTTP bearer

Path parameters

idstring required

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

Headers

Idempotency-Keystring

Optional. 1-255 printable ASCII characters (use a UUID). Scoped to the API key that sends it and kept for 24 hours. A retry with the same key and the same body replays the first response (with Idempotent-Replayed: true) and creates nothing new. The same key with a different body or endpoint returns 422 idempotency_key_reused; while the first request is still running, 409 idempotency_in_progress. Stored: 2xx, and 400/404/422 validation errors. Not stored (a retry runs again): outcomes you can fix and retry (402, 403, 409, and 422 domain_not_found_or_unverified), 429 and 5xx. An invalid value, or a body too large to read, returns 400 validation_error.

Response

The test code was stored. It is parsed within a moment.

Changes

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