TypeScript
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.users.refreshToken.list("user_id", {
include_totals: true,
from: "from",
take: 1,
});
}
main();
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.users.refreshToken.list("user_id", {
include_totals: true,
from: "from",
take: 1,
});
}
main();
package example
import (
context "context"
management "github.com/auth0/go-auth0/v3/management"
client "github.com/auth0/go-auth0/v3/management/client"
option "github.com/auth0/go-auth0/v3/management/option"
)
func do() {
mgmt, err := client.New(
"{YOUR_DOMAIN}",
option.WithToken(
"<token>",
),
)
if err != nil {
return
}
request := &management.ListRefreshTokensRequestParameters{
IncludeTotals: management.Bool(
true,
),
From: management.String(
"from",
),
Take: management.Int(
1,
),
}
mgmt.Users.RefreshToken.List(
context.TODO(),
"user_id",
request,
)
}
# Ensure you're logged in: auth0 login
auth0 users refresh-tokens list user_id --jsonusing Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Users;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.Users.RefreshToken.ListAsync(
userId: "user_id",
request: new ListRefreshTokensRequestParameters {
IncludeTotals = true,
From = "from",
Take = 1
}
);
}
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.users.types.ListRefreshTokensRequestParameters;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.users().refreshToken().list(
"user_id",
ListRefreshTokensRequestParameters
.builder()
.includeTotals(true)
.from("from")
.take(1)
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Users\RefreshToken\Requests\ListRefreshTokensRequestParameters;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->users->refreshToken->list(
'user_id',
new ListRefreshTokensRequestParameters([
'includeTotals' => true,
'from' => 'from',
'take' => 1,
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.users.refresh_token.list(
user_id="user_id",
include_totals=True,
from_="from",
take=1,
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.users.refresh_token.list(
user_id: "user_id",
include_totals: true,
from: "from",
take: 1
)
curl --request GET \
--url https://{tenantDomain}/api/v2/users/{user_id}/refresh-tokens \
--header 'Authorization: Bearer <token>'{
"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>"
}Get refresh tokens for a user
Retrieve details for a user’s refresh tokens.
GET
https://{tenantDomain}/api/v2
/
users
/
{user_id}
/
refresh-tokens
TypeScript
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.users.refreshToken.list("user_id", {
include_totals: true,
from: "from",
take: 1,
});
}
main();
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.users.refreshToken.list("user_id", {
include_totals: true,
from: "from",
take: 1,
});
}
main();
package example
import (
context "context"
management "github.com/auth0/go-auth0/v3/management"
client "github.com/auth0/go-auth0/v3/management/client"
option "github.com/auth0/go-auth0/v3/management/option"
)
func do() {
mgmt, err := client.New(
"{YOUR_DOMAIN}",
option.WithToken(
"<token>",
),
)
if err != nil {
return
}
request := &management.ListRefreshTokensRequestParameters{
IncludeTotals: management.Bool(
true,
),
From: management.String(
"from",
),
Take: management.Int(
1,
),
}
mgmt.Users.RefreshToken.List(
context.TODO(),
"user_id",
request,
)
}
# Ensure you're logged in: auth0 login
auth0 users refresh-tokens list user_id --jsonusing Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Users;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.Users.RefreshToken.ListAsync(
userId: "user_id",
request: new ListRefreshTokensRequestParameters {
IncludeTotals = true,
From = "from",
Take = 1
}
);
}
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.users.types.ListRefreshTokensRequestParameters;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.users().refreshToken().list(
"user_id",
ListRefreshTokensRequestParameters
.builder()
.includeTotals(true)
.from("from")
.take(1)
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Users\RefreshToken\Requests\ListRefreshTokensRequestParameters;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->users->refreshToken->list(
'user_id',
new ListRefreshTokensRequestParameters([
'includeTotals' => true,
'from' => 'from',
'take' => 1,
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.users.refresh_token.list(
user_id="user_id",
include_totals=True,
from_="from",
take=1,
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.users.refresh_token.list(
user_id: "user_id",
include_totals: true,
from: "from",
take: 1
)
curl --request GET \
--url https://{tenantDomain}/api/v2/users/{user_id}/refresh-tokens \
--header 'Authorization: Bearer <token>'{
"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
bearerAuthoAuth2ClientCredentials
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Scopes
read:refresh_tokens
Read Refresh Tokens
Path Parameters
ID of the user to get refresh tokens for
Query Parameters
Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).
An optional cursor from which to start the selection (exclusive).
Number of results per page. Defaults to 50.
Required range:
1 <= x <= 100