# List operation logs

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

View the current identity's operation records in the current workspace by condition and page. Use the results to trace operation times, outcomes, and related resources.

```text
GET https://moi.matrixorigin.cn/newmoi/audit/logs
```

## Preparation before calling

Prepare a personal access token with access to the current workspace and the [current workspace ID](../../../../guides/ai-studio/resource-center/workspace.md#copy-a-workspace-id).

## Query parameters

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Input example

```bash
curl -G "https://moi.matrixorigin.cn/newmoi/audit/logs" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  --data-urlencode 'method=POST' \
  --data-urlencode 'result=success' \
  --data-urlencode 'start_time=2026-08-18T00:00:00Z' \
  --data-urlencode 'end_time=2026-08-18T01:00:00Z' \
  --data-urlencode 'page=1' \
  --data-urlencode 'page_size=20'
```

:::::
:::::{tab-item} Parameter description

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| operator_user_id | string | No | Do not provide this value; the API returns operation records only for the current identity. |
| method | string | No | Filters by request method. |
| result | string | No | Filters by operation outcome. Use `success` or `failed`. |
| status_code | integer | No | Filters by status code. |
| start_time | string | No | Query start time, for example `2026-08-18T00:00:00Z`. |
| end_time | string | No | Query end time, for example `2026-08-18T01:00:00Z`. |
| page | integer | No | Page number, starting from `1`. |
| page_size | integer | No | Number of records to return per page. |

### Query time and pagination

Specify a complete date, time, and time zone. If the page number is omitted or less than `1`, the API uses page `1`. If the page size is omitted or less than `1`, the API uses `20`; the maximum is `200`.

### Filter operation logs

To read the next page, keep the original filters and increase `page` by `1`. For example, to read page `2`:

```bash
curl -G "https://moi.matrixorigin.cn/newmoi/audit/logs" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  --data-urlencode 'method=POST' \
  --data-urlencode 'result=success' \
  --data-urlencode 'start_time=2026-08-18T00:00:00Z' \
  --data-urlencode 'end_time=2026-08-18T01:00:00Z' \
  --data-urlencode 'page=2' \
  --data-urlencode 'page_size=20'
```

Stop paging when the accumulated number of logs reaches the total or the current page has no records.

:::::
::::::
:::::::

## Success response

On success, the API returns operation logs. Logs are ordered by `created_at` in descending order.

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "items": [
      {
        "id": "0190e1b6-7fe3-7cc2-9d7f-f589f9d37653",
        "workspace_id": "workspace-123",
        "operator_user_id": "user-123",
        "operator_name_snapshot": "Zhang San",
        "method": "POST",
        "path": "/workflow/v2/workflow-apps",
        "route_pattern": "/workflow/v2/workflow-apps",
        "status_code": 200,
        "result": "success",
        "duration_ms": 35,
        "created_at": "2026-08-18T00:30:00Z"
      }
    ],
    "total": 1,
    "page": 1,
    "page_size": 20
  }
}
```

:::::
:::::{tab-item} Field details

| Field | Type | Description |
| --- | --- | --- |
| code | string | `OK` on success. |
| msg | string | `OK` on success. |
| data.items | object[] | Operation logs on the current page. |
| data.total | integer | Total number of logs that match the filters. |
| data.page | integer | Page number used in this response. |
| data.page_size | integer | Actual number of records per page used in this response. |
| data.items[].id | string | Log ID. |
| data.items[].workspace_id | string | Workspace ID to which the log belongs. |
| data.items[].operator_user_id | string | User ID that performed the operation. |
| data.items[].operator_name_snapshot | string | Name of the operator saved when the log was recorded. |
| data.items[].method | string | Request method. |
| data.items[].path | string | Actual request path. |
| data.items[].route_pattern | string | Route template. |
| data.items[].query_json | string | Recorded query parameters. |
| data.items[].request_body_json | string | Recorded request content. |
| data.items[].response_body_json | string | Recorded response content. |
| data.items[].status_code | integer | Status code. |
| data.items[].result | string | Operation result: `success` or `failed`. |
| data.items[].error_code | string | Error code. |
| data.items[].error_message | string | Error message. |
| data.items[].duration_ms | integer | Operation duration in milliseconds. |
| data.items[].client_ip | string | Client IP address. |
| data.items[].user_agent | string | Client identifier. |
| data.items[].request_id | string | Request ID. |
| data.items[].action_type | string | Operation type. |
| data.items[].resource_type | string | Resource type. |
| data.items[].resource_id | string | Resource ID. |
| data.items[].resource_name | string | Resource name. |
| data.items[].operation_summary | string | Operation summary. |
| data.items[].metadata_json | string | Additional information. |
| data.items[].created_at | string | Time when the log was created. |

:::::
::::::
:::::::

## Error response

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "code": "ErrParamInvalid",
  "msg": "Invalid request parameter",
  "data": null
}
```

:::::
:::::{tab-item} Field details

| Field | Type | Description |
| --- | --- | --- |
| code | string | Error code. |
| msg | string | Error message. |
| data | null | — |

:::::
::::::
:::::::

## Next steps

To first understand the number of successful and failed operations, [get the operation log overview](get-operation-log-overview.md#query-parameters).
