C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Groups;
using System.Collections.Generic;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.Groups.Roles.DeleteAsync(
id: "id",
request: new DeleteGroupRolesRequestContent {
Roles = new List<string>(){
"roles",
}
}
);
}
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.groups.types.DeleteGroupRolesRequestContent;
import java.util.Arrays;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.groups().roles().delete(
"id",
DeleteGroupRolesRequestContent
.builder()
.roles(
Arrays.asList("roles")
)
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Groups\Roles\Requests\DeleteGroupRolesRequestContent;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->groups->roles->delete(
'id',
new DeleteGroupRolesRequestContent([
'roles' => [
'roles',
],
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.groups.roles.delete(
id="id",
roles=[
"roles"
],
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.groups.roles.delete(
id: "id",
roles: ["roles"]
)
curl --request DELETE \
--url https://{tenantDomain}/api/v2/groups/{id}/roles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"roles": [
"<string>"
]
}
'const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({roles: ['<string>']})
};
fetch('https://{tenantDomain}/api/v2/groups/{id}/roles', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenantDomain}/api/v2/groups/{id}/roles"
payload := strings.NewReader("{\n \"roles\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Remove roles from a group
Unassign one or more roles from a specified group.
DELETE
https://{tenantDomain}/api/v2
/
groups
/
{id}
/
roles
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Groups;
using System.Collections.Generic;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.Groups.Roles.DeleteAsync(
id: "id",
request: new DeleteGroupRolesRequestContent {
Roles = new List<string>(){
"roles",
}
}
);
}
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.groups.types.DeleteGroupRolesRequestContent;
import java.util.Arrays;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.groups().roles().delete(
"id",
DeleteGroupRolesRequestContent
.builder()
.roles(
Arrays.asList("roles")
)
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Groups\Roles\Requests\DeleteGroupRolesRequestContent;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->groups->roles->delete(
'id',
new DeleteGroupRolesRequestContent([
'roles' => [
'roles',
],
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.groups.roles.delete(
id="id",
roles=[
"roles"
],
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.groups.roles.delete(
id: "id",
roles: ["roles"]
)
curl --request DELETE \
--url https://{tenantDomain}/api/v2/groups/{id}/roles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"roles": [
"<string>"
]
}
'const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({roles: ['<string>']})
};
fetch('https://{tenantDomain}/api/v2/groups/{id}/roles', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenantDomain}/api/v2/groups/{id}/roles"
payload := strings.NewReader("{\n \"roles\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Autorisations
bearerAuthoAuth2ClientCredentials
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Paramètres de chemin
Unique identifier for the group (service-generated).
Required string length:
18 - 26Corps
application/jsonapplication/x-www-form-urlencoded
Array of role IDs to remove from the group.
Minimum array length:
1Unique identifier for the role (service-generated).
Réponse
Roles successfully removed from group.
⌘I