> 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/account/usage.md).

# List Accounts

Returns a list of accounts.

### 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\_accounts.py" %}

```python
from smtppy import SMTPDevClient

client = SMTPDevClient(api_key="YOUR_API_KEY")

accounts = client.list_accounts(address=None, is_active=True, page=1)
print(accounts)
```

{% endcode %}

### Tham số

| Tên         | Kiểu          | Bắt buộc | Mặc định | Mô tả                       |
| ----------- | ------------- | -------- | -------- | --------------------------- |
| `address`   | `str \| None` | ❌        | `None`   | Lọc theo email address.     |
| `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",
      "address": "user@example.com",
      "quota": 0,
      "used": 0,
      "isActive": true,
      "isDeleted": false,
      "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
      }
    ]
  }
}
```
