Verify OTP
verify_otpVerify a code submitted by an end user against the OTP MyOTP delivered. Returns {status: 'success'} if the code matches and the OTP hasn't expired — at that point the OTP is consumed and cannot be reused. Returns {status: 'failed', reason: 'invalid' | 'expired' | 'not found'} otherwise. You MUST pass either phone_number or message_id to identify which OTP you're verifying against. Call this after collecting the code from the user (login form, signup screen, etc.).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| otp | Yes | The OTP code the end user typed in (3-8 numeric digits). This is the code you're trying to verify against what was sent. | |
| message_id | No | The UUID returned by `generate_otp`. Provide either this OR `phone_number`. Prefer this when you have it — it disambiguates if the same number got multiple OTPs. | |
| phone_number | No | Phone number the OTP was originally sent to, in international format without + or leading 0. Provide either this OR `message_id` — `message_id` is more precise. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reason | No | Why verification failed: 'invalid', 'expired' or 'not found'. Absent on success. | |
| status | Yes | 'success' when the code matched and the OTP was consumed, otherwise 'failed' (or 'expired'). | |
| message | Yes | Message describing the verification result. |