# 20156: Expired or Invalid Expiration in Token

Log Type: TWILIO

Log Level: ERROR

## Description

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.

### Possible causes

* The system that generates the token has incorrect clock time, causing the token's `exp` to be evaluated as expired or outside allowed clock skew.
* The token's `exp` claim is not a valid expiration timestamp or is set in the past.

### Possible solutions

* Regenerate a fresh Access Token and ensure you set an appropriate `ttl` (in seconds) so the resulting `exp` is 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.)

#### Additional resources

* [Access Tokens](/docs/iam/access-tokens)
* [Public Key Client Validation Quickstart](/docs/iam/pkcv/quickstart)
