資源
列出審計事件
查詢不可篡改的審計追蹤記錄。
GET
/
api
/
v1
/
audit
列出審計事件
curl --request GET \
--url https://api.example.com/api/v1/auditimport requests
url = "https://api.example.com/api/v1/audit"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/audit', 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://api.example.com/api/v1/audit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.example.com/api/v1/audit"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/audit")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/audit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": "<string>",
"action": "<string>",
"entityType": "<string>",
"entityId": "<string>",
"userId": "<string>",
"timestamp": "<string>",
"inputSummary": {},
"outputSummary": {}
}查詢不可篡改的審計追蹤記錄。每一次 API 操作(補全、技能安裝、密鑰操作等)都會連同完整上下文一起被記錄。
身份驗證
需要攜帶 Bearer 令牌。參見 身份驗證。請求示例
curl https://www.hitheo.ai/api/v1/audit \
-H "Authorization: Bearer $THEO_API_KEY"
響應
返回一個審計事件對象數組。每個事件包含:string
事件 ID。
string
執行的操作(例如
"completion.created"、"skill.installed"、"key.created")。string
受影響的實體類型(例如
"completion"、"skill"、"api_key")。string
受影響實體的 ID。
string
執行該操作的用戶。
string
ISO 8601 格式的時間戳。
object
請求輸入的摘要。
object
響應輸出的摘要。
審計事件存儲於防篡改的只追加日誌中,無法被修改或刪除。
端點
GET /api/v1/audit
需要通過 Bearer 令牌進行身份驗證。參見 身份驗證。這個頁面有幫助嗎?
列出審計事件
curl --request GET \
--url https://api.example.com/api/v1/auditimport requests
url = "https://api.example.com/api/v1/audit"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/audit', 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://api.example.com/api/v1/audit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.example.com/api/v1/audit"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/audit")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/audit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": "<string>",
"action": "<string>",
"entityType": "<string>",
"entityId": "<string>",
"userId": "<string>",
"timestamp": "<string>",
"inputSummary": {},
"outputSummary": {}
}