> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usesendly.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Verify Domain

> Verify DNS records

## Description

Verify that DNS records are correctly configured for a domain.

## Parameters

<ParamField path="identifier" type="string" required>
  Domain ID or name.
</ParamField>

## Response

<ResponseField name="status" type="string">
  `VERIFIED` if successful.
</ResponseField>

## Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.usesendly.app/v1/domains/mail.yourdomain.com/verify \
    -H "Authorization: Bearer se_your_api_key"
  ```

  ```javascript SDK theme={null}
  const result = await client.domains.verify('mail.yourdomain.com')

  if (result.status === 'VERIFIED') {
    console.log('✅ Domain verified successfully')
  } else {
    console.log('❌ Verification failed - check DNS records')
  }
  ```

  ```javascript SMTP theme={null}
  import { Sendly } from '@sendlyapp/sdk'

  const client = new Sendly()
  const result = await client.domains.verify('mail.yourdomain.com')
  ```
</CodeGroup>

### Complete Domain Setup

<CodeGroup>
  ```javascript SDK theme={null}
  // 1. Create domain
  const domain = await client.domains.create({
    domain: 'mail.yourdomain.com'
  })

  console.log(`Domain created. Add these DNS records:`)
  console.log(domain.records)

  // 2. Wait 24-48 hours...

  // 3. Verify
  const verified = await client.domains.verify(domain.id)

  if (verified.status === 'VERIFIED') {
    console.log('Ready to send!')
    
    // 4. Send email from this domain
    await client.emails.send({
      from: 'noreply@mail.yourdomain.com',
      to: 'user@example.com',
      subject: 'Email',
      html: '<p>Content</p>'
    })
  }
  ```

  ```bash cURL theme={null}
  # 1. Create
  DOMAIN_ID=$(curl -X POST https://api.usesendly.app/v1/domains \
    -H "Authorization: Bearer se_your_api_key" \
    -H "Content-Type: application/json" \
    -d '{"domain": "mail.yourdomain.com"}' | jq -r '.id')

  echo "Domain created: $DOMAIN_ID"

  # 2. After DNS setup...

  # 3. Verify
  curl -X POST "https://api.usesendly.app/v1/domains/$DOMAIN_ID/verify" \
    -H "Authorization: Bearer se_your_api_key"
  ```
</CodeGroup>

## Verification Process

1. **Create domain** with create endpoint
2. **Copy DNS records** from response
3. **Add records** in your DNS provider (GoDaddy, Namecheap, etc.)
4. **Wait** 24-48 hours for propagation
5. **Verify** with this endpoint
6. **Start sending** from that domain

## DNS Records Required

| Type  | Purpose                                    |
| ----- | ------------------------------------------ |
| DKIM  | Authenticates emails are from you          |
| SPF   | Authorizes Sendly to send from your domain |
| DMARC | Defines what to do with auth failures      |

***

Need help? Contact [support@usesendly.app](mailto:support@usesendly.app)
