Get the latest one-time code for an inbox
GET/api/v1/emailInbox/:id/otp
Returns the most recently extracted one-time passcode (OTP) for an email inbox, with the message it came from. Requires API key with email_messages:read scope — this is a read of extracted message content, not inbox metadata. Shares its lookup and arguments with the pibx_email_get_latest_otp MCP tool.
Request
Responses
- 200
- 400
- 401
- 403
- 404
Successfully retrieved the latest OTP
Bad request - withinMinutes out of range, or from over the length cap
Unauthorized - missing or invalid API key
Forbidden - API key lacks required scope (email_messages:read)
Not found - no such inbox visible to this key, or no message with an extracted OTP has arrived within withinMinutes. The message distinguishes a stale code (one exists but is older than the window) from none at all.