Delete a permission group
curl --request DELETE \
--url https://api.nekt.ai/api/v1/organization/permission-groups/{id}/ \
--header 'x-api-key: <api-key>'import requests
url = "https://api.nekt.ai/api/v1/organization/permission-groups/{id}/"
headers = {"x-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.nekt.ai/api/v1/organization/permission-groups/{id}/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nekt.ai/api/v1/organization/permission-groups/{id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.nekt.ai/api/v1/organization/permission-groups/{id}/"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.nekt.ai/api/v1/organization/permission-groups/{id}/")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nekt.ai/api/v1/organization/permission-groups/{id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyPermission groups
Delete a Permission Group
Remove a group and every grant that reached people through it.
DELETE
/
api
/
v1
/
organization
/
permission-groups
/
{id}
/
Delete a permission group
curl --request DELETE \
--url https://api.nekt.ai/api/v1/organization/permission-groups/{id}/ \
--header 'x-api-key: <api-key>'import requests
url = "https://api.nekt.ai/api/v1/organization/permission-groups/{id}/"
headers = {"x-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.nekt.ai/api/v1/organization/permission-groups/{id}/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nekt.ai/api/v1/organization/permission-groups/{id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.nekt.ai/api/v1/organization/permission-groups/{id}/"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.nekt.ai/api/v1/organization/permission-groups/{id}/")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nekt.ai/api/v1/organization/permission-groups/{id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyDeleting a group takes away the access it was giving. Everybody in it loses every grant they held through the group, on all three permission axes, immediately. Grants they hold in their own right are untouched. This cannot be undone — recreating the group means granting it again from nothing.
curl --request DELETE \
--url https://api.nekt.ai/api/v1/organization/permission-groups/GROUP_ID/ \
--header "x-api-key: YOUR_API_KEY"
Response
204, with no body.
Check what you are about to remove
A group’s grants are worth reading before deleting it, because the effect is spread across everybody in it.import os
import requests
BASE_URL = "https://api.nekt.ai"
headers = {"x-api-key": os.environ["NEKT_API_KEY"]}
group_id = "GROUP_ID"
params = {"expand[]": ["users", "lakehouse_permissions", "object_permissions", "semantic_layer_permissions"]}
group = requests.get(
f"{BASE_URL}/api/v1/organization/permission-groups/{group_id}/",
headers=headers,
params=params,
).json()
print(f"{group['name']} — {len(group['users'])} member(s) would lose:")
for axis in ("lakehouse_permissions", "object_permissions", "semantic_layer_permissions"):
print(f" {axis}: {len(group.get(axis) or [])} grant(s)")
Emptying instead of deleting
If the group might be needed again, replacing its membership with an empty list has the same effect on access and keeps the group and its grants intact.curl --request PATCH \
--url https://api.nekt.ai/api/v1/organization/permission-groups/GROUP_ID/ \
--header "x-api-key: YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{"users": []}'
Errors
| Status | When |
|---|---|
400 | The group is the All group, which cannot be deleted. |
403 | Your API key was created by a Member. |
404 | No group with that id in your workspace. |
Related
- Update a Group — emptying it instead.
- Revoke Permission — removing one grant rather than the group.
Was this page helpful?