---
title: "Logging out of the API session"
date: "2024-02-14T06:18:38+00:00"
summary: "Learn how to securely log out of API sessions with our step-by-step guide. Discover proper endpoint setup, POST methods, and header configurations for seamless authentication management."
image:
type: "page"
url: "/customer-data-platform/logging-out-api-session"
id: "f393ecbd-02ed-468c-9c15-e0f5791e712e"
---

To log out of the API session:

1.  Set the endpoint for API. For example,
    
    `/authentication?action=logout`
    
2.  Use a POST method.
3.  Set the `content-type` header value to `application/json`.
4.  Set the `authorization header` value to `Bearer <access_token>`.

Response codes
--------------

*   `200`: Successful response code.
*   `500`: Bad request.
    
        {
         "errorCode":"E500_INTERNAL_SERVER_ERROR",
         "userMessage":"There was an exception processing the given request",
         "developerMessage":"6bad791c-2477-4f88-a595- 725515fc057a",
         "linkToErrorDoc":null,
         "linkToResourceDoc":null,
         "additionalInfo":null
        }
    
*   `401`: Unauthorized if the session is invalid.
    
        {
         "errorCode":"INVALID_TOKEN",
         "userMessage":"Invalid token",
         "developerMessage":"a60ed949-7599-4753-8bed-25825a0f96b7",
         "linkToErrorDoc":"",
         "linkToResourceDoc":null,
         "additionalInfo":null
        }