View role audit events¶
View a specified role’s operations in chronological order. You can filter by operation, actor, or result.
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/iam/roles/{role_id}/audit-events
Preparation before calling¶
First select the role. Keep the cursor returned by the previous page if you need to continue reading. Prepare a personal access token with access to the target workspace and the target workspace ID.
Request parameters¶
curl -G "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/iam/roles/$ROLE_ID/audit-events" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
--data-urlencode "limit=20"
Path parameters
Parameter |
Type |
Required |
Description |
|---|---|---|---|
workspace_id |
string |
Yes |
Target workspace ID. |
role_id |
string |
Yes |
Target role ID. |
Query parameters
Parameter |
Type |
Required |
Description |
|---|---|---|---|
cursor |
string |
No |
Cursor returned by the previous page. |
limit |
integer |
No |
Items per page. Default: |
operation |
string |
No |
Filters by operation type. |
actor |
string |
No |
Filters by actor principal ID. |
status |
string |
No |
Filters by audit-event status. |
When data.next_cursor is not empty, use it as cursor for the next request and retain the other filters. Stop when data.next_cursor is empty.
Successful response¶
On success, returns structured role audit events for the current page and the next-page cursor.
{"code": "OK", "msg": "OK", "data": {"events": [], "next_cursor": "", "request_id": "req-001", "trace_id": "trace-001"}}
Field |
Type |
Description |
|---|---|---|
code |
string |
|
msg |
string |
|
data.events |
object[] |
Role audit events on the current page. |
data.next_cursor |
string |
Cursor for the next page; empty when there is no next page. |
data.request_id |
string |
Request correlation ID. |
data.trace_id |
string |
Trace ID. |
Error response¶
{"code": "ErrParamInvalid", "msg": "请求参数无效", "data": null}
Field |
Type |
Description |
|---|---|---|
code |
string |
Error code. |
msg |
string |
Error message. |
data |
null |
— |