Saltar al contenido 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,
    )
}
{
  "description": "<string>",
  "id": "<string>",
  "name": "<string>"
}

Autorizaciones

Authorization
string
header
requerido

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

Cuerpo

name
string
requerido

Nombre del rol.

description
string

Descripción del rol.

Respuesta

Rol creado correctamente.

description
string

Descripción de este rol.

id
string

ID de este rol.

name
string

Nombre de este rol.