Logging Out

At the end of a session, you can invoke the /security/logout endpoint to log the user out, passing the authentication token that was acquired from Advancing the Authentication, in the header. For example:

POST /Security/logout

The success field in the response indicates if the request was successful.

{
    "success": true,
    "Result": null,
    "Message": null,
    "MessageID": null,
    "Exception": null,
    "ErrorID": null,
    "ErrorCode": null,
    "InnerExceptions": null
}

Note: invoking the /Security/logout token will invalidate the authentication token (i.e. the token can no longer be used). If an application redirects to the endpoint and the authentication token is in a browser cookie, the token will be invalidated and the user will be automatically redirected to the CyberArk Identity login page. You should therefore choose between directly invoking the endpoint and redirecting to it, based on the desired behavior.

Try the API in Postman:
Try the API in PostmanTry the API in Postman.
Click here for help with using our sample Postman collection.