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

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

func do() () {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    client.Roles.Users.List(
        context.TODO(),
        "id",
        &roles.ListRoleUsersRequestParameters{
            From: management.String(
                "from",
            ),
            Take: management.Int(
                1,
            ),
        },
    )
}
[
  {
    "user_id": "<string>",
    "picture": "<string>",
    "name": "<string>",
    "email": "john.doe@gmail.com"
  }
]

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string
required

ID of the role to retrieve a list of users associated with.

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

from
string

Optional Id from which to start selection.

take
integer

Number of results per page. Defaults to 50.

Required range: 1 <= x <= 100

Response

Role users successfully retrieved.

user_id
string

ID of this user.

picture
string

URL to a picture for this user.

name
string

Name of this user.

email
string<email>
default:john.doe@gmail.com

Email address of this user.