`lumail@2.1.0` · [`lumail.domains`](/docs/sdk/v2/domains)

```typescript
domains.list(): Promise<LumailResult<ListDomainsResponse>>
```

Permission: `domains`. The SDK takes no arguments and does not forward `?limit=`. The HTTP route may still accept `limit` if you call it with fetch.

## Parameters

No parameters.

## Response Fields

| Field | Type | Description |
| ---------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `object` | `"list"` | Discriminator. Always `list`. |
| `has_more` | boolean | `true` when the HTTP `limit` slice hid more rows. The SDK never sends `limit`, so this is usually `false`. |
| `data` | `DomainRecord[]` | Sending domains. Each row: `id`, `domain`, `status`, optional `region`, `createdAt`, `sesRecords`, `dnsRecords`, `message`. |

`data` is `{ object, data, has_more }`. Failures return `{ data: null, error: { name, message, statusCode } }`.


## API Reference
**Method:** GET
**Endpoint:** /api/v2/domains

### SDK
```ts
import { Lumail } from "lumail";

const lumail = new Lumail({ apiKey: process.env.LUMAIL_API_KEY });
const { data, error } = await lumail.domains.list();
if (error) {
  throw error;
}
for (const domain of data.data) {
  console.log(domain.domain, domain.status);
}
```

### cURL
```bash
curl https://lumail.io/api/v2/domains \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

### JavaScript
```javascript
const response = await fetch("https://lumail.io/api/v2/domains", {
  headers: {
    Authorization: "Bearer YOUR_API_TOKEN",
  },
});
const data = await response.json();
```

### Success Response
```json
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "id": "dom_abc123",
      "domain": "mail.example.com",
      "status": "VERIFIED"
    }
  ]
}
```

### Error Response
```json
{
  "name": "missing_api_key",
  "message": "Missing API key",
  "statusCode": 401
}
```
