Retrieve the Semantic Layer root
curl --request GET \
--url https://api.nekt.ai/api/v1/semantic-layer/catalog/ \
--header 'x-api-key: <api-key>'import requests
url = "https://api.nekt.ai/api/v1/semantic-layer/catalog/"
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/semantic-layer/catalog/', 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/semantic-layer/catalog/",
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/semantic-layer/catalog/"
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/semantic-layer/catalog/")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nekt.ai/api/v1/semantic-layer/catalog/")
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{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Semantic Layer
Read the Semantic Layer
Discover the catalog, folder, and document ids a grant can name.
GET
/
api
/
v1
/
semantic-layer
/
catalog
/
Retrieve the Semantic Layer root
curl --request GET \
--url https://api.nekt.ai/api/v1/semantic-layer/catalog/ \
--header 'x-api-key: <api-key>'import requests
url = "https://api.nekt.ai/api/v1/semantic-layer/catalog/"
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/semantic-layer/catalog/', 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/semantic-layer/catalog/",
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/semantic-layer/catalog/"
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/semantic-layer/catalog/")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nekt.ai/api/v1/semantic-layer/catalog/")
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{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Assigning a Semantic Layer permission needs the UUID of a catalog, folder, or document. Three read endpoints provide them, and an API key may call all three.
Each list is already filtered to what your key’s creator can reach, so anything it returns is a resource you may name in an assignment.
| Endpoint | Returns |
|---|---|
GET /api/v1/semantic-layer/catalog/ | The root of the tree — the coarsest resource a grant can name. |
GET /api/v1/semantic-layer/folders/ | Folders you can see, paginated. |
GET /api/v1/semantic-layer/documents/ | Documents you can see, paginated. Filter with ?folder=<id>, or ?folder=root for documents that sit outside any folder. |
These endpoints are read-only for API keys. Creating or editing Semantic Layer documents and folders through a machine credential returns
403; use the app or an MCP token for that.Walk the tree, then grant
import requests
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.nekt.ai"
GROUP = "b8c5e1e3-6d02-4f45-ad20-8f4b6e2d0e13"
headers = {"x-api-key": API_KEY, "Content-Type": "application/json"}
folders = requests.get(f"{BASE_URL}/api/v1/semantic-layer/folders/", headers=headers).json()
finance = next(f for f in folders["results"] if f["name"] == "Finance")
requests.post(
f"{BASE_URL}/api/v1/semantic-layer/permissions/",
headers=headers,
json={
"assignments": [
{"permission_level": "viewer", "groups": [GROUP], "folders": [finance["id"]]}
]
},
)
/api/v1/context-documents/ is a legacy alias of the documents endpoint, kept while internal clients migrate. It is not part of the published API — build against /api/v1/semantic-layer/documents/.Related
- Assign Semantic Layer Permissions — what to do with the ids.
- Semantic Layer — what the module is and how it is used in the app.
Was this page helpful?