---
title: "Get the best OTP candidate"
method: GET
path: "/mailboxes/{mailboxId}/otp"
tags: ["Mailboxes"]
---

# Get the best OTP candidate

`GET /mailboxes/{mailboxId}/otp`

## Request

- Base URL: `https://api.mobilerun.ai`
- URL: `https://api.mobilerun.ai/mailboxes/{mailboxId}/otp`
- Auth: HTTP bearer

Returns the most likely recent OTP for the mailbox. Returns 204 when no matching code is available.

## Path parameters

- `mailboxId` string, uuid, required

## Query parameters

- `after` string, date-time
- `sender` string
- `minLength` integer
- `maxLength` integer

## Response `200`

Best OTP candidate

- object
  - `data` MailboxOtp, required
    - `code` string, required: OTP code as text to preserve leading zeros.
    - `confidence` 'high' | 'medium' | 'low', required
    - `messageId` string, required
    - `sender` string, nullable, required
    - `subject` string, nullable, required
    - `receivedAt` string, date-time, required

## Other responses

- `204`: No matching OTP yet
- `400`: The mailbox backend rejected the request
- `401`: Unauthorized
- `404`: Not Found
- `409`: Gmail connection is pending, expired, removed, or the message is too large
- `429`: Mailbox backend rate limited
- `500`: Internal Server Error
- `502`: Mailbox backend unavailable
- `503`: Mailboxes or OTP extraction disabled

## Changes

- **2026-10-21** `559a12449213`: 18 warning
  - added the new `integration_forbidden` enum value to the `anyOf[#/components/schemas/MailboxApiErrorEnvelope]/code` response property for the response status `400`
  - added the new `integration_forbidden` enum value to the `anyOf[#/components/schemas/MailboxApiErrorEnvelope]/code` response property for the response status `429`
  - added the new `integration_forbidden` enum value to the `anyOf[#/components/schemas/MailboxApiErrorEnvelope]/code` response property for the response status `502`
  - added the new `integration_forbidden` enum value to the `anyOf[#/components/schemas/MailboxApiErrorEnvelope]/code` response property for the response status `503`
  - …14 more
- **2026-10-16** `4ad548c528a8`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/droidrun/apis/droidrun-cloud/changes/mailboxes/:mailboxId/otp/get.md)

---

[API](https://skmtc.dev/droidrun/apis/droidrun-cloud.md) - [All operations](https://skmtc.dev/droidrun/apis/droidrun-cloud/llms.txt) - [OpenAPI document](https://skmtc.dev/droidrun/apis/droidrun-cloud/revisions/1cc95586c933?raw)
