Sessions

List sessions

GET/me/sessions
Authorization
Response

OK

Body
userId*string (uuid)
tokenId*string (uuid)
ipstring
userAgentstring
countrystring
regionstring
citystring
createdAt*string (date-time)
updatedAt*string (date-time)
Request
const response = await fetch('/me/sessions', {
    method: 'GET',
    headers: {
      "Authorization": "Bearer jwt"
    },
});
const data = await response.json();
Response
[
  {
    "userId": "123e4567-e89b-12d3-a456-426614174000",
    "tokenId": "123e4567-e89b-12d3-a456-426614174000",
    "ip": "text",
    "userAgent": "text",
    "country": "text",
    "region": "text",
    "city": "text",
    "createdAt": "2024-11-21T08:58:00.299Z",
    "updatedAt": "2024-11-21T08:58:00.299Z"
  }
]

Get session

GET/me/sessions/{tokenId}
Authorization
Path parameters
tokenId*string
Response

OK

Body
userId*string (uuid)
tokenId*string (uuid)
ipstring
userAgentstring
countrystring
regionstring
citystring
createdAt*string (date-time)
updatedAt*string (date-time)
Request
const response = await fetch('/me/sessions/{tokenId}', {
    method: 'GET',
    headers: {
      "Authorization": "Bearer jwt"
    },
});
const data = await response.json();
Response
{
  "userId": "123e4567-e89b-12d3-a456-426614174000",
  "tokenId": "123e4567-e89b-12d3-a456-426614174000",
  "ip": "text",
  "userAgent": "text",
  "country": "text",
  "region": "text",
  "city": "text",
  "createdAt": "2024-11-21T08:58:00.299Z",
  "updatedAt": "2024-11-21T08:58:00.299Z"
}

Delete session

DELETE/me/sessions/{tokenId}
Authorization
Path parameters
tokenId*string
Response

Deleted

Request
const response = await fetch('/me/sessions/{tokenId}', {
    method: 'DELETE',
    headers: {
      "Authorization": "Bearer jwt"
    },
});
const data = await response.json();
Response
{
  "code": "text",
  "message": "text"
}

Last updated