EmailController

Extract verification codes from an email

Extracts one-time passcodes and similar tokens from email content using the selected extraction method and fallback options.

post/emails/{emailId}/codes

Request

  • Base URL: https://api.mailslurp.com
  • URL: https://api.mailslurp.com/emails/{emailId}/codes
  • Auth: API key in header x-api-key

Path parameters

emailIdstring uuid required

ID of email to extract codes from

Request body

method'AUTO' | 'PATTERN' | 'LLM' | 'OCR' | 'OCR_THEN_LLM' nullable

Extraction strategy for verification codes. Unsupported strategies may fall back when allowFallback is true.

allowFallbackboolean

Allow fallback to deterministic pattern extraction when the selected method is unavailable.

minLengthinteger

Minimum code length to consider. Typical OTP values are between 4 and 8 characters.

maxLengthinteger

Maximum code length to consider.

maxCandidatesinteger

Maximum number of code candidates to return. Best candidate is also returned separately.

customPatternsstring[] nullable

Optional custom regex patterns for code extraction. Each pattern should have either one capture group for the code or match the full code directly.

Response

OK

Changes

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