TypeScript (SDK)
import { Textql } from "@textql/sdk";
const textql = new Textql({
apiKey: process.env["TEXTQL_API_KEY"] ?? "",
});
async function run() {
const result = await textql.rbac.whoAmI({
body: {},
});
console.log(result);
}
run();import os
from textql_sdk import Textql
with Textql(
api_key=os.getenv("TEXTQL_API_KEY", ""),
) as textql:
res = textql.rbac.who_am_i(body={})
# Handle response
print(res)curl --request POST \
--url https://app.textql.com/textql.rpc.public.rbac.RBACService/WhoAmI \
--header 'Connect-Protocol-Version: <connect-protocol-version>' \
--header 'Content-Type: application/json' \
--header 'tql_api_key: <api-key>' \
--data '{}'const options = {
method: 'POST',
headers: {
'Connect-Protocol-Version': '<connect-protocol-version>',
tql_api_key: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
};
fetch('https://app.textql.com/textql.rpc.public.rbac.RBACService/WhoAmI', 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://app.textql.com/textql.rpc.public.rbac.RBACService/WhoAmI",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Connect-Protocol-Version: <connect-protocol-version>",
"Content-Type: application/json",
"tql_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://app.textql.com/textql.rpc.public.rbac.RBACService/WhoAmI"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Connect-Protocol-Version", "<connect-protocol-version>")
req.Header.Add("tql_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.post("https://app.textql.com/textql.rpc.public.rbac.RBACService/WhoAmI")
.header("Connect-Protocol-Version", "<connect-protocol-version>")
.header("tql_api_key", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.textql.com/textql.rpc.public.rbac.RBACService/WhoAmI")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Connect-Protocol-Version"] = '<connect-protocol-version>'
request["tql_api_key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"memberId": "<string>",
"orgId": "<string>",
"email": "<string>",
"credential": {
"authMethod": "<string>",
"apiKeyId": "<string>",
"apiKeyName": "<string>",
"apiKeyShort": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"assumedRoleIds": [
"<string>"
],
"clientId": "<string>",
"scopes": [
"<string>"
]
},
"roles": [
{
"id": "<string>",
"orgId": "<string>",
"name": "<string>",
"description": "<string>",
"isSystem": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"defaultModelId": 123,
"allowedModelIds": [
123
],
"allowModelChoice": true,
"isScimManaged": true
}
],
"permissions": [
{
"id": "<string>",
"resource": "<string>",
"action": "<string>",
"description": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
],
"modelAccess": {
"allowedModels": [],
"restricted": true
},
"sharedAccess": [
{
"objectType": "<string>",
"objectId": "<string>",
"accessType": "<string>",
"grantedVia": "<string>",
"roleId": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"groupId": "<string>"
}
],
"sharedAccessTruncated": true
}{
"message": "<string>",
"details": [
{
"type": "<string>",
"value": "<string>",
"debug": {}
}
]
}RBAC Service
Who Am I
Describe what a key is allowed to do.
POST
/
textql.rpc.public.rbac.RBACService
/
WhoAmI
TypeScript (SDK)
import { Textql } from "@textql/sdk";
const textql = new Textql({
apiKey: process.env["TEXTQL_API_KEY"] ?? "",
});
async function run() {
const result = await textql.rbac.whoAmI({
body: {},
});
console.log(result);
}
run();import os
from textql_sdk import Textql
with Textql(
api_key=os.getenv("TEXTQL_API_KEY", ""),
) as textql:
res = textql.rbac.who_am_i(body={})
# Handle response
print(res)curl --request POST \
--url https://app.textql.com/textql.rpc.public.rbac.RBACService/WhoAmI \
--header 'Connect-Protocol-Version: <connect-protocol-version>' \
--header 'Content-Type: application/json' \
--header 'tql_api_key: <api-key>' \
--data '{}'const options = {
method: 'POST',
headers: {
'Connect-Protocol-Version': '<connect-protocol-version>',
tql_api_key: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
};
fetch('https://app.textql.com/textql.rpc.public.rbac.RBACService/WhoAmI', 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://app.textql.com/textql.rpc.public.rbac.RBACService/WhoAmI",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Connect-Protocol-Version: <connect-protocol-version>",
"Content-Type: application/json",
"tql_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://app.textql.com/textql.rpc.public.rbac.RBACService/WhoAmI"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Connect-Protocol-Version", "<connect-protocol-version>")
req.Header.Add("tql_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.post("https://app.textql.com/textql.rpc.public.rbac.RBACService/WhoAmI")
.header("Connect-Protocol-Version", "<connect-protocol-version>")
.header("tql_api_key", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.textql.com/textql.rpc.public.rbac.RBACService/WhoAmI")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Connect-Protocol-Version"] = '<connect-protocol-version>'
request["tql_api_key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"memberId": "<string>",
"orgId": "<string>",
"email": "<string>",
"credential": {
"authMethod": "<string>",
"apiKeyId": "<string>",
"apiKeyName": "<string>",
"apiKeyShort": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"assumedRoleIds": [
"<string>"
],
"clientId": "<string>",
"scopes": [
"<string>"
]
},
"roles": [
{
"id": "<string>",
"orgId": "<string>",
"name": "<string>",
"description": "<string>",
"isSystem": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"defaultModelId": 123,
"allowedModelIds": [
123
],
"allowModelChoice": true,
"isScimManaged": true
}
],
"permissions": [
{
"id": "<string>",
"resource": "<string>",
"action": "<string>",
"description": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
],
"modelAccess": {
"allowedModels": [],
"restricted": true
},
"sharedAccess": [
{
"objectType": "<string>",
"objectId": "<string>",
"accessType": "<string>",
"grantedVia": "<string>",
"roleId": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"groupId": "<string>"
}
],
"sharedAccessTruncated": true
}{
"message": "<string>",
"details": [
{
"type": "<string>",
"value": "<string>",
"debug": {}
}
]
}Authorizations
Headers
Define the version of the Connect protocol
Available options:
1 Define the timeout, in ms
Body
application/json
Get current member roles and permissions messages
Response
Success
Which LLM models the caller may run.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
WhoAmI messages
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I