Auth
List Sessions
List the logged-in user’s unexpired dashboard sessions, flagging the current one.
GET
/
v1
/
auth
/
sessions
List active sessions
curl --request GET \
--url https://billing.example.com/v1/auth/sessions \
--cookie recurso_session=import requests
url = "https://billing.example.com/v1/auth/sessions"
headers = {"cookie": "recurso_session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'recurso_session='}};
fetch('https://billing.example.com/v1/auth/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://billing.example.com/v1/auth/sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "recurso_session=",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://billing.example.com/v1/auth/sessions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "recurso_session=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://billing.example.com/v1/auth/sessions")
.header("cookie", "recurso_session=")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/auth/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = 'recurso_session='
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_agent": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"current": true
}
]
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}Lists every unexpired dashboard session belonging to the logged-in user, with
Errors use the standard envelope — see Errors.
current: true on the session that made the request. Use it to power a
“where you’re signed in” view, then revoke a single session with
Revoke Session or everything except the
current one with Revoke Other Sessions.
Requires a logged-in user session (the recurso_session cookie set by
/auth/login). API-key callers have no user
identity and receive 401.
Example Request
curl https://api.recurso.dev/v1/auth/sessions \
-b cookies.txt
Example Response
{
"data": [
{
"id": "a1f4c9d2-7b3e-4e58-9c6a-2d8f0b1e5a73",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 14_5) AppleWebKit/537.36 Chrome/126.0 Safari/537.36",
"created_at": "2026-09-01T08:15:22Z",
"expires_at": "2026-09-08T08:15:22Z",
"current": true
},
{
"id": "5c0e2b17-93da-4f61-b8a4-7e1f6d3c9b20",
"user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) Safari/604.1",
"created_at": "2026-08-28T19:42:07Z",
"expires_at": "2026-09-04T19:42:07Z",
"current": false
}
]
}
Fields
| Field | Type | Description |
|---|---|---|
id | string (uuid) | Session identifier. Pass it to Revoke Session. |
user_agent | string | The User-Agent header recorded when the session was created. |
created_at | string (date-time) | When the session was created. |
expires_at | string (date-time) | When the session expires; expired sessions are not listed. |
current | boolean | true for the session that made this request. |
Errors
| Status | Code | When | Fix |
|---|---|---|---|
| 401 | unauthorized | No live session cookie, or the caller authenticated with an API key rather than a user session. | Sign in via /auth/login and send the recurso_session cookie. |
| 500 | internal_error | The sessions could not be loaded. | Retry; contact support if it persists. |
⌘I
List active sessions
curl --request GET \
--url https://billing.example.com/v1/auth/sessions \
--cookie recurso_session=import requests
url = "https://billing.example.com/v1/auth/sessions"
headers = {"cookie": "recurso_session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'recurso_session='}};
fetch('https://billing.example.com/v1/auth/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://billing.example.com/v1/auth/sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "recurso_session=",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://billing.example.com/v1/auth/sessions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "recurso_session=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://billing.example.com/v1/auth/sessions")
.header("cookie", "recurso_session=")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/auth/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = 'recurso_session='
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_agent": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"current": true
}
]
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}