Passer au contenu principal
PATCH
https://{tenantDomain}/api/v2
/
roles
/
{id}
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;

public partial class Examples
{
    public async Task Example() {
        var client = new ManagementClient(
            token: "<token>"
        );

        await client.Roles.UpdateAsync(
            id: "id",
            request: new UpdateRoleRequestContent()
        );
    }

}
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.UpdateRoleRequestContent{}
    client.Roles.Update(
        context.TODO(),
        "id",
        request,
    )
}
package com.example.usage;

import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.resources.roles.requests.UpdateRoleRequestContent;

public class Example {
    public static void main(String[] args) {
        ManagementApi client = ManagementApi
            .builder()
            .token("<token>")
            .build();

        client.roles().update(
            "id",
            UpdateRoleRequestContent
                .builder()
                .build()
        );
    }
}
<?php

namespace Example;

use Auth0\SDK\API\Management\Management;
use Auth0\SDK\API\Management\Roles\Requests\UpdateRoleRequestContent;

$client = new Management(
    token: '<token>',
);
$client->roles->update(
    'id',
    new UpdateRoleRequestContent([]),
);
from auth0.management import ManagementClient

client = ManagementClient(
    token="<token>",
)

client.roles.update(
    id="id",
)
require "auth0"

client = Auth0::Management.new(token: "<token>")

client.roles.update(id: "id")
import { ManagementClient } from "auth0";

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.roles.update("id", {});
}
main();
import { ManagementClient } from "auth0";

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.roles.update("id", {});
}
main();
curl --request PATCH \
  --url https://{tenantDomain}/api/v2/roles/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>"
}
'
{
  "id": "<string>",
  "name": "<string>",
  "description": "<string>"
}

Autorisations

Authorization
string
header
requis

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

Paramètres de chemin

id
string
requis

ID of the role to update.

Corps

name
string

Name of this role.

description
string

Description of this role.

Réponse

Role successfully updated.

id
string

ID for this role.

name
string

Name of this role.

description
string

Description of this role.