Skip to main content

List AI logs API

List AI logs API. GET /api/openapi/v1/ai-logs, scope admin.v1.ai-logs.read.

  • Scope: admin.v1.ai-logs.read
  • GET/api/openapi/v1/ai-logs
Reads logs for the authenticated application organization under its explicitly granted sensitive scope, independently of application member scope. User, AI and administrator log scopes do not imply one another. Business fields, filters and responses match the Console. List/export windows span at most seven calendar days. User log retention is 90 days for VPC and 180 days for K8S; AI log retention is 90 days. The server clips windows to retention and returns effective_from/effective_to on lists.

Common request headers

Apply the “Authentication and headers” section in “Configure the QwenWork console through APIs”: Authorization is required and X-Request-Id is optional. See this page for the required scope. Whether Idempotency-Key applies and is required is specified in this page’s request parameters; a tracing identifier does not replace an idempotency key.

Request parameters

NameLocationTypeRequiredDescriptionExample
user_namequerystringNoUser name filter; maxLength=200-
auxiliary_identifierquerystringNoAuxiliary identity type; paired with auxiliary_value; maxLength=200-
auxiliary_valuequerystringNoAuxiliary identity value; requires type EMAIL, PHONE, EMPLOYEE_NO or ACCOUNT; maxLength=200-
session_idquerystringNoSession ID; omitted for user logs when not collected; maxLength=200-
turn_idquerystringNoTurn ID; maxLength=200-
conversation_titlequerystringNoConversation title; maxLength=200-
qquerystringNoSearch keyword; maxLength=200-
resultquerystringNoExecution result; Values: "success", "failure"-
rangequerystringNoDefaults to the latest seven calendar days; ignored when from/to are supplied; default="last7"; Values: "last7"-
fromquerystring · date-timeNoStart time; must be paired with to, spanning at most seven calendar days-
toquerystring · date-timeNoEnd time; must follow from; window is clipped to Console retention-
department_idquerystring · uuidNoDepartment ID filter-
pagequeryinteger · int64NoPage number, starting at 1; minimum=1; default=1-
page_sizequeryinteger · int64NoPage size; default=20; Values: 10, 20, 50, 100-
timezonequerystringNoIANA timezone; defaults to UTC; maxLength=64-

Response statuses

HTTP statusTriggerResponse structureClient action
200SuccessSee “Response” on this pageRead the result.
401Authentication failedSee “General error” in “Configure the QwenWork console through APIs”Check status and code; correct parameters or grants; retry 503 later.
403Missing scope or invalid trusted identitySee “General error” in “Configure the QwenWork console through APIs”Check status and code; correct parameters or grants; retry 503 later.
422Invalid field or time windowSee “General error” in “Configure the QwenWork console through APIs”Check status and code; correct parameters or grants; retry 503 later.
503Upstream or audit dependency unavailableSee “General error” in “Configure the QwenWork console through APIs”Check status and code; correct parameters or grants; retry 503 later.
defaultOther authentication, business or dependency errorsSee “General error” in “Configure the QwenWork console through APIs”Check status and code; correct parameters or grants; retry 503 later.

Response

Content-Type: application/json
NameTypeRequiredDescriptionExample
effective_fromstring · date-timeYesEffective query start time-
effective_tostring · date-timeYesEffective query end time-
itemsarray\<object\>YesResults; empty array when no records match-
pageinteger · int64YesPage number, starting at 1-
page_sizeinteger · int64YesPage size-
totalinteger · int64YesTotal matching records-

items[]

FieldTypeRequiredDescription
actionstringYesAction type
dataobjectYesLog detail data; omitted for user logs when not collected
department_id_snapshotstring · uuidNoPrimary department ID snapshot; omitted when unavailable
department_name_snapshotstringNoPrimary department name snapshot; omitted when unavailable
department_path_snapshotstringNoPrimary department path snapshot; omitted when unavailable
department_snapshotsarray\<object\>NoAll department snapshots at event time; omitted when unavailable
event_idstring · uuidYesEvent ID
event_namestringNoEvent name; omitted when empty
event_timestring · date-timeYesEvent occurrence time
event_typestringYesEvent type; user operation type for user logs, ai.turn for AI logs; Values: "ai.turn"
resultstringYesExecution result; Values: "success", "failure"
session_idstringYesSession ID; omitted for user logs when not collected
sourcestringYesEvent source; Values: "pc"
source_ipstringYesSource IP
turn_idstringYesTurn ID
user_email_snapshotstring | nullYesEmail snapshot at event time; may be null
user_idstring · uuidYesUser ID
user_name_snapshotstringYesUser name snapshot at event time

items[].data

FieldTypeRequiredDescription
artifactsarray\<string\>YesArtifacts; empty array when there are no artifacts
callsarray\<object\>YesCall details; empty array when there are no calls
conversation_titlestringYesConversation title
extensionsobjectYesEvent extensions; preserves current UI extension keys and values
modelstringYesModel used
uploaded_file_namesarray\<string\>NoAttachment names for this turn; omitted when not collected, empty array means no attachments; preserves order and duplicates; maxItems=100

items[].data.calls[]

FieldTypeRequiredDescription
namestringYesName
resultstringYesExecution result; Values: "success", "failure"
typestringYesCall type; Values: "skill", "connector", "plugin"

items[].department_snapshots[]

FieldTypeRequiredDescription
idstring · uuidYesIdentifier
namestringYesName
pathstringYesDepartment path

Response example

An empty AI event_name is omitted; the example shows a non-empty name.