Skip to contentSkip to navigationSkip to topbar
Page toolsOn this pageProducts used
Looking for more inspiration?Visit the

31202: Signature validation failed.


ERROR: 31202

error-31202 page anchor
VOICE
ERROR

Twilio rejected the provided Access Token because its JWT signature couldn't be validated against the API Key secret associated with the token's issuer. The Voice SDK classifies 31202 as a JWT signature validation failure, and Access Tokens use a signature computed from the token header and payload using your API Key secret.

Possible causes

possible-causes page anchor
  • The Access Token wasn't signed with the API Key secret that corresponds to the API Key SID in the token's iss claim, so Twilio cannot verify the signature.
  • The JWT header alg isn't HS256, which is the required algorithm for Twilio Access Tokens.
  • Regenerate the Access Token using a Twilio SDK and provide the correct Account SID, API Key SID, and matching API Key Secret as documented. This ensures the token is constructed and signed correctly.
  • Ensure the JWT header explicitly uses alg set to HS256 before signing the token.
  • Verify you are using the exact API Key Secret that was issued for the API Key SID in iss and that it's securely stored and current. If the secret was rotated, update your server configuration and regenerate tokens.

Additional resources

additional-resources page anchor