Client Query Access Logs
curl --request PUT \
--url https://agents-api.kolena.com/api/v1/client/access-logs/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"time_range": {
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z"
},
"filters": {
"users": [
"<string>"
],
"client_ips": [
"<string>"
]
},
"page_size": 100,
"cursor": "<string>"
}
'import requests
url = "https://agents-api.kolena.com/api/v1/client/access-logs/query"
payload = {
"time_range": {
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z"
},
"filters": {
"users": ["<string>"],
"client_ips": ["<string>"]
},
"page_size": 100,
"cursor": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
time_range: {start_time: '2023-11-07T05:31:56Z', end_time: '2023-11-07T05:31:56Z'},
filters: {users: ['<string>'], client_ips: ['<string>']},
page_size: 100,
cursor: '<string>'
})
};
fetch('https://agents-api.kolena.com/api/v1/client/access-logs/query', 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://agents-api.kolena.com/api/v1/client/access-logs/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'time_range' => [
'start_time' => '2023-11-07T05:31:56Z',
'end_time' => '2023-11-07T05:31:56Z'
],
'filters' => [
'users' => [
'<string>'
],
'client_ips' => [
'<string>'
]
],
'page_size' => 100,
'cursor' => '<string>'
]),
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://agents-api.kolena.com/api/v1/client/access-logs/query"
payload := strings.NewReader("{\n \"time_range\": {\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n },\n \"filters\": {\n \"users\": [\n \"<string>\"\n ],\n \"client_ips\": [\n \"<string>\"\n ]\n },\n \"page_size\": 100,\n \"cursor\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://agents-api.kolena.com/api/v1/client/access-logs/query")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"time_range\": {\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n },\n \"filters\": {\n \"users\": [\n \"<string>\"\n ],\n \"client_ips\": [\n \"<string>\"\n ]\n },\n \"page_size\": 100,\n \"cursor\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agents-api.kolena.com/api/v1/client/access-logs/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"time_range\": {\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n },\n \"filters\": {\n \"users\": [\n \"<string>\"\n ],\n \"client_ips\": [\n \"<string>\"\n ]\n },\n \"page_size\": 100,\n \"cursor\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"total_events": 123,
"events": [
{
"timestamp_millis": 123,
"workspace_id": 123,
"user": "<string>",
"operation": "<string>",
"client_ip": "<string>",
"http_path": "<string>",
"http_method": "<string>",
"http_status": 123,
"metadata": {}
}
],
"next_cursor": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Access Logs
Query Access Logs
Query access logs
Client Query Access Logs
curl --request PUT \
--url https://agents-api.kolena.com/api/v1/client/access-logs/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"time_range": {
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z"
},
"filters": {
"users": [
"<string>"
],
"client_ips": [
"<string>"
]
},
"page_size": 100,
"cursor": "<string>"
}
'import requests
url = "https://agents-api.kolena.com/api/v1/client/access-logs/query"
payload = {
"time_range": {
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z"
},
"filters": {
"users": ["<string>"],
"client_ips": ["<string>"]
},
"page_size": 100,
"cursor": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
time_range: {start_time: '2023-11-07T05:31:56Z', end_time: '2023-11-07T05:31:56Z'},
filters: {users: ['<string>'], client_ips: ['<string>']},
page_size: 100,
cursor: '<string>'
})
};
fetch('https://agents-api.kolena.com/api/v1/client/access-logs/query', 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://agents-api.kolena.com/api/v1/client/access-logs/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'time_range' => [
'start_time' => '2023-11-07T05:31:56Z',
'end_time' => '2023-11-07T05:31:56Z'
],
'filters' => [
'users' => [
'<string>'
],
'client_ips' => [
'<string>'
]
],
'page_size' => 100,
'cursor' => '<string>'
]),
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://agents-api.kolena.com/api/v1/client/access-logs/query"
payload := strings.NewReader("{\n \"time_range\": {\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n },\n \"filters\": {\n \"users\": [\n \"<string>\"\n ],\n \"client_ips\": [\n \"<string>\"\n ]\n },\n \"page_size\": 100,\n \"cursor\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://agents-api.kolena.com/api/v1/client/access-logs/query")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"time_range\": {\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n },\n \"filters\": {\n \"users\": [\n \"<string>\"\n ],\n \"client_ips\": [\n \"<string>\"\n ]\n },\n \"page_size\": 100,\n \"cursor\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agents-api.kolena.com/api/v1/client/access-logs/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"time_range\": {\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n },\n \"filters\": {\n \"users\": [\n \"<string>\"\n ],\n \"client_ips\": [\n \"<string>\"\n ]\n },\n \"page_size\": 100,\n \"cursor\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"total_events": 123,
"events": [
{
"timestamp_millis": 123,
"workspace_id": 123,
"user": "<string>",
"operation": "<string>",
"client_ip": "<string>",
"http_path": "<string>",
"http_method": "<string>",
"http_status": 123,
"metadata": {}
}
],
"next_cursor": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
} This is available on the Enterprise Plan. Contact Kolena if you’re not on an Enterprise plan but would like to try this feature.
Rate Limit: This endpoint is limited to requests per minute per user.
Authorizations
Bearer authentication header of the form Bearer <token>. The <token> represents your API key, which must be acquired from the Kolena platform.
Body
application/json
Was this page helpful?
⌘I
