Skip to main content
POST
https://{tenantDomain}/api/v2
/
organizations
/
{id}
/
members
/
{user_id}
/
roles
Go
package example

import (
    context "context"

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

func do() {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    request := &members.AssignOrganizationMemberRolesRequestContent{
        Roles: []string{
            "roles",
        },
    }
    client.Organizations.Members.Roles.Assign(
        context.TODO(),
        "id",
        "user_id",
        request,
    )
}

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string
required

Organization identifier.

Maximum string length: 50
user_id
string
required

ID of the user to associate roles with.

Body

roles
string<role-id>[]
required

List of roles IDs to associated with the user.

Minimum array length: 1

Response

Roles successfully associated with user.