> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/platform-service/zls/audit-logs/describelogs.md).

# DescribeLogs

## 1. API Description

This API (DescribeLogs) is used to query the audit log list.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name | Required | Type             | Description                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| -------------- | -------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| startTime      | Yes      | String           | <p>Start time.</p><p>Time format: yyyy-MM-ddTHH<span data-gb-custom-inline data-tag="emoji" data-code="1f1f2-1f1f2">🇲🇲</span>ssZ.</p>                                                                                                                                                                                                                                                                                                         |
| endTime        | Yes      | String           | <p>End time.</p><p>Time format: yyyy-MM-ddTHH<span data-gb-custom-inline data-tag="emoji" data-code="1f1f2-1f1f2">🇲🇲</span>ssZ.</p><p>The start time cannot be later than the end time. The interval between the start time and the end time cannot exceed 30 days. The start time cannot be more than 90 days ago.</p>                                                                                                                       |
| cursor         | No       | Array of Integer | <p>Cursor for the next page.</p><p>After the current page is requested, the cursor for the next page is returned in the response. To retrieve the next page, include the returned cursor in the request parameters, and repeat this process to obtain all data within the specified time range.</p><p>For example, if the current page returns "cursor": \[1691028715371], assign \[1691028715371] to cursor when requesting the next page.</p> |
| resUid         | No       | String           | Resource ID.                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| resEvent       | No       | String           | Event name.                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| clientIP       | No       | String           | Client IP address of the operation.                                                                                                                                                                                                                                                                                                                                                                                                             |
| size           | No       | Integer          | <p>Number of entries returned per page.</p><p>Default: 20. Maximum: 1000.</p><p>Value range: \[1, 1000]</p>                                                                                                                                                                                                                                                                                                                                     |

## 3. Output Parameters

| Parameter Name | Type                                                                             | Description                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| -------------- | -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| requestId      | String                                                                           | <p>The unique request ID, which is returned for each request.</p><p>RequestId is required for locating a problem.</p>                                                                                                                                                                                                                                                                                                                           |
| dataSet        | Array of [LogInfo](/api-reference/platform-service/zls/datastructure.md#loginfo) | Result set.                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| cursor         | Array of Integer                                                                 | <p>Cursor for the next page.</p><p>After the current page is requested, the cursor for the next page is returned in the response. To retrieve the next page, include the returned cursor in the request parameters, and repeat this process to obtain all data within the specified time range.</p><p>For example, if the current page returns "cursor": \[1691028715371], assign \[1691028715371] to cursor when requesting the next page.</p> |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**1. Query audit logs within a specified time range.**

```json
POST /api/v2/zls HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DescribeLogs
<Common Request Params>

Request：
{
    "startTime": "2023-07-26T16:00:00Z",
    "endTime": "2023-08-03T15:59:59Z",
    "size": 20
}

Response：
{
  "requestId": "T83B6A963-B111-4BF9-8466-1C3351E2DFD1",
  "response": {
    "requestId": "T83B6A963-B111-4BF9-8466-1C3351E2DFD1",
    "dataSet": [
      {
        "resUid": "user/*|team/123",
        "resType": "user",
        "resEvent": "switch  team",
        "opsTime": "2023-08-03T07:56:28.670Z",
        "eventSource": "CONSOLE_CALL",
        "apiVersion": "v1",
        "opsUser": "test@zenlayer.com",
        "clientIP": "10.88.61.84",
        "request": null,
        "response": "{\"msg\":\"success\",\"ret\":0,\"code\":\"SUCCESS\",\"success\":true}"
      },
      {
        "resUid": "bmi/123",
        "resType": "bmi",
        "resEvent": "rename bmi",
        "opsTime": "2023-08-03T06:52:23.008Z",
        "eventSource": "CONSOLE_CALL",
        "apiVersion": "v1",
        "opsUser": "test@zenlayer.com",
        "clientIP": "10.88.61.100",
        "request": "{\"label\":\"xxx\"}",
        "response": "{\"msg\":\"success\",\"ret\":0,\"code\":\"SUCCESS\",\"success\":true}"
      }
    ],
    "cursor": [1691028715371]
  }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](/api-reference/api-introduction/toolkit/api-sdk.md)，to make it easier for you to call APIs. More programming languages will be supported.

## 6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see [Common Error Codes](/api-reference/api-introduction/instruction/commonerrorcode.md).

| HTTP Status Code | Error Code                                   | Description                                                                                                                                                                                                        |
| ---------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 400              | INVALID\_TIME\_FORMAT                        | The time parameter format is invalid. The time parameter does not match the format: yyyy-MM-ddTHH:flag\_mm:ssZ.                                                                                                    |
| 400              | INVALID\_PARAMETER\_ILLEGAL\_TIME            | The time parameter value is invalid. The start time cannot be later than the end time. The interval between the start time and the end time cannot exceed 30 days. The start time cannot be more than 90 days ago. |
| 400              | INVALID\_PARAMETER\_\_TEAM\_CANNOT\_BE\_NULL | The team ID cannot be empty.                                                                                                                                                                                       |
