Logout
Description
Logout the current user and invalidate the access token.
Authentication
- Required: Yes
- Roles: None
Request
Headers
DELETE /v1/auth/logout
Content-Type: application/json
Authorization: Bearer <token>
Request Body
{}
No request body required.
Response
Success Response (200)
{
"data": {}
}
Error Responses
- 401: Authentication required
- 422: Validation errors (see Error Response Format)
Error Codes
- E001_AUTH_FAILURE: Authentication failure
Example Usage
curl -X DELETE https://api.stepx.io.vn/v1/auth/logout \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json"
const response = await fetch('https://api.stepx.io.vn/v1/auth/logout', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
}
});
const data = await response.json();