Auth Api Logout

Auth Api Logout
Log out the current session

Revokes the local session first and clears VTP_SESSION. For an SSO session that holds a stored ID token and a stored end_session_endpoint, the 200 body carries idpLogoutUrl (RP-initiated logout) and the client navigates to it once. Otherwise the body is an empty object and the logout is local-only. A failure of the IdP step never changes the status. The response is never cacheable because the URL carries the ID token. Accessible to every authenticated role, including while mustChangePassword is true.

Request
URI
POST
https://{api_host}/api/v1/auth/logout
COPY
Authentication
This operation uses the following authentication methods.
Responses
200

200 OK; the local session is revoked

Returns LogoutResponse of type(s) application/json
{
    "idpLogoutUrl": "https://idp.example.com/realms/example/protocol/openid-connect/logout?id_token_hint=%3Credacted%3E&client_id=vtp-console&post_logout_redirect_uri=https%3A%2F%2Fconsole.example.com%2Flogin"
}
string
idpLogoutUrl
Optional

IdP end-session URL carrying id_token_hint, client_id and, when an effective external base URL exists, post_logout_redirect_uri. Present only when the stored ID token and end_session_endpoint could both be used. It carries the ID token; navigate to it once and never store or render it.

Response Headers

string
Cache-Control

no-store; the body can carry the ID token inside idpLogoutUrl


401

401 Unauthorized: UNAUTHENTICATED when the VTP_SESSION cookie is missing, unknown, expired or revoked

Returns Unauthenticated of type(s) application/json
{
    "errorCode": "string",
    "message": "string",
    "path": "string",
    "timestamp": "string",
    "reason": "string"
}
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' https://{api_host}/api/v1/auth/logout