OAuth 2.1 refresh token rotation
curl --request POST \
--url https://api.ravion.com/oauth/refresh \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"grant_type": "refresh_token",
"refresh_token": "<string>"
}
}
'import requests
url = "https://api.ravion.com/oauth/refresh"
payload = { "data": {
"grant_type": "refresh_token",
"refresh_token": "<string>"
} }
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({data: {grant_type: 'refresh_token', refresh_token: '<string>'}})
};
fetch('https://api.ravion.com/oauth/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://api.ravion.com/oauth/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([
'data' => [
'grant_type' => 'refresh_token',
'refresh_token' => '<string>'
]
]),
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://api.ravion.com/oauth/refresh"
payload := strings.NewReader("{\n \"data\": {\n \"grant_type\": \"refresh_token\",\n \"refresh_token\": \"<string>\"\n }\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://api.ravion.com/oauth/refresh")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"grant_type\": \"refresh_token\",\n \"refresh_token\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ravion.com/oauth/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 \"data\": {\n \"grant_type\": \"refresh_token\",\n \"refresh_token\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"access_token": "<string>",
"expires_in": 123,
"refresh_token": "<string>",
"token_type": "Bearer"
}
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}OAuth
OAuth 2.1 refresh token rotation
Rotates an opaque refresh token. The previous refresh token is single-use; the response carries a fresh access+refresh pair within the same token family.
POST
/
oauth
/
refresh
OAuth 2.1 refresh token rotation
curl --request POST \
--url https://api.ravion.com/oauth/refresh \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"grant_type": "refresh_token",
"refresh_token": "<string>"
}
}
'import requests
url = "https://api.ravion.com/oauth/refresh"
payload = { "data": {
"grant_type": "refresh_token",
"refresh_token": "<string>"
} }
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({data: {grant_type: 'refresh_token', refresh_token: '<string>'}})
};
fetch('https://api.ravion.com/oauth/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://api.ravion.com/oauth/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([
'data' => [
'grant_type' => 'refresh_token',
'refresh_token' => '<string>'
]
]),
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://api.ravion.com/oauth/refresh"
payload := strings.NewReader("{\n \"data\": {\n \"grant_type\": \"refresh_token\",\n \"refresh_token\": \"<string>\"\n }\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://api.ravion.com/oauth/refresh")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"grant_type\": \"refresh_token\",\n \"refresh_token\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ravion.com/oauth/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 \"data\": {\n \"grant_type\": \"refresh_token\",\n \"refresh_token\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"access_token": "<string>",
"expires_in": 123,
"refresh_token": "<string>",
"token_type": "Bearer"
}
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}Body
application/json
Refresh request body. The CLI exchanges a refresh token for a new access+refresh pair when its access token nears expiry. Refresh tokens rotate on every use; a re-presented (already-rotated) refresh token revokes the entire token family server-side and returns INVALID_GRANT.
Show child attributes
Show child attributes
Response
The request has succeeded.
Token response. The CLI persists access_token + refresh_token; the server only stores their hashes.
Show child attributes
Show child attributes
Was this page helpful?
⌘I