cURL
curl --request PATCH \
--url https://api.nekt.ai/api/v1/organization/object-permissions/{id}/ \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"tool_scope": "<unknown>"
}
'import requests
url = "https://api.nekt.ai/api/v1/organization/object-permissions/{id}/"
payload = { "tool_scope": "<unknown>" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({tool_scope: '<unknown>'})
};
fetch('https://api.nekt.ai/api/v1/organization/object-permissions/{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/object-permissions/{id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'tool_scope' => '<unknown>'
]),
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/object-permissions/{id}/"
payload := strings.NewReader("{\n \"tool_scope\": \"<unknown>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.nekt.ai/api/v1/organization/object-permissions/{id}/")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tool_scope\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nekt.ai/api/v1/organization/object-permissions/{id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tool_scope\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"permission_level": "manager",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"user": "<string>",
"group": "<string>",
"secret": "<string>",
"live_connection": "<string>",
"granted_by": "<string>",
"tool_scope": "<unknown>"
}Secrets & live connections
Update Object Permission
Change the level or the tool scope of a single grant.
PATCH
/
api
/
v1
/
organization
/
object-permissions
/
{id}
/
cURL
curl --request PATCH \
--url https://api.nekt.ai/api/v1/organization/object-permissions/{id}/ \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"tool_scope": "<unknown>"
}
'import requests
url = "https://api.nekt.ai/api/v1/organization/object-permissions/{id}/"
payload = { "tool_scope": "<unknown>" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({tool_scope: '<unknown>'})
};
fetch('https://api.nekt.ai/api/v1/organization/object-permissions/{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/object-permissions/{id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'tool_scope' => '<unknown>'
]),
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/object-permissions/{id}/"
payload := strings.NewReader("{\n \"tool_scope\": \"<unknown>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.nekt.ai/api/v1/organization/object-permissions/{id}/")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tool_scope\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nekt.ai/api/v1/organization/object-permissions/{id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tool_scope\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"permission_level": "manager",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"user": "<string>",
"group": "<string>",
"secret": "<string>",
"live_connection": "<string>",
"granted_by": "<string>",
"tool_scope": "<unknown>"
}Two fields are writable:
Setting
permission_level, and tool_scope for live-connection grants.
curl --request PATCH \
--url https://api.nekt.ai/api/v1/organization/object-permissions/6f2a9c4b-2a10-4e7f-9c54-d2a9b1d28b0e/ \
--header "x-api-key: YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{"tool_scope": ["search_contacts", "get_contact"]}'
Raising a live-connection grant to
manager clears its tool_scope. A manager sees the connection’s full available tool set by definition, so the two cannot coexist — sending both in the same request returns 400.tool_scope on a secret grant returns 400: the field applies to live connections only.
Related
- Permissions flow — where tool scoping fits in the wider model.
Authorizations
API Key authentication. Format: 'x-api-key: api_key'
Path Parameters
A UUID string identifying this Object permission.
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
A grant of access to a secret or a live connection.
manager- Managereditor- Editorviewer- Viewer
Available options:
manager, editor, viewer Live connections only: subset of the connection's available tools this access may use (NULL = the full available set, tracking it as it changes; MANAGER grants are always NULL)
Response
200 - application/json
A grant of access to a secret or a live connection.
manager- Managereditor- Editorviewer- Viewer
Available options:
manager, editor, viewer User (Expandable)
Group (Expandable)
Secret (Expandable)
Live connection (Expandable)
Granted by (Expandable)
Live connections only: subset of the connection's available tools this access may use (NULL = the full available set, tracking it as it changes; MANAGER grants are always NULL)
Was this page helpful?