Passer au contenu principal
GET
https://{tenantDomain}/api/v2
/
refresh-tokens
Get refresh tokens
curl --request GET \
  --url https://{tenantDomain}/api/v2/refresh-tokens \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://{tenantDomain}/api/v2/refresh-tokens"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://{tenantDomain}/api/v2/refresh-tokens', 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://{tenantDomain}/api/v2/refresh-tokens",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$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://{tenantDomain}/api/v2/refresh-tokens"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://{tenantDomain}/api/v2/refresh-tokens")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{tenantDomain}/api/v2/refresh-tokens")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "refresh_tokens": [
    {
      "id": "<string>",
      "user_id": "auth0|507f1f77bcf86cd799439020",
      "created_at": "2023-11-07T05:31:56Z",
      "idle_expires_at": "2023-11-07T05:31:56Z",
      "expires_at": "2023-11-07T05:31:56Z",
      "device": {
        "initial_ip": "<string>",
        "initial_asn": "<string>",
        "initial_user_agent": "<string>",
        "last_ip": "<string>",
        "last_asn": "<string>",
        "last_user_agent": "<string>"
      },
      "client_id": "<string>",
      "session_id": "<string>",
      "rotating": true,
      "resource_servers": [
        {
          "audience": "<string>",
          "scopes": "<string>"
        }
      ],
      "refresh_token_metadata": {},
      "last_exchanged_at": "2023-11-07T05:31:56Z"
    }
  ],
  "next": "<string>"
}

Autorisations

Authorization
string
header
requis

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Paramètres de requête

user_id
string
requis

ID of the user whose refresh tokens to retrieve. Required.

client_id
string

Filter results by client ID. Only valid when user_id is provided.

from
string

An opaque cursor from which to start the selection (exclusive). Expires after 24 hours. Obtained from the next property of a previous response.

take
integer

Number of results per page. Defaults to 50.

Plage requise: 1 <= x <= 100
fields
string

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

include_fields
boolean

Whether specified fields are to be included (true) or excluded (false).

Réponse

The refresh tokens were retrieved.

refresh_tokens
object[]
next
string

A cursor to be used as the "from" query parameter for the next page of results.