# DescribeCertificates

## 1. API Description

This API is used to query the list of certificates.

## 2. Request Parameters

The following list includes the request parameters required by the API:

| Parameter Name   | Required | Type            | Description                                                                                                              |
| ---------------- | -------- | --------------- | ------------------------------------------------------------------------------------------------------------------------ |
| certificateIds   | No       | Array of String | <p>Certificate IDs.</p><p>Supports querying up to 100 IDs.</p>                                                           |
| certificateLabel | No       | String          | Custom certificate label                                                                                                 |
| san              | No       | String          | Subject Alternative Name (domain associated with the certificate)                                                        |
| resourceGroupId  | No       | String          | <p>ID of the resource group.</p><p>If not provided, returns instances from all visible resource groups for the user.</p> |
| expired          | No       | Boolean         | Whether the certificate is expired                                                                                       |
| pageSize         | No       | Integer         | <p>Page size of the results.</p><p>Defaults to 20, maximum is 1000.</p>                                                  |
| pageNum          | No       | Integer         | <p>Page number of the results.</p><p>Defaults to 1.</p>                                                                  |

## 3. Output Parameters

| Parameter Name | Type                                                                                       | Description                                                                                              |
| -------------- | ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------- |
| requestId      | String                                                                                     | Unique request ID. Returned with every request. This request's requestId is needed when troubleshooting. |
| totalCount     | Integer                                                                                    | Total number of items that match the criteria.                                                           |
| dataSet        | Array of [CertificateInfo](/api-reference/networking/cdn/datastructure.md#certificateinfo) | Result set                                                                                               |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}

1. **Paginate query for certificate list**

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

Request:
{
  "pageNum": 1,
  "pageSize": 1
}

Response:
{
  "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
  "response": {
    "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
    "totalCount": 6,
    "dataSet": [
      {
        "certificateId": "certificateIdxxxxx",
        "certificateLabel": "certificatexxx",
        "common": "*.xx.com",
        "fingerprint": "1D7801BBE772D5DE55CBF1F88AEB41A42402DA07",
        "issuer": "TrustAsia TLS RSA CA",
        "sans": ["xx.cn"],
        "algorithm": "RSA",
        "createTime": "2023-04-19T09:11:27Z",
        "startTime": "2023-04-18T09:27:30Z",
        "endTime": "2023-07-18T09:27:30Z",
        "resourceGroupId":"xxx-xx",
        "expired": false
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

## 5. Error Codes

The following includes error codes encountered in business logic. For other error codes, see [Common Error Codes](/api-reference/api-introduction/instruction/commonerrorcode.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.console.zenlayer.com/api-reference/networking/cdn/certificate/describecertificates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
