Logout & Revoke Access
This endpoint allows you to securely log out by ending your current session. Once the session is ended, you will be logged out and will no longer have access to protected areas of the system until you log in again.

Authorization: Bearer YOUR_TOKEN



Expected Behavior:


  • The system will log you out, revoke your session, and invalidate any related tokens.
  • If the request is unauthorized or invalid, the system will respond with an error message explaining the issue.
JavaScript
Response codes
const axios = require('axios');

const url = 'https://auth.api.pinghome.io/v1/auth';

axios.delete(url, {
    headers: {
        'Authorization': 'Bearer YOUR_TOKEN'
    }
})
.then(response => {
    if (response.status === 204) {
        console.log('Session deleted successfully');
    }
})
.catch(error => {
    console.error(error.response.data);
});
ResponseThis section is used to view the possible HTTP response codes returned by the API. These codes indicate the status of a request, such as 201 (Created), 401 (Unauthorized), 409 (Conflict), or 422 (Unprocessable Entity).