Skip to main content
Check whether an OTP code is correct, unexpired, and unused using the Python SDK. Use this after the user submits the code they received via WhatsApp.

Parameters

Validate the code

The method returns the parsed response on success and raises a HypersenderError on any 4XX or 5XX response.

Common failure reasons

  • Code does not match the active OTP
  • Code expired based on expires value
  • Code already used (single-use)
  • No active OTP found for the chat_id
Implement rate limits on validation attempts (e.g., max 3-5 tries) to block brute-force guessing.

Next

For passwordless login flows, try Generate OTP Link to avoid manual code entry.
Last modified on November 24, 2026