This endpoint allows an authenticated user to log out of any of their sessions on the workspace. It is designed specifically for the user to terminate their sessions and cannot be used to log out sessions belonging to other users on the workspace.
URL | Requires Auth | HTTP Method |
---|---|---|
/api/v1/sessions/logout.me |
yes |
POST |
Argument | Example | Required | Description |
---|---|---|---|
X-User-Id | myuser-name | Required | The authenticated user ID. |
X-Auth-Token | myauth-token | Required | Auth token. |
Argument | Example | Required | Description |
---|---|---|---|
sessionId |
WJ2giBwm4B9mcojFi |
Required | The session id. |
{
"sessionId":"WJ2giBwm4B9mcojFi"
}
curl --location 'http://localhost:3000/api/v1/sessions/logout.me' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: ocFlTSMfowj9tSH1vQV6ANL9SiahkKUK1KhU_PpAUtT' \
--header 'X-User-Id: 2tTEqR7ZNMJ4HGGNa' \
--data '{
"sessionId": "WJ2giBwm4B9mcojFi"
}'
{
"sessionId": "WJ2giBwm4B9mcojFi",
"success": true
}
Any of the following errors can occur on the endpoint.
- Authorization: Requires an authentication token for the request to be made.
- Session not found: Occurs when the
sessionId
doesn't belong to the current user making the request or does not exist.
{% tabs %} {% tab title="Authorization" %}
{
"status": "error",
"message": "You must be logged in to do this."
}
{% endtab %}
{% tab title="Session not found" %}
{
"success": false,
"error": "Session not found"
}
{% endtab %} {% endtabs %}
Version | Description |
---|---|
5.0.0 | Added |