List active sessions
GET
/sessions
const url = 'https://auth.timetonic.com/api/sessions';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section intitulée « Authorizations »Responses
Section intitulée « Responses »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
city
string
region
string
ip_address
string
created_at
string format: date-time
last_active
string format: date-time
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}