Skip to main content

Overview

When end users authenticate with target systems through Maesn, the resulting X-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. The X-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 required
  • X-Account-Key-Refreshes-Until: null
Example: DATEV short token connections expire 11 hours after creation.

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, otherwise null
  • X-Account-Key-Refreshes-Until: The deadline by which at least one API call must be made to keep the connection valid
Maesn automatically refreshes the underlying tokens when you make API calls. You just need to ensure at least one API call is made before the X-Account-Key-Refreshes-Until timestamp. Each call extends the refresh deadline. If X-Account-Key-Expires-At is null, the connection can remain valid indefinitely. If a maximum lifetime exists, re-authentication is required when that date is reached.To refresh the connection, you can use the POST /auth/connections/validate endpoint (not yet available for all systems), or any other API call such as GET /companies.
Example: DATEV long token connections have no maximum lifetime (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: null
  • X-Account-Key-Refreshes-Until: null

How to use the headers

Monitor upcoming expirations

Check the X-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

For extendable 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.
Last modified on November 24, 2026