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

# Domain verification

> Verify a domain's DNS settings

Verify a domain's DNS settings. This endpoint checks that the required DNS records (DKIM and SPF) are correctly configured and **updates the domain's status** (`isActive`, `isApproved`, `lastVerificationErrors`, `lastVerificationCheckedAt`) based on the result.

### Features

* DNS records verification (DKIM and SPF)
* Updates domain status as a side effect
* Detailed per-record error messages on failure

### Response

Returns `{ isVerified }`. When verification **fails**, the response also includes a `verificationErrors` array, where each entry has:

| Field      | Description                                    |
| ---------- | ---------------------------------------------- |
| `type`     | Error category, e.g. `TXT`, `CONFIG`, `SYSTEM` |
| `error`    | Human-readable error message                   |
| `required` | Expected DNS record value(s)                   |
| `actual`   | DNS record value(s) actually found             |

* `200 OK`: Verification check completed. **Inspect `isVerified` and `verificationErrors`** — a `200` is returned even when verification fails.
* `400 Bad Request`: Invalid domain ID or domain not found
* `401 Unauthorized`: Invalid API key

<Note>
  The domain must be in 'Active' status to be verified. If it isn't active yet, wait and try again.
</Note>

<Note>
  No request body is required. The domain ID goes in the URL path.
</Note>


## OpenAPI

````yaml POST /v2/domain/{id}/verify
openapi: 3.1.0
info:
  title: Email Service API
  description: API for sending and managing email communications
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://sending.sendrapp.org
    description: Email Sending API
  - url: https://stats.sendrapp.org
    description: Statistics API
  - url: https://logs.sendrapp.org
    description: Logs API
  - url: http://localhost:3001
    description: Local Development
security:
  - apiKeyAuth: []
paths:
  /v2/domain/{id}/verify:
    post:
      summary: Verify Domain
      description: Verify a domain's DNS settings
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Domain ID
      responses:
        '200':
          description: >-
            Verification check completed. Inspect isVerified and
            verificationErrors — a 200 is returned even when verification fails.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DomainVerificationResponse'
        '400':
          description: Invalid domain ID or domain not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      servers:
        - url: https://platform.sendr.app/api
          description: API Server
        - url: http://localhost:3001
          description: Local Development
components:
  schemas:
    DomainVerificationResponse:
      type: object
      properties:
        isVerified:
          type: boolean
          description: Whether the domain passed verification
        verificationErrors:
          type: array
          description: >-
            Present when verification fails. Lists each misconfigured DNS
            record.
          items:
            type: object
            properties:
              type:
                type: string
                description: Error category, e.g. TXT, CONFIG, SYSTEM
              error:
                type: string
                description: Human-readable error message
              required:
                type: array
                items:
                  type: string
                description: Expected DNS record value(s)
              actual:
                type: array
                items:
                  type: string
                description: DNS record value(s) actually found
    Error:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: integer
          format: int32
          description: Error code
        message:
          type: string
          description: Error message
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````