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

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

        await client.UserGrants.ListAsync(
            new ListUserGrantsRequestParameters {
                PerPage = 1,
                Page = 1,
                IncludeTotals = true,
                UserId = "user_id",
                ClientId = "client_id",
                Audience = "audience"
            }
        );
    }

}
package example

import (
context "context"

management "github.com/auth0/go-auth0/management/management"
client "github.com/auth0/go-auth0/management/management/client"
option "github.com/auth0/go-auth0/management/management/option"
)

func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &management.ListUserGrantsRequestParameters{
PerPage: management.Int(
1,
),
Page: management.Int(
1,
),
IncludeTotals: management.Bool(
true,
),
UserId: management.String(
"user_id",
),
ClientId: management.String(
"client_id",
),
Audience: management.String(
"audience",
),
}
client.UserGrants.List(
context.TODO(),
request,
)
}
package com.example.usage;

import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.resources.usergrants.requests.ListUserGrantsRequestParameters;

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

client.userGrants().list(
ListUserGrantsRequestParameters
.builder()
.perPage(1)
.page(1)
.includeTotals(true)
.userId("user_id")
.clientId("client_id")
.audience("audience")
.build()
);
}
}
<?php

namespace Example;

use Auth0\SDK\API\Management\Management;
use Auth0\SDK\API\Management\UserGrants\Requests\ListUserGrantsRequestParameters;

$client = new Management(
token: '<token>',
);
$client->userGrants->list(
new ListUserGrantsRequestParameters([
'perPage' => 1,
'page' => 1,
'includeTotals' => true,
'userId' => 'user_id',
'clientId' => 'client_id',
'audience' => 'audience',
]),
);
from auth0.management import ManagementClient

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

client.user_grants.list(
per_page=1,
page=1,
include_totals=True,
user_id="user_id",
client_id="client_id",
audience="audience",
)
require "auth0"

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

client.user_grants.list(
per_page: 1,
page: 1,
include_totals: true,
user_id: "user_id",
client_id: "client_id",
audience: "audience"
)
import { ManagementClient } from "auth0";

async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.userGrants.list({
perPage: 1,
page: 1,
includeTotals: true,
userId: "user_id",
clientId: "client_id",
audience: "audience",
});
}
main();
import { ManagementClient } from "auth0";

async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.userGrants.list({
perPage: 1,
page: 1,
includeTotals: true,
userId: "user_id",
clientId: "client_id",
audience: "audience",
});
}
main();
curl --request GET \
--url https://{tenantDomain}/api/v2/grants \
--header 'Authorization: Bearer <token>'
[
  {
    "id": "<string>",
    "clientID": "<string>",
    "user_id": "<string>",
    "audience": "<string>",
    "scope": [
      "<string>"
    ]
  }
]

Authorizations

Authorization
string
header
required

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

Query Parameters

per_page
integer

Number of results per page.

Required range: 1 <= x <= 100
page
integer

Page index of the results to return. First page is 0.

Required range: x >= 0
include_totals
boolean

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

user_id
string

user_id of the grants to retrieve.

client_id
string

client_id of the grants to retrieve.

audience
string

audience of the grants to retrieve.

Response

Grants successfully retrieved.

id
string

ID of the grant.

clientID
string

ID of the client.

user_id
string

ID of the user.

audience
string

Audience of the grant.

scope
string[]

Scopes included in this grant.

Minimum string length: 1