Passer au contenu principal
POST
https://{tenantDomain}/api/v2
/
roles
Go
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.CreateRoleRequestContent{
        Name: "name",
    }
    client.Roles.Create(
        context.TODO(),
        request,
    )
}
{
  "id": "<string>",
  "name": "<string>",
  "description": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs-staging.auth0-mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Autorisations

Authorization
string
header
requis

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

Corps

name
string
requis

Name of the role.

description
string

Description of the role.

Réponse

Role successfully created.

id
string

ID for this role.

name
string

Name of this role.

description
string

Description of this role.