Scopes auflisten
curl --request GET \
--url https://api.truthlocks.com/v1/scopes \
--header 'X-API-Key: <api-key>'const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.truthlocks.com/v1/scopes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/scopes"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/scopes"
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))
}[
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scope": "<string>",
"resource": "<string>",
"action": "<string>",
"display_name": "<string>",
"description": "<string>",
"category": "<string>",
"is_builtin": true,
"created_at": "2023-11-07T05:31:56Z"
}
]{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Agentensitzungen & Tools
Scopes auflisten
Alle verfügbaren Berechtigungsumfänge auflisten, einschließlich plattforminterner und mandantenspezifischer Umfänge
GET
/
v1
/
scopes
Scopes auflisten
curl --request GET \
--url https://api.truthlocks.com/v1/scopes \
--header 'X-API-Key: <api-key>'const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.truthlocks.com/v1/scopes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/scopes"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/scopes"
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))
}[
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scope": "<string>",
"resource": "<string>",
"action": "<string>",
"display_name": "<string>",
"description": "<string>",
"category": "<string>",
"is_builtin": true,
"created_at": "2023-11-07T05:31:56Z"
}
]{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Scopes auflisten
GET /v1/scopes
Gibt alle Berechtigungsbereiche zurück, die dem authentifizierten Mandanten zur Verfügung stehen. Dies umfasst plattformdefinierte integrierte Bereiche und alle vom Mandanten erstellten benutzerdefinierten Bereiche. Bereiche folgen dem resource:action-Format, das durch das MAIP-Protokoll definiert ist.
Authentifizierung
ErfordertX-API-Key Header oder Bearer JWT Token. Der Arbeitsbereich wird aus den authentifizierten Anmeldeinformationen abgeleitet; senden Sie X-Tenant-ID nicht.
Antwort
Gibt ein Array von Bereichsdefinitionsobjekten zurück.Die vollständige Scope-Zeichenfolge im Format
resource:action (z.B. "data:read",
"model:train").true für plattformdefinierte Bereiche, false für vom Mandanten erstellte benutzerdefinierte Bereiche.Beispiel
curl -G https://api.truthlocks.com/v1/scopes \
-H "X-API-Key: tl_live_..." \
-d "category=data"
Eingebaute Bereichskategorien
Die Plattform bietet über 25 integrierte Scopes in 6 Kategorien:| Kategorie | Bereiche | Beschreibung |
|---|---|---|
data | read, write, delete, * | Datenressourcenzugriff |
model | train, evaluate, deploy, attest, * | ML-Modell-Lebenszyklus |
tool | search.web, search.db, execute, * | Werkzeugaufruf |
agent | delegate, manage, inspect, * | Agent-Lebenszyklusmanagement |
admin | config, audit, billing, * | Administrative Operationen |
receipt | create, verify, revoke, * | Belegverwaltung |
Referenz zum Bereichsformat
resource:action Standard scope (e.g., "data:read")
resource:* Wildcard scope (e.g., "data:*" grants all data actions)
!resource:action Negation scope (e.g., "!data:delete" explicitly denies)
resource:sub.action Dotted sub-actions (e.g., "tool:search.web")

