Get worker access
curl --request GET \
--url https://{workspace}.klef.ai/api/workers/{id}/access \
--cookie klef.session=import requests
url = "https://{workspace}.klef.ai/api/workers/{id}/access"
headers = {"cookie": "klef.session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'klef.session='}};
fetch('https://{workspace}.klef.ai/api/workers/{id}/access', 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://{workspace}.klef.ai/api/workers/{id}/access",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "klef.session=",
]);
$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://{workspace}.klef.ai/api/workers/{id}/access"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "klef.session=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{workspace}.klef.ai/api/workers/{id}/access")
.header("cookie", "klef.session=")
.asString();require 'uri'
require 'net/http'
url = URI("https://{workspace}.klef.ai/api/workers/{id}/access")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = 'klef.session='
response = http.request(request)
puts response.read_body{
"result": [
{
"connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"connectionName": "<string>",
"connector": "<string>",
"externalId": "<string>",
"displayHandle": "<string>",
"inRoster": true,
"userTrait": {
"accountType": "human",
"status": "enabled",
"lastLogin": "2023-11-07T05:31:56Z",
"mfaEnabled": true,
"ssoEnabled": true,
"emails": [
"<string>"
],
"employeeIds": [
"<string>"
]
},
"read": {
"readAt": "2023-11-07T05:31:56Z",
"readError": {
"code": "details_unavailable",
"params": {},
"causes": "<array>"
},
"principalsReadAt": "2023-11-07T05:31:56Z",
"principalsError": {
"code": "details_unavailable",
"params": {},
"causes": "<array>"
}
},
"entitlements": [
{
"entitlement": {
"entitlementField": "<string>",
"fieldLabel": "<string>",
"value": "<string>",
"label": "<string>",
"listed": true,
"resource": {
"id": "<string>",
"label": "<string>",
"parent": null,
"description": "<string>",
"externalLink": "<string>"
},
"description": "<string>",
"purpose": "<string>",
"scopeBinding": {
"role": {
"id": "<string>",
"label": "<string>",
"parent": null,
"description": "<string>",
"externalLink": "<string>"
},
"scope": {
"id": "<string>",
"label": "<string>",
"parent": null,
"description": "<string>",
"externalLink": "<string>"
}
},
"principalKind": "<string>"
},
"isDirect": true,
"sources": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "<string>",
"externalId": "<string>",
"label": "<string>"
}
],
"owners": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
]
}
]
}
],
"errors": [
{
"code": "details_unavailable",
"params": {},
"causes": [
{
"code": "details_unavailable",
"params": {},
"causes": "<array>"
}
],
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"code": "details_unavailable",
"params": {},
"causes": [
{
"code": "details_unavailable",
"params": {},
"causes": "<array>"
}
],
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"code": "details_unavailable",
"params": {},
"causes": [
{
"code": "details_unavailable",
"params": {},
"causes": "<array>"
}
],
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"code": "details_unavailable",
"params": {},
"causes": [
{
"code": "details_unavailable",
"params": {},
"causes": "<array>"
}
],
"target": "<string>"
}
]
}Workers
Get worker access
GET
/
workers
/
{id}
/
access
Get worker access
curl --request GET \
--url https://{workspace}.klef.ai/api/workers/{id}/access \
--cookie klef.session=import requests
url = "https://{workspace}.klef.ai/api/workers/{id}/access"
headers = {"cookie": "klef.session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'klef.session='}};
fetch('https://{workspace}.klef.ai/api/workers/{id}/access', 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://{workspace}.klef.ai/api/workers/{id}/access",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "klef.session=",
]);
$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://{workspace}.klef.ai/api/workers/{id}/access"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "klef.session=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{workspace}.klef.ai/api/workers/{id}/access")
.header("cookie", "klef.session=")
.asString();require 'uri'
require 'net/http'
url = URI("https://{workspace}.klef.ai/api/workers/{id}/access")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = 'klef.session='
response = http.request(request)
puts response.read_body{
"result": [
{
"connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"connectionName": "<string>",
"connector": "<string>",
"externalId": "<string>",
"displayHandle": "<string>",
"inRoster": true,
"userTrait": {
"accountType": "human",
"status": "enabled",
"lastLogin": "2023-11-07T05:31:56Z",
"mfaEnabled": true,
"ssoEnabled": true,
"emails": [
"<string>"
],
"employeeIds": [
"<string>"
]
},
"read": {
"readAt": "2023-11-07T05:31:56Z",
"readError": {
"code": "details_unavailable",
"params": {},
"causes": "<array>"
},
"principalsReadAt": "2023-11-07T05:31:56Z",
"principalsError": {
"code": "details_unavailable",
"params": {},
"causes": "<array>"
}
},
"entitlements": [
{
"entitlement": {
"entitlementField": "<string>",
"fieldLabel": "<string>",
"value": "<string>",
"label": "<string>",
"listed": true,
"resource": {
"id": "<string>",
"label": "<string>",
"parent": null,
"description": "<string>",
"externalLink": "<string>"
},
"description": "<string>",
"purpose": "<string>",
"scopeBinding": {
"role": {
"id": "<string>",
"label": "<string>",
"parent": null,
"description": "<string>",
"externalLink": "<string>"
},
"scope": {
"id": "<string>",
"label": "<string>",
"parent": null,
"description": "<string>",
"externalLink": "<string>"
}
},
"principalKind": "<string>"
},
"isDirect": true,
"sources": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "<string>",
"externalId": "<string>",
"label": "<string>"
}
],
"owners": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
]
}
]
}
],
"errors": [
{
"code": "details_unavailable",
"params": {},
"causes": [
{
"code": "details_unavailable",
"params": {},
"causes": "<array>"
}
],
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"code": "details_unavailable",
"params": {},
"causes": [
{
"code": "details_unavailable",
"params": {},
"causes": "<array>"
}
],
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"code": "details_unavailable",
"params": {},
"causes": [
{
"code": "details_unavailable",
"params": {},
"causes": "<array>"
}
],
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"code": "details_unavailable",
"params": {},
"causes": [
{
"code": "details_unavailable",
"params": {},
"causes": "<array>"
}
],
"target": "<string>"
}
]
}Authorizations
cookieAuthapiKeyAuth
Cookie-based session. Obtain by completing the /auth/login/{provider} OAuth flow; the /auth/callback response sets the klef.session cookie that subsequent requests send automatically.
Path Parameters
Was this page helpful?