GET /internal_api/session
get_internal_api_session
With the session token as the _session_id cookie, answers when the session and the licence lease expire, in epoch seconds. Reading it does not renew anything. 401 without the cookie.
API
The call the web app's own session checker makes. The launcher's sessionToken is that page's
_session_id cookie, so a client holding one can ask the same question: how long is this session good
for, and is it still alive.
Params
| part | value |
|---|---|
| path | <site>/internal_api/session, not under /api/v1 |
Cookie |
_session_id=<session token>. The only credential it takes |
Authorization: Bearer |
ignored. A REST bearer alone is 401 |
Sample requests
r = requests.get(f"{site}/internal_api/session", cookies={"_session_id": session_token}, timeout=30)
{"app": {"createdAt": 1788889023, "expiresAt": 1788975423, "forceExpiresAt": null},
"license": {"createdAt": 1788881738, "expiresAt": 1788968138},
"expirationReason": "session", "expired": false,
"expiresAt": 1788975423, "notifyAt": 1788974523,
"sessionInitUrl": "<site>/forge/init_auth..."}
Without the cookie, or with a REST bearer instead of it:
{"message": "Unauthorized"}
Response codes
| status | when |
|---|---|
| 200 | the session is known. expired says whether it is still good |
| 401 | no _session_id cookie, or one the site no longer holds |
Edge cases
- Timestamps are epoch seconds. On the probed site
expiresAt - createdAtis 86400 on bothappandlicense, which is the site'sUser Session Expirypreference reading one day, andnotifyAtisexpiresAt - 900. expiresAtis a sliding window, and this call does not slide it. Two reads five seconds apart return the same value. What moves it is any spend of the session token:POST /auth/access_tokenwithgrant_type=session_token,POST /internal_api/session, or the licence renewal (052_app_session_launcher). A mint moves it only when the last move was 300s or more ago; the twoPOSTrenewals move it every time.licenseis the Autodesk Identity seat lease, separate from the session and renewed separately byPOST /internal_api/autodesk_identity/license_renewal.expirationReasonnames which of the two the top-levelexpiresAtreports.- The error envelope is
{"message": ...}, as on every/internal_apicall, not theerrors[]array.