> 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/zec/instance/placement-group/describeplacementgroups.md).

# DescribePlacementGroups

## 1. API Description

This API (DescribePlacementGroups) is used to query information of one or more placement groups. Users can query detailed placement group information by placement group ID, name, availability zone, and other criteria.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name    | Required | Type            | Description                                                                                                                                                                               |
| ----------------- | -------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| placementGroupIds | No       | Array of String | <p>Filter by placement group ID list.</p><p>Up to 100 IDs are supported per query.</p>                                                                                                    |
| name              | No       | String          | <p>Filter by placement group name.</p><p>Fuzzy matching is supported.</p>                                                                                                                 |
| zoneId            | No       | String          | <p>Filter by the availability zone that the placement group belongs to.</p><p>It can be obtained by calling <a href="/api-reference/zec/location/describezones.md">DescribeZones</a>.</p> |
| pageSize          | No       | Integer         | <p>Page size for the response.</p><p>Defaults to 20, maximum is 1000.</p>                                                                                                                 |
| pageNum           | No       | Integer         | <p>Page number.</p><p>Default value: 1</p>                                                                                                                                                |
| resourceGroupId   | No       | String          | Filter by resource group ID.                                                                                                                                                              |

## 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> |
| totalCount     | Integer                                                                               | Total number of data that meets the conditions.                                                                       |
| dataSet        | Array of [PlacementGroupInfo](/api-reference/zec/datastructure.md#placementgroupinfo) | Placement group result set.                                                                                           |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**1. Query the placement group list.**

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

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

Response：
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
    "totalCount": 1,
    "dataSet": [
      {
        "placementGroupId": "placementgroup-xxxxxxxx",
        "name": "my-placement-group",
        "zoneId": "asia-east-1a",
        "partitionNum": 3,
        "affinity": 1,
        "instanceCount": 2,
        "instanceIds": [
          "vm-xxxxxxxx",
          "vm-yyyyyyyy"
        ],
        "createTime": "2026-03-26T08:00:00Z",
        "resourceGroup": {
          "resourceGroupId": "xxxxxxxx",
          "resourceGroupName": "default"
        },
        "tags": {}
      }
    ]
  }
}
```

{% 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 |
| ---------------- | ---------- | ----------- |
