List permission recipients
curl --request GET \
--url https://api.nekt.ai/api/v1/permission-recipients/ \
--header 'x-api-key: <api-key>'import requests
url = "https://api.nekt.ai/api/v1/permission-recipients/"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.nekt.ai/api/v1/permission-recipients/', 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/permission-recipients/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/permission-recipients/"
req, _ := http.NewRequest("GET", 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.get("https://api.nekt.ai/api/v1/permission-recipients/")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nekt.ai/api/v1/permission-recipients/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"groups": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"users": [
123
]
}Catalog
List Permission Recipients
The users and groups that can receive a Catalog grant.
GET
/
api
/
v1
/
permission-recipients
/
List permission recipients
curl --request GET \
--url https://api.nekt.ai/api/v1/permission-recipients/ \
--header 'x-api-key: <api-key>'import requests
url = "https://api.nekt.ai/api/v1/permission-recipients/"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.nekt.ai/api/v1/permission-recipients/', 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/permission-recipients/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/permission-recipients/"
req, _ := http.NewRequest("GET", 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.get("https://api.nekt.ai/api/v1/permission-recipients/")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nekt.ai/api/v1/permission-recipients/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"groups": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"users": [
123
]
}Assigning a permission requires the integer id of a user or the UUID of a permission group, and this is the endpoint that provides them, filtered to who can still be granted on a given resource. To read or manage groups themselves, use Permission groups.
A resource id that does not exist, or that your API key cannot see, returns
Pass
Only members are returned
The response contains active and pending Members. A pending member is someone who has been invited but has not yet accepted: you can grant them access ahead of time, and it takes effect once they join. Owners and Admins are deliberately absent: they bypass data-level permissions entirely, so a grant to them would change nothing. If you are looking for a colleague and cannot find them here, check their role first. Deactivated members are absent too. They were switched off on purpose, and a grant to them would be access nobody asked to restore.Query parameters
| Parameter | Type | Description |
|---|---|---|
layer | UUID | Recipients who do not already hold a direct grant on this layer. |
folder | UUID | Recipients who do not already hold a direct grant on this folder. |
table | UUID | Recipients who do not already hold a direct grant on this table. |
volume | UUID | Recipients who do not already hold a direct grant on this volume. |
search | string | Match users by name, username, or email, and groups by name or description. |
expand[] | string | users, groups, or both. See Expanding Responses. |
Passing a resource excludes recipients holding a direct grant on that exact resource. Access
inherited through a group or a parent layer or folder does not exclude them. This is picker
semantics: the list answers “who can still be added”, never “who has access”. To read existing
access, use List Permissions instead. Without a resource
parameter you get every eligible member and group.
400 rather than an empty list, so a typo fails loudly instead of looking like “nobody available”.
Response
By default the endpoint returns bare id lists:{
"groups": ["b8c5e1e3-6d02-4f45-ad20-8f4b6e2d0e13"],
"users": [42]
}
expand[] to get full objects instead, which is what you want when you need to match people by email:
curl --request GET \
--url "https://api.nekt.ai/api/v1/permission-recipients/?expand[]=users&expand[]=groups" \
--header "x-api-key: YOUR_API_KEY"
Find a person by email, then grant
import requests
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.nekt.ai"
TARGET_EMAIL = "analyst@example.com"
TABLE_ID = "a7b4f0d2-5c91-4e34-9c1f-7e3a5f1c9d02"
headers = {"x-api-key": API_KEY, "Content-Type": "application/json"}
recipients = requests.get(
f"{BASE_URL}/api/v1/permission-recipients/",
headers=headers,
params={"expand[]": "users", "search": TARGET_EMAIL},
).json()
if not recipients["users"]:
raise SystemExit(f"{TARGET_EMAIL} is not an eligible grant recipient in this workspace.")
requests.post(
f"{BASE_URL}/api/v1/permissions/",
headers=headers,
json={
"assignments": [
{
"permission_level": "viewer",
"users": [recipients["users"][0]["id"]],
"tables": [TABLE_ID],
}
]
},
)
Related
- Assign Permissions: what to do with the ids.
- List Object Permission Recipients: the equivalent for secrets and live connections.
Authorizations
API Key authentication. Format: 'x-api-key: api_key'
Query Parameters
Only recipients who can still be granted on this folder.
Only recipients who can still be granted on this layer.
Match users by name, username or email, and groups by name or description.
Only recipients who can still be granted on this table.
Only recipients who can still be granted on this volume.
Was this page helpful?