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

```typescript
domains.verify(domainOrId: string): Promise<LumailResult<VerifyDomainResponse>>
```

Checks DNS. Id or hostname.

## Path Parameters

| Name | Type | Description |
| ------------ | ------ | ---------------------------------------- |
| `domainOrId` | string | **Required.** MailDomain id or hostname. |

## Response Fields

| Field | Type | Description |
| ------------ | --------- | ---------------------------------------------------- |
| `id` | string | Domain id. |
| `status` | string | Status after the check (`VERIFIED`, `PENDING`, …). |
| `dnsRecords` | unknown[] | Remaining or current DNS records when still pending. |

`data` is `{ id, status, dnsRecords? }`. Failures return `{ data: null, error: { name, message, statusCode } }`.


## API Reference
**Method:** POST
**Endpoint:** /api/v2/domains/:domain/verify

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

const lumail = new Lumail({ apiKey: process.env.LUMAIL_API_KEY });
const { data, error } = await lumail.domains.verify("mail.example.com");
if (error) {
  throw error;
}
console.log(data.status);
```

### cURL
```bash
curl -X POST https://lumail.io/api/v2/domains/mail.example.com/verify \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

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

### Success Response
```json
{
  "id": "dom_abc123",
  "status": "VERIFIED"
}
```

### Error Response
```json
{
  "name": "not_found",
  "message": "Domain not found",
  "statusCode": 404
}
```
