Refresh
curl --request POST \
--url https://staging.api.prexsell.com/v2/auth/refreshimport requests
url = "https://staging.api.prexsell.com/v2/auth/refresh"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://staging.api.prexsell.com/v2/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://staging.api.prexsell.com/v2/auth/refresh",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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://staging.api.prexsell.com/v2/auth/refresh"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://staging.api.prexsell.com/v2/auth/refresh")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.prexsell.com/v2/auth/refresh")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"user": {
"id": "usr_abc123def456",
"email": "user@example.com",
"firstName": "Іван",
"lastName": "Петренко"
},
"access": {
"contextType": "COMPANY",
"companyId": "cmp_xyz789",
"partnerId": null,
"role": "ADMIN",
"company": {
"id": "cmp_xyz789",
"name": "Prexsell Bus Lines",
"slug": "prexsell-bus-lines",
"tier": "PRO"
}
},
"session": {
"id": "ses_q1w2e3r4t5",
"contextType": "COMPANY",
"companyId": "cmp_xyz789",
"userId": "usr_abc123def456",
"expiresAt": "2026-06-28T00:00:00.000Z",
"lastUsedAt": "2026-05-28T12:00:00.000Z",
"revokedAt": null
},
"availableAccesses": []
}
}{
"errors": [
{
"message": "AUTH_INVALID_CREDENTIALS",
"errorCode": "UNAUTHORIZED"
}
]
}Auth
Refresh
Reads the refresh token from the HTTP-only cookie, rotates it, and issues a new access token. Detects token replay attacks and revokes the entire session family when detected.
POST
/
v2
/
auth
/
refresh
Refresh
curl --request POST \
--url https://staging.api.prexsell.com/v2/auth/refreshimport requests
url = "https://staging.api.prexsell.com/v2/auth/refresh"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://staging.api.prexsell.com/v2/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://staging.api.prexsell.com/v2/auth/refresh",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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://staging.api.prexsell.com/v2/auth/refresh"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://staging.api.prexsell.com/v2/auth/refresh")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.prexsell.com/v2/auth/refresh")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"user": {
"id": "usr_abc123def456",
"email": "user@example.com",
"firstName": "Іван",
"lastName": "Петренко"
},
"access": {
"contextType": "COMPANY",
"companyId": "cmp_xyz789",
"partnerId": null,
"role": "ADMIN",
"company": {
"id": "cmp_xyz789",
"name": "Prexsell Bus Lines",
"slug": "prexsell-bus-lines",
"tier": "PRO"
}
},
"session": {
"id": "ses_q1w2e3r4t5",
"contextType": "COMPANY",
"companyId": "cmp_xyz789",
"userId": "usr_abc123def456",
"expiresAt": "2026-06-28T00:00:00.000Z",
"lastUsedAt": "2026-05-28T12:00:00.000Z",
"revokedAt": null
},
"availableAccesses": []
}
}{
"errors": [
{
"message": "AUTH_INVALID_CREDENTIALS",
"errorCode": "UNAUTHORIZED"
}
]
}Response
Token rotated successfully. New access and refresh tokens are set as HTTP-only cookies.
Full authentication payload returned after a successful login, token refresh, or session fetch.
Show child attributes
Show child attributes
⌘I
