Aller au contenu

List active sessions

GET
/sessions
curl --request GET \
--url https://auth.timetonic.com/api/sessions \
--header 'Authorization: Bearer <token>'

List the authenticated user’s active sessions, each with a device label, approximate location, timestamps, and a flag for the current session.

The user’s active sessions

Media typeapplication/json
object
success
boolean
sessions
Array<object>
object
id
required

Session identifier (use with DELETE /sessions/{sessionId})

string
device
required

Human-friendly device label derived from the user agent

string
location

Approximate location derived from the IP (null if unavailable)

object
country
string
nullable
city
string
nullable
region
string
nullable
ip_address
string
nullable
created_at
string format: date-time
nullable
last_active
string format: date-time
nullable
current
required

True for the session making this request

boolean
Example
{
"success": true,
"sessions": [
{
"device": "Chrome on macOS"
}
]
}

Authentication required or failed

Media typeapplication/json
object
success
boolean
error
string
message
string
Example
{
"success": false,
"error": "unauthorized",
"message": "Authentication required"
}

Rate limit exceeded

Media typeapplication/json
object
success
boolean
error
string
message
string
retry_after
integer
Example
{
"success": false,
"error": "too_many_requests",
"message": "Too many requests",
"retry_after": 45
}