curl --request GET \
--url https://app.cassidyai.com/api/admin/v1/audit-logs \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.cassidyai.com/api/admin/v1/audit-logs"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.cassidyai.com/api/admin/v1/audit-logs', 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.cassidyai.com/api/admin/v1/audit-logs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://app.cassidyai.com/api/admin/v1/audit-logs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.cassidyai.com/api/admin/v1/audit-logs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.cassidyai.com/api/admin/v1/audit-logs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"nextCursor": "<string>",
"hasMore": true,
"auditLogs": [
{
"id": "<string>",
"timestamp": "<string>",
"category": "<string>",
"action": "<string>",
"operationType": "read",
"actor": {
"type": "user",
"id": "<string>",
"name": "<string>"
},
"subject": {
"type": "<string>",
"id": "<string>",
"name": "<string>"
},
"target": {
"type": "<string>",
"id": "<string>",
"name": "<string>"
},
"ipAddress": "<string>",
"details": {}
}
]
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}{
"code": "TOO_MANY_REQUESTS",
"message": "Rate limit exceeded. Retry after the Retry-After interval."
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}List audit logs
Lists your organization’s audit log events in the range, newest first by default. These are the same events as the Audit Logs page.
Each event includes
- What happened: its category, action, and operation type, such as
readorupdate - Who did it: a user, an external user, an Admin API key, or the system
- The resource it was about, and a related resource if there is one
- When it happened, the IP address, and event-specific details
Filter by category, actor, resource type and action, resource, or operation type. Page through results with cursor.
Polling mode
To send events to your SIEM or another system, use polling mode: pass order=asc and from without to, then poll with each response’s nextCursor. The cursor is always returned, even when there are no new events. Request the next page right away while hasMore is true, and wait for your next poll once it is false.
Events can take up to 2 minutes to appear, so polling never skips an event that is still being recorded.
Each call to this endpoint records an audit log export event. Those events are filtered out of results for the Admin key that made the call. Other keys and the Audit Logs page still show them.
Requires the Audit logs permission (audit_logs:read).
curl --request GET \
--url https://app.cassidyai.com/api/admin/v1/audit-logs \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.cassidyai.com/api/admin/v1/audit-logs"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.cassidyai.com/api/admin/v1/audit-logs', 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.cassidyai.com/api/admin/v1/audit-logs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://app.cassidyai.com/api/admin/v1/audit-logs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.cassidyai.com/api/admin/v1/audit-logs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.cassidyai.com/api/admin/v1/audit-logs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"nextCursor": "<string>",
"hasMore": true,
"auditLogs": [
{
"id": "<string>",
"timestamp": "<string>",
"category": "<string>",
"action": "<string>",
"operationType": "read",
"actor": {
"type": "user",
"id": "<string>",
"name": "<string>"
},
"subject": {
"type": "<string>",
"id": "<string>",
"name": "<string>"
},
"target": {
"type": "<string>",
"id": "<string>",
"name": "<string>"
},
"ipAddress": "<string>",
"details": {}
}
]
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}{
"code": "TOO_MANY_REQUESTS",
"message": "Rate limit exceeded. Retry after the Retry-After interval."
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Query Parameters
desc (the default) returns the newest events first, and asc the oldest first. Using asc with no to is polling mode, which follows new events as they arrive.
asc, desc Exclusive end of the range as an ISO 8601 timestamp. Defaults to now, except with order=asc, where leaving it out uses polling mode. The range can span at most 3 months. Events can take up to 2 minutes to appear.
Response
Successful response
Pass as cursor to get the next page. Null on the last page, except in polling mode, where it is always returned so the next request resumes from it.