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

20104: Access Token expired or expiration date invalid


WARNING: 20104

warning-20104 page anchor
API, IAM
WARNING

This warning occurs when the Access Token sent to a Twilio API is no longer valid because its exp claim is in the past, the expiration time in the token is invalid, or the expiration was set beyond the maximum allowed lifetime. Access Token lifetimes are configurable up to 24 hours, and tokens should be as short-lived as feasible for your application. You can also validate token structure with standard JWT tools.

Access Tokens are used by multiple Twilio client SDKs, including Voice, Conversations, Sync, and Video.

Possible causes

possible-causes page anchor
  • The token's exp claim indicates a time that has already passed, so the Access Token has expired.
  • The expiration time in the token is invalid (for example, not a valid value), causing the token to be rejected.
  • The expiration time was set too far in the future, exceeding the maximum allowed lifetime for Access Tokens (up to 24 hours).
  • Regenerate the Access Token with an appropriate ttl that does not exceed 24 hours, following the guidance to keep tokens as short-lived as feasible.
  • Implement client-side handling to refresh Access Tokens before they expire using the SDKs' token update/expiration mechanisms.
  • Verify the token is well-formed and that time-based claims (such as exp) are set correctly according to JWT/Access Token requirements before sending requests.

Additional resources

additional-resources page anchor