Get the current user session
import requests
url = "https://{FUSION HOST}/api/session"
response = requests.get(url)
print(response.text)HttpResponse<String> response = Unirest.get("https://{FUSION HOST}/api/session")
.asString();const options = {method: 'GET'};
fetch('https://{FUSION HOST}/api/session', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://{FUSION HOST}/api/session")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{FUSION HOST}/api/session"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{FUSION HOST}/api/session",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request GET \
--url https://{FUSION HOST}/api/session{
"user": {
"id": "389ee4ee-08bf-3394-0b6b-6519372cfcae",
"username": "api-user",
"realmName": "native",
"createdAt": "2025-05-28T14:05:15Z",
"roleNames": [
"admin"
],
"permissions": []
},
"roles": [
{
"id": "1a61a7e3-0009-2d1f-adf5-6f2f2ded1424",
"name": "admin",
"createdAt": "2023-10-05T20:09:50Z",
"desc": "Full access to every service. This is the super-admin role.",
"permissions": [
{
"methods": [
"GET",
"PUT",
"PATCH",
"HEAD",
"DELETE",
"POST"
],
"path": "/**"
},
{
"methods": [
"GET",
"PUT",
"HEAD",
"DELETE",
"POST"
],
"path": "/solrAdmin/**"
}
],
"uiPermissions": [
"*"
]
}
]
}Get the current user session
Get details about the current user, all roles directly assigned to that user, and all roles inherited from the realm by that user.
GET
/
session
Get the current user session
import requests
url = "https://{FUSION HOST}/api/session"
response = requests.get(url)
print(response.text)HttpResponse<String> response = Unirest.get("https://{FUSION HOST}/api/session")
.asString();const options = {method: 'GET'};
fetch('https://{FUSION HOST}/api/session', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://{FUSION HOST}/api/session")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{FUSION HOST}/api/session"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{FUSION HOST}/api/session",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request GET \
--url https://{FUSION HOST}/api/session{
"user": {
"id": "389ee4ee-08bf-3394-0b6b-6519372cfcae",
"username": "api-user",
"realmName": "native",
"createdAt": "2025-05-28T14:05:15Z",
"roleNames": [
"admin"
],
"permissions": []
},
"roles": [
{
"id": "1a61a7e3-0009-2d1f-adf5-6f2f2ded1424",
"name": "admin",
"createdAt": "2023-10-05T20:09:50Z",
"desc": "Full access to every service. This is the super-admin role.",
"permissions": [
{
"methods": [
"GET",
"PUT",
"PATCH",
"HEAD",
"DELETE",
"POST"
],
"path": "/**"
},
{
"methods": [
"GET",
"PUT",
"HEAD",
"DELETE",
"POST"
],
"path": "/solrAdmin/**"
}
],
"uiPermissions": [
"*"
]
}
]
}Response
200 - application/json
OK
The response is of type object.
Was this page helpful?
⌘I