Skip to main content
GET
列出组织的防护规则违规记录。
如需了解护栏的工作原理以及如何配置,请参阅 AI Guardrails 功能指南。

权限

需要使用在企业级别同时拥有 ManageEnterpriseSettings 和 ViewAccountSessions 权限的服务用户或个人访问令牌。此端点会在目标组织中检查 ViewOrgSessions 权限,该权限由 ViewAccountSessions 授予;仅拥有 ManageEnterpriseSettings 无法获得该权限。

时间过滤器

此 endpoint 支持通过 time_after 和 time_before 查询参数设置可选时间过滤器。
  • time_after 和 time_before 都是以秒为单位的 Unix 时间戳,按 UTC 解析。
  • 如果提供 time_before,则也必须提供 time_after。
  • time_after 和 time_before 之间的时间范围必须 不超过 100 天。
  • 如果未提供任何时间过滤器,API 将返回全部可用历史记录中的 guardrail 违规记录 (受分页限制) 。

授权

Authorization
string
header
必填

服务用户凭据(前缀:cog_)

路径参数

org_id
string
必填

组织 ID(前缀:org-)

示例:

"org-abc123def456"

查询参数

order
enum<string>
默认值:desc
可用选项:
asc,
desc
time_before
integer | null
time_after
integer | null
after
string | null
first
integer
默认值:100
必填范围: 1 <= x <= 200
session_id
string | null
guardrail_id
string | null

响应

成功响应

items
GuardrailViolationResponse · object[]
必填
end_cursor
string | null

用于获取下一页的游标;如果这是最后一页,则为 None。

has_next_page
boolean
默认值:false

当前页之后是否还有更多条目。

total
integer | null

可选的总记录数(可为提升性能而省略)。