Enable knowledge for one enrolled workspace
curl --request PATCH \
--url https://api.pyai.com/v1/managed-tenants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_workspace_id": "<string>",
"child_org_id": "<string>",
"project_id": "<string>",
"key_id": "<string>",
"capability": "knowledge"
}
'import requests
url = "https://api.pyai.com/v1/managed-tenants"
payload = {
"external_workspace_id": "<string>",
"child_org_id": "<string>",
"project_id": "<string>",
"key_id": "<string>",
"capability": "knowledge"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_workspace_id: '<string>',
child_org_id: '<string>',
project_id: '<string>',
key_id: '<string>',
capability: 'knowledge'
})
};
fetch('https://api.pyai.com/v1/managed-tenants', 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.pyai.com/v1/managed-tenants",
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([
'external_workspace_id' => '<string>',
'child_org_id' => '<string>',
'project_id' => '<string>',
'key_id' => '<string>',
'capability' => 'knowledge'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.pyai.com/v1/managed-tenants"
payload := strings.NewReader("{\n \"external_workspace_id\": \"<string>\",\n \"child_org_id\": \"<string>\",\n \"project_id\": \"<string>\",\n \"key_id\": \"<string>\",\n \"capability\": \"knowledge\"\n}")
req, _ := http.NewRequest("PATCH", 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))
}HttpResponse<String> response = Unirest.patch("https://api.pyai.com/v1/managed-tenants")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_workspace_id\": \"<string>\",\n \"child_org_id\": \"<string>\",\n \"project_id\": \"<string>\",\n \"key_id\": \"<string>\",\n \"capability\": \"knowledge\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/v1/managed-tenants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_workspace_id\": \"<string>\",\n \"child_org_id\": \"<string>\",\n \"project_id\": \"<string>\",\n \"key_id\": \"<string>\",\n \"capability\": \"knowledge\"\n}"
response = http.request(request)
puts response.read_body{
"external_workspace_id": "<string>",
"child_org_id": "<string>",
"project_id": "<string>",
"key_id": "<string>",
"capability": "knowledge",
"object": "managed_tenant_capability",
"version": "managed-tenant/v1",
"operation_id": "<string>",
"parent_org_id": "<string>",
"payer_org_id": "<string>",
"enabled": true,
"scopes": [
"<string>"
]
}Identity
Enable knowledge for one enrolled workspace
The exact active registered parent must be authorized for managed knowledge. Adds only kb:manage to the existing active live key bound to the supplied workspace, child organization and project. An identical retry is safe and repairs key projection if needed. Returns current scopes without credential material.
PATCH
/
v1
/
managed-tenants
Enable knowledge for one enrolled workspace
curl --request PATCH \
--url https://api.pyai.com/v1/managed-tenants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_workspace_id": "<string>",
"child_org_id": "<string>",
"project_id": "<string>",
"key_id": "<string>",
"capability": "knowledge"
}
'import requests
url = "https://api.pyai.com/v1/managed-tenants"
payload = {
"external_workspace_id": "<string>",
"child_org_id": "<string>",
"project_id": "<string>",
"key_id": "<string>",
"capability": "knowledge"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_workspace_id: '<string>',
child_org_id: '<string>',
project_id: '<string>',
key_id: '<string>',
capability: 'knowledge'
})
};
fetch('https://api.pyai.com/v1/managed-tenants', 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.pyai.com/v1/managed-tenants",
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([
'external_workspace_id' => '<string>',
'child_org_id' => '<string>',
'project_id' => '<string>',
'key_id' => '<string>',
'capability' => 'knowledge'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.pyai.com/v1/managed-tenants"
payload := strings.NewReader("{\n \"external_workspace_id\": \"<string>\",\n \"child_org_id\": \"<string>\",\n \"project_id\": \"<string>\",\n \"key_id\": \"<string>\",\n \"capability\": \"knowledge\"\n}")
req, _ := http.NewRequest("PATCH", 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))
}HttpResponse<String> response = Unirest.patch("https://api.pyai.com/v1/managed-tenants")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_workspace_id\": \"<string>\",\n \"child_org_id\": \"<string>\",\n \"project_id\": \"<string>\",\n \"key_id\": \"<string>\",\n \"capability\": \"knowledge\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/v1/managed-tenants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_workspace_id\": \"<string>\",\n \"child_org_id\": \"<string>\",\n \"project_id\": \"<string>\",\n \"key_id\": \"<string>\",\n \"capability\": \"knowledge\"\n}"
response = http.request(request)
puts response.read_body{
"external_workspace_id": "<string>",
"child_org_id": "<string>",
"project_id": "<string>",
"key_id": "<string>",
"capability": "knowledge",
"object": "managed_tenant_capability",
"version": "managed-tenant/v1",
"operation_id": "<string>",
"parent_org_id": "<string>",
"payer_org_id": "<string>",
"enabled": true,
"scopes": [
"<string>"
]
}Authorizations
apiKeyxApiKey
Body
application/json
Response
The current knowledge capability for the original key.