> For the complete documentation index, see [llms.txt](https://reno.gitbook.io/smtp-py/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://reno.gitbook.io/smtp-py/domain/usage.md).

# List Domains

Returns a list of domains.

### Mục lục nhanh

* [Ví dụ](#vi-du)
* [Tham số](#tham-so)
* [Giá trị trả về](#gia-tri-tra-ve)

### Ví dụ

{% code title="list\_domains.py" %}

```python
from smtppy import SMTPDevClient

client = SMTPDevClient(api_key="YOUR_API_KEY")

domains = client.list_domains(is_active=True, page=1)
print(domains)
```

{% endcode %}

### Tham số

| Tên         | Kiểu   | Bắt buộc | Mặc định | Mô tả                       |
| ----------- | ------ | -------- | -------- | --------------------------- |
| `is_active` | `bool` | ❌        | `True`   | Lọc theo trạng thái active. |
| `page`      | `int`  | ❌        | `1`      | Số trang của collection.    |

### Giá trị trả về

`dict[str, Any]` (JSON do API trả về).

```json
{
  "member": [
    {
      "id": "string",
      "domain": "string",
      "isActive": true,
      "createdAt": "2025-04-01T00:00:00.000Z",
      "updatedAt": "2025-04-01T00:00:00.000Z"
    }
  ],
  "totalItems": 0,
  "view": {
    "id": "string",
    "type": "string",
    "first": "string",
    "last": "string",
    "previous": "string",
    "next": "string"
  },
  "search": {
    "type": "string",
    "template": "string",
    "variableRepresentation": "string",
    "mapping": [
      {
        "type": "string",
        "variable": "string",
        "property": "string",
        "required": true
      }
    ]
  }
}
```
