Skip to main content
GET
https://{tenantDomain}/api/v2
/
roles
Go
package example

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

func do() () {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    client.Roles.List(
        context.TODO(),
        &management.ListRolesRequestParameters{
            PerPage: management.Int(
                1,
            ),
            Page: management.Int(
                1,
            ),
            IncludeTotals: management.Bool(
                true,
            ),
            NameFilter: management.String(
                "name_filter",
            ),
        },
    )
}
[
  {
    "id": "<string>",
    "name": "<string>",
    "description": "<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. Defaults to 50.

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).

name_filter
string

Optional filter on name (case-insensitive).

Response

Roles successfully retrieved.

id
string

ID for this role.

name
string

Name of this role.

description
string

Description of this role.