C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Roles;
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.Roles.Groups.DeleteAsync(
id: "id",
request: new DeleteRoleGroupsRequestContent {
Groups = new List<string>(){
"groups",
}
}
);
}
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.roles.types.DeleteRoleGroupsRequestContent;
import java.util.Arrays;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.roles().groups().delete(
"id",
DeleteRoleGroupsRequestContent
.builder()
.groups(
Arrays.asList("groups")
)
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Roles\Groups\Requests\DeleteRoleGroupsRequestContent;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->roles->groups->delete(
'id',
new DeleteRoleGroupsRequestContent([
'groups' => [
'groups',
],
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.roles.groups.delete(
id="id",
groups=[
"groups"
],
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.roles.groups.delete(
id: "id",
groups: ["groups"]
)
curl --request DELETE \
--url https://{tenantDomain}/api/v2/roles/{id}/groups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"groups": [
"<string>"
]
}
'const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({groups: ['<string>']})
};
fetch('https://{tenantDomain}/api/v2/roles/{id}/groups', 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/roles/{id}/groups"
payload := strings.NewReader("{\n \"groups\": [\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 groups from a role
Unassign one or more groups from a specified role.
DELETE
https://{tenantDomain}/api/v2
/
roles
/
{id}
/
groups
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Roles;
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.Roles.Groups.DeleteAsync(
id: "id",
request: new DeleteRoleGroupsRequestContent {
Groups = new List<string>(){
"groups",
}
}
);
}
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.roles.types.DeleteRoleGroupsRequestContent;
import java.util.Arrays;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.roles().groups().delete(
"id",
DeleteRoleGroupsRequestContent
.builder()
.groups(
Arrays.asList("groups")
)
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Roles\Groups\Requests\DeleteRoleGroupsRequestContent;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->roles->groups->delete(
'id',
new DeleteRoleGroupsRequestContent([
'groups' => [
'groups',
],
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.roles.groups.delete(
id="id",
groups=[
"groups"
],
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.roles.groups.delete(
id: "id",
groups: ["groups"]
)
curl --request DELETE \
--url https://{tenantDomain}/api/v2/roles/{id}/groups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"groups": [
"<string>"
]
}
'const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({groups: ['<string>']})
};
fetch('https://{tenantDomain}/api/v2/roles/{id}/groups', 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/roles/{id}/groups"
payload := strings.NewReader("{\n \"groups\": [\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))
}Authorizations
bearerAuthoAuth2ClientCredentials
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier for the role (service-generated).
Body
application/jsonapplication/x-www-form-urlencoded
Array of group IDs to remove from the role.
Minimum array length:
1Unique identifier for the group (service-generated).
Required string length:
18 - 26Pattern:
^grp_[1-9a-km-zA-HJ-NP-Z]{14,22}$Response
Groups successfully removed from role.
⌘I