Overview
When end users authenticate with target systems through Maesn, the resultingX-ACCOUNT-KEY connection has an expiration tied to the underlying credentials (e.g., OAuth tokens or API keys).
With the Time To Live (TTL) feature, Maesn provides response headers on every authenticated API call that indicate when a connection will expire, allowing you to proactively prompt end users to re-authenticate before their connection becomes invalid.
Response headers
The following headers are included in responses to authenticated API calls:Expiration types
Different target systems have different credential lifecycles. TheX-Account-Key-Expiration-Type header indicates which behavior applies to a given connection.
fixed
The connection has a fixed maximum lifetime from the time it was created. The user must re-authenticate after this deadline.X-Account-Key-Expires-At: The absolute expiration timestamp (in UTC) after which re-authentication is requiredX-Account-Key-Refreshes-Until:null
extendable
The connection has a rolling refresh window rather than a fixed expiration date. As long as API calls are made before the refresh deadline, the connection remains valid indefinitely.X-Account-Key-Expires-At: The absolute maximum lifetime if one exists, otherwisenullX-Account-Key-Refreshes-Until: The deadline by which at least one API call must be made to keep the connection valid
X-Account-Key-Expires-At is null). As long as you make at least one API call before X-Account-Key-Refreshes-Until, the deadline keeps moving forward indefinitely.
permanent
The connection has no expiration date. This applies to API-key-based systems where credentials remain valid until manually revoked by the user.X-Account-Key-Expires-At:nullX-Account-Key-Refreshes-Until:null
How to use the headers
Monitor upcoming expirations
Check theX-Account-Key-Expires-At header to identify connections approaching their end-of-life. For fixed connections, this is the hard deadline. For extendable connections with a maximum lifetime, this indicates when the user must re-authenticate regardless of refresh activity.
Track refresh windows
Forextendable connections, monitor X-Account-Key-Refreshes-Until to ensure at least one API call is made before this deadline. If no API calls are made before this timestamp, the refresh token expires and the user must re-authenticate.
Proactive re-authentication
Use these headers to build dashboards or notifications that alert you when end user connections are nearing expiration, allowing you to prompt re-authentication before API calls start failing.Supported systems
The TTL headers are currently available for the following target systems:Support for additional target systems will be added over time. The headers will only be present in responses for supported systems.