Create a permission group
curl --request POST \
--url https://api.nekt.ai/api/v1/organization/permission-groups/ \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"users": [
123
],
"description": "<string>"
}
'import requests
url = "https://api.nekt.ai/api/v1/organization/permission-groups/"
payload = {
"name": "<string>",
"users": [123],
"description": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', users: [123], description: '<string>'})
};
fetch('https://api.nekt.ai/api/v1/organization/permission-groups/', 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/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'users' => [
123
],
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.nekt.ai/api/v1/organization/permission-groups/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"users\": [\n 123\n ],\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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))
}HttpResponse<String> response = Unirest.post("https://api.nekt.ai/api/v1/organization/permission-groups/")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"users\": [\n 123\n ],\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nekt.ai/api/v1/organization/permission-groups/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"users\": [\n 123\n ],\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"all_group": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"users": [
123
],
"description": "<string>"
}Permission groups
Create a Permission Group
A new group, optionally with its members already in it.
POST
/
api
/
v1
/
organization
/
permission-groups
/
Create a permission group
curl --request POST \
--url https://api.nekt.ai/api/v1/organization/permission-groups/ \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"users": [
123
],
"description": "<string>"
}
'import requests
url = "https://api.nekt.ai/api/v1/organization/permission-groups/"
payload = {
"name": "<string>",
"users": [123],
"description": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', users: [123], description: '<string>'})
};
fetch('https://api.nekt.ai/api/v1/organization/permission-groups/', 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/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'users' => [
123
],
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.nekt.ai/api/v1/organization/permission-groups/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"users\": [\n 123\n ],\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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))
}HttpResponse<String> response = Unirest.post("https://api.nekt.ai/api/v1/organization/permission-groups/")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"users\": [\n 123\n ],\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nekt.ai/api/v1/organization/permission-groups/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"users\": [\n 123\n ],\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"all_group": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"users": [
123
],
"description": "<string>"
}Creates a permission group. A new group holds no grants — make them with the Permissions API once the group exists.
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Shown wherever the group appears. Pick something a colleague will recognize in a grant listing. |
description | string | No | What the group is for. |
users | array of integers | No | User ids to put in the group immediately. |
curl --request POST \
--url https://api.nekt.ai/api/v1/organization/permission-groups/ \
--header "x-api-key: YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"name": "Analysts",
"description": "Read access to the Gold layer",
"users": [12, 42]
}'
users takes user ids, which are integers, not the UUIDs used to identify groups and resources. Get them from List Recipients.Response
201, with the permission group object.
{
"id": "c1f0a9d4-5b62-4e18-9a73-2d8e4f6b0c51",
"name": "Analysts",
"description": "Read access to the Gold layer",
"all_group": false,
"created_at": "2026-09-25T10:14:02Z",
"updated_at": "2026-09-25T10:14:02Z",
"users": [12, 42]
}
Create a team and grant it access
The two calls that set a team up. After this, onboarding anybody onto that team is one membership call.import os
import requests
BASE_URL = "https://api.nekt.ai"
headers = {"x-api-key": os.environ["NEKT_API_KEY"], "Content-Type": "application/json"}
group = requests.post(
f"{BASE_URL}/api/v1/organization/permission-groups/",
headers=headers,
json={"name": "Analysts", "description": "Read access to the Gold layer"},
)
group.raise_for_status()
group_id = group.json()["id"]
grant = requests.post(
f"{BASE_URL}/api/v1/permissions/",
headers=headers,
json={
"assignments": [
{"permission_level": "viewer", "groups": [group_id], "layers": ["LAYER_ID"]}
]
},
)
grant.raise_for_status()
Errors
| Status | When |
|---|---|
400 | A user id in users belongs to a deactivated member. |
403 | Your API key was created by a Member. Creating groups requires an Owner’s or Admin’s key. |
Related
- Assign Permissions — giving the new group its access.
- Add Members — filling it later.
- Permission groups — why a group instead of direct grants.
Authorizations
API Key authentication. Format: 'x-api-key: api_key'
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Was this page helpful?