20156: Expired or Invalid Expiration in Token
API, IAM
ERROR
This error occurs when the JSON Web Token provided to the Twilio API has already expired, or the expiration value in the token is invalid.
- The system that generates the token has incorrect clock time, causing the token's
expto be evaluated as expired or outside allowed clock skew. - The token's
expclaim is not a valid expiration timestamp or is set in the past.
- Regenerate a fresh Access Token and ensure you set an appropriate
ttl(in seconds) so the resultingexpis valid and not already expired. - Keep your token-issuing server's clock synchronized (e.g., via NTP). Tokens received after
exp(beyond permitted clock skew) are rejected; ensure clock drift is minimized. - Implement token refresh/rotation in your client using the SDK's token update mechanisms so clients do not continue using expired tokens.
- Use Twilio Helper Libraries to construct tokens to avoid common mistakes in claim formatting and signing.
- If you are unsure whether the token is well-formed, validate its structure with a JWT inspection tool before retrying. (This workflow is referenced on the official 20156 page.)