Logout API
This API allows users to log out of their accounts by invalidating their access and refresh tokens.
1. Logout
Endpoint: api/v1/accounts/logout/
Method: POST
Permissions: IsAuthenticated
This endpoint logs out the user by blacklisting the refresh token and invalidating the access token.
Request Payload
{
"refresh": "refresh-token",
"access": "access-token"
}
Response Payload (Success)
{
"msg": "Successfully logged out"
}
Response Payload (Error)
{
"error": "Error message"
}