Read Email Verification Code
TypeScriptUtilityPOST api.upapi.io/email-read-verification-code.postConnect to an IMAP mailbox and extract a verification code from the SUBJECT of a recent email. Polls with retries. Supports Gmail (with App Password), Outlook, and any IMAP server. Generic — works for any platform that puts its code in the subject line; for a token that only appears in the body, use email-read-verification-link.
Request schema
| Field | Type | Description |
|---|---|---|
imapHost | string | IMAP server hostname· default: "imap.gmail.com" |
imapPassreq | string | IMAP password or app password |
imapPort | integer | IMAP server port· default: 993 |
imapUserreq | string | IMAP username (email address) |
maxRetries | integer | Number of polling attempts· default: 5 |
codePattern | string | Regex to extract a verification code from the email SUBJECT (the body is not fetched — use email-read-verification-link for body tokens)· default: "\\b(\\d{6})\\b" |
retryDelayMs | integer | Milliseconds between retry attempts· default: 10000 |
senderFilterreq | string | Filter emails by sender (e.g. noreply@redditmail.com) |
maxAgeMinutes | integer | Only look at emails received within this many minutes· default: 15 |
subjectPattern | string | Regex pattern to match subject line |
recipientFilter | string | Filter by recipient address (useful with catch-all domains) |
Response schema
| Field | Type | Description |
|---|---|---|
toreq | string | Recipient address |
codereq | string | Extracted verification code |
fromreq | string | Sender address |
subjectreq | string | Email subject line |
elapsedMsreq | integer | |
fetchedAtreq | string | |
receivedAtreq | string | When the email was received |
Try it
Try it
IMAP password or app password
IMAP username (email address)
Filter emails by sender (e.g. noreply@redditmail.com)
IMAP server hostname
IMAP server port
Number of polling attempts
Regex to extract a verification code from the email SUBJECT (the body is not fetched — use email-read-verification-link for body tokens)
Milliseconds between retry attempts
Only look at emails received within this many minutes
Regex pattern to match subject line
Filter by recipient address (useful with catch-all domains)
Run this endpoint live
Jump in as a guest — no signup — and run email-read-verification-code.post with your own inputs. Create a free account anytime to get your own API key.
Code examples
curl -X POST https://api.upapi.io/email-read-verification-code.post \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
-d '{ "imapHost": "imap.gmail.com", "imapPass": "example", "imapPort": 993, "imapUser": "example", "maxRetries": 5, "codePattern": "\\b(\\d{6})\\b", "retryDelayMs": 10000, "senderFilter": "noreply@redditmail.com", "maxAgeMinutes": 15 }'