Skip to main content
GET
https://{tenantDomain}/api/v2
/
refresh-tokens
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;

public partial class Examples
{
    public async Task Example() {
        var client = new ManagementClient(
            token: "<token>"
        );

        await client.RefreshTokens.ListAsync(
            new GetRefreshTokensRequestParameters {
                UserId = "user_id",
                ClientId = "client_id",
                From = "from",
                Take = 1,
                Fields = "fields",
                IncludeFields = true
            }
        );
    }

}
package com.example.usage;

import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.resources.refreshtokens.requests.GetRefreshTokensRequestParameters;

public class Example {
    public static void main(String[] args) {
        ManagementApi client = ManagementApi
            .builder()
            .token("<token>")
            .build();

        client.refreshTokens().list(
            GetRefreshTokensRequestParameters
                .builder()
                .userId("user_id")
                .clientId("client_id")
                .from("from")
                .take(1)
                .fields("fields")
                .includeFields(true)
                .build()
        );
    }
}
<?php

namespace Example;

use Auth0\SDK\API\Management\Management;
use Auth0\SDK\API\Management\RefreshTokens\Requests\GetRefreshTokensRequestParameters;

$client = new Management(
    token: '<token>',
);
$client->refreshTokens->list(
    new GetRefreshTokensRequestParameters([
        'userId' => 'user_id',
        'clientId' => 'client_id',
        'from' => 'from',
        'take' => 1,
        'fields' => 'fields',
        'includeFields' => true,
    ]),
);
from auth0.management import ManagementClient

client = ManagementClient(
    token="<token>",
)

client.refresh_tokens.list(
    user_id="user_id",
    client_id="client_id",
    from="from",
    take=1,
    fields="fields",
    include_fields=True,
)
require "auth0"

client = Auth0::Management.new(token: "<token>")

client.refresh_tokens.list(
  user_id: "user_id",
  client_id: "client_id",
  from: "from",
  take: 1,
  fields: "fields",
  include_fields: true
)
curl --request GET \
  --url https://{tenantDomain}/api/v2/refresh-tokens \
  --header 'Authorization: Bearer <token>'
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));
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))

}
{
  "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>"
}

Authorizations

Authorization
string
header
required

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

Query Parameters

user_id
string
required

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.

Required range: 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).

Response

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.