OTP extraction

We parse incoming email and extract one-time codes (OTP, verification codes, magic link tokens) so you get the value directly — no regex on your side. Available on Startup plan and above. Cost: 3 requests.

Free plan: __DETECTED__

On the Free plan, when an OTP is detected we return __DETECTED__ instead of the actual code. This lets you confirm that the pipeline works before upgrading to a paid plan to receive the real value.

GET /v1/inboxes/{inbox}/otp

Returns the latest extracted OTP (and verification link) for the inbox, or null if none found. Requires Startup plan or above. Fields are returned at the top level of the response (there is no data wrapper). Optional query param since (Unix ms) only considers messages received after that time. Cost: 3 requests.

FieldDescription
otp, codeThe code, or null (code is an alias)
scoreConfidence score (0.0 to 1.0) of the extracted OTP
verification_linkExtracted link if present
inbox, to, from, subjectQueried inbox, recipient, sender and subject
email_idID of the message the code came from
timestampWhen the message was received, as Unix milliseconds
curl
curl "https://api2.freecustom.email/v1/inboxes/mytest@ditapi.info/otp" \
  -H "Authorization: Bearer fce_your_api_key"

Example success (200):

json
{
  "success": true,
  "otp": "847291",
  "code": "847291",
  "score": 0.98,
  "email_id": "msg_abc123",
  "inbox": "mytest@ditapi.info",
  "to": "mytest@ditapi.info",
  "from": "noreply@example.com",
  "subject": "Your code is 847291",
  "timestamp": 1772618100000,
  "verification_link": "https://github.com/verify?token=abc123"
}

No OTP found: { "success": true, "otp": null, "code": null, "message": "No OTP found in recent messages." }. 403 plan_required on Free and Developer plans (upgrade_url in body).

Edge cases

If no OTP is found, the response is { "otp": null } (or similar). This is not an error — the request succeeded; there was simply no code in the latest messages.