Refresh session tokens
curl --request POST \
--url https://your-instance.example.com/api/auth/refresh \
--header 'Content-Type: application/json' \
--data '
{
"refreshToken": "rt_5f7b1c2e8a1d4e0012c3b4a5e6f7a8b9c0d1e2f3a4b5c6d7e8f9"
}
'import requests
url = "https://your-instance.example.com/api/auth/refresh"
payload = { "refreshToken": "rt_5f7b1c2e8a1d4e0012c3b4a5e6f7a8b9c0d1e2f3a4b5c6d7e8f9" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({refreshToken: 'rt_5f7b1c2e8a1d4e0012c3b4a5e6f7a8b9c0d1e2f3a4b5c6d7e8f9'})
};
fetch('https://your-instance.example.com/api/auth/refresh', 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://your-instance.example.com/api/auth/refresh",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'refreshToken' => 'rt_5f7b1c2e8a1d4e0012c3b4a5e6f7a8b9c0d1e2f3a4b5c6d7e8f9'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your-instance.example.com/api/auth/refresh"
payload := strings.NewReader("{\n \"refreshToken\": \"rt_5f7b1c2e8a1d4e0012c3b4a5e6f7a8b9c0d1e2f3a4b5c6d7e8f9\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://your-instance.example.com/api/auth/refresh")
.header("Content-Type", "application/json")
.body("{\n \"refreshToken\": \"rt_5f7b1c2e8a1d4e0012c3b4a5e6f7a8b9c0d1e2f3a4b5c6d7e8f9\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/auth/refresh")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"refreshToken\": \"rt_5f7b1c2e8a1d4e0012c3b4a5e6f7a8b9c0d1e2f3a4b5c6d7e8f9\"\n}"
response = http.request(request)
puts response.read_body{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1Zjdi...",
"socketToken": "st_eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "rt_64d2f9c5e8a1d4e001a0b1c2e6f7a8b9",
"sessionConfig": {
"enabled": true,
"idleTimeoutMinutes": 30
},
"user": {
"id": "5f7b1c2e8a1d4e0012c3b4a5",
"email": "admin@acme.example",
"organizationId": "64a1b2c3d4e5f60012345678",
"accessRole": "ADMIN"
}
}{
"error": "Invalid or expired token",
"code": "TOKEN_EXPIRED"
}{
"error": "Invalid or expired token",
"code": "TOKEN_EXPIRED"
}{
"error": "Invalid or expired token",
"code": "TOKEN_EXPIRED"
}Auth
Refresh session tokens
Exchange a valid refresh token for a new access token, socket token, and rotated refresh token. The supplied refresh token is consumed and replaced; an expired or unknown token returns 401.
POST
/
api
/
auth
/
refresh
Refresh session tokens
curl --request POST \
--url https://your-instance.example.com/api/auth/refresh \
--header 'Content-Type: application/json' \
--data '
{
"refreshToken": "rt_5f7b1c2e8a1d4e0012c3b4a5e6f7a8b9c0d1e2f3a4b5c6d7e8f9"
}
'import requests
url = "https://your-instance.example.com/api/auth/refresh"
payload = { "refreshToken": "rt_5f7b1c2e8a1d4e0012c3b4a5e6f7a8b9c0d1e2f3a4b5c6d7e8f9" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({refreshToken: 'rt_5f7b1c2e8a1d4e0012c3b4a5e6f7a8b9c0d1e2f3a4b5c6d7e8f9'})
};
fetch('https://your-instance.example.com/api/auth/refresh', 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://your-instance.example.com/api/auth/refresh",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'refreshToken' => 'rt_5f7b1c2e8a1d4e0012c3b4a5e6f7a8b9c0d1e2f3a4b5c6d7e8f9'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your-instance.example.com/api/auth/refresh"
payload := strings.NewReader("{\n \"refreshToken\": \"rt_5f7b1c2e8a1d4e0012c3b4a5e6f7a8b9c0d1e2f3a4b5c6d7e8f9\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://your-instance.example.com/api/auth/refresh")
.header("Content-Type", "application/json")
.body("{\n \"refreshToken\": \"rt_5f7b1c2e8a1d4e0012c3b4a5e6f7a8b9c0d1e2f3a4b5c6d7e8f9\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/auth/refresh")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"refreshToken\": \"rt_5f7b1c2e8a1d4e0012c3b4a5e6f7a8b9c0d1e2f3a4b5c6d7e8f9\"\n}"
response = http.request(request)
puts response.read_body{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1Zjdi...",
"socketToken": "st_eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "rt_64d2f9c5e8a1d4e001a0b1c2e6f7a8b9",
"sessionConfig": {
"enabled": true,
"idleTimeoutMinutes": 30
},
"user": {
"id": "5f7b1c2e8a1d4e0012c3b4a5",
"email": "admin@acme.example",
"organizationId": "64a1b2c3d4e5f60012345678",
"accessRole": "ADMIN"
}
}{
"error": "Invalid or expired token",
"code": "TOKEN_EXPIRED"
}{
"error": "Invalid or expired token",
"code": "TOKEN_EXPIRED"
}{
"error": "Invalid or expired token",
"code": "TOKEN_EXPIRED"
}Body
application/json
Raw refresh token previously returned by login/refresh; consumed and rotated server-side. Expired or unknown tokens return 401.
Response
Token refreshed
Refresh-token rotation envelope. Adds socketToken for re-authenticating the realtime socket alongside the new HTTP tokens.
Resolved session configuration returned alongside tokens. Mirrors the org-level idle-timeout / SSO renewal policy so the client can enforce it.
Show child attributes
Show child attributes
Example:
{
"enabled": true,
"idleTimeoutMinutes": 30,
"tokenExpiryHours": 8,
"warningTimeMinutes": 2,
"idleTrackingEnabled": true,
"ssoSilentRenewalEnabled": true,
"ssoFallbackBehavior": "redirect",
"passwordSilentRenewalEnabled": false,
"passwordFallbackBehavior": "logout"
}
Compact User payload returned with auth tokens.
Show child attributes
Show child attributes
Example:
{
"id": "5f7b1c2e8a1d4e0012c3b4a5",
"email": "admin@acme.example",
"fullName": "Acme Admin",
"organizationId": "64a1b2c3d4e5f60012345678",
"accessRole": "ADMIN",
"conversationOpenPreference": "split"
}
⌘I