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

# Verify Domain

> Trigger DNS verification for a sending domain to confirm ownership using the AutoSend API.

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.autosend.com/v1/domains/60d5ec49f1b2c72d9c8b1111/verify \
    --header 'Authorization: Bearer <token>'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.autosend.com/v1/domains/60d5ec49f1b2c72d9c8b1111/verify"

  headers = {"Authorization": "Bearer <token>"}

  response = requests.post(url, headers=headers)

  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://api.autosend.com/v1/domains/60d5ec49f1b2c72d9c8b1111/verify",
    {
      method: "POST",
      headers: {
        Authorization: "Bearer <token>",
      },
    }
  );

  const data = await response.json();
  console.log(data);
  ```

  ```php PHP theme={null}
  <?php

  $curl = curl_init();

  curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.autosend.com/v1/domains/60d5ec49f1b2c72d9c8b1111/verify",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => "",
    CURLOPT_HTTPHEADER => [
      "Authorization: Bearer <token>",
    ],
  ]);

  $response = curl_exec($curl);
  curl_close($curl);

  echo $response;
  ```

  ```go Go theme={null}
  package main

  import (
    "fmt"
    "io"
    "net/http"
  )

  func main() {
    req, _ := http.NewRequest("POST", "https://api.autosend.com/v1/domains/60d5ec49f1b2c72d9c8b1111/verify", nil)
    req.Header.Set("Authorization", "Bearer <token>")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
  }
  ```

  ```java Java theme={null}
  import java.net.URI;
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;

  HttpClient client = HttpClient.newHttpClient();

  HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://api.autosend.com/v1/domains/60d5ec49f1b2c72d9c8b1111/verify"))
      .header("Authorization", "Bearer <token>")
      .POST(HttpRequest.BodyPublishers.noBody())
      .build();

  HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
  System.out.println(response.body());
  ```

  ```ruby Ruby theme={null}
  require "net/http"
  require "uri"

  uri = URI.parse("https://api.autosend.com/v1/domains/60d5ec49f1b2c72d9c8b1111/verify")
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true

  request = Net::HTTP::Post.new(uri.request_uri)
  request["Authorization"] = "Bearer <token>"

  response = http.request(request)
  puts response.body
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "domain": {
        "id": "60d5ec49f1b2c72d9c8b1111",
        "domainName": "example.com",
        "verificationStatus": "VERIFIED",
        "ownershipVerified": true,
        "dkimEnabled": true,
        "mailFromEnabled": false,
        "dmarcEnabled": false,
        "dnsRecords": {
          "ownership": {
            "name": "_autosend-verify.example.com",
            "value": "autosend-verify-cfdbf714dbec4584b82b925bfff91770",
            "type": "TXT",
            "purpose": "Domain ownership verification"
          },
          "dkim": {
            "name": "autosend._domainkey.example.com",
            "value": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQ...",
            "type": "TXT",
            "purpose": "DKIM authentication"
          },
          "mailFrom": [
            {
              "name": "mail.example.com",
              "value": "feedback-smtp.us-east-1.amazonses.com",
              "type": "MX",
              "purpose": "Mail-from domain",
              "priority": 10
            },
            {
              "name": "mail.example.com",
              "value": "v=spf1 include:amazonses.com ~all",
              "type": "TXT",
              "purpose": "SPF record for mail-from domain"
            }
          ],
          "dmarc": {
            "name": "_dmarc.example.com",
            "value": "v=DMARC1; p=none;",
            "type": "TXT",
            "purpose": "DMARC policy"
          }
        },
        "createdAt": "2026-01-05T10:00:00.000Z",
        "lastCheckedAt": "2026-03-25T07:05:29.525Z",
        "regionKey": "us-east-1",
        "verificationInProgress": false
      },
      "verificationInProgress": true,
      "ownershipVerified": true,
      "verificationStatus": "VERIFIED",
      "dkimEnabled": true,
      "mailFromEnabled": false,
      "dmarcEnabled": false
    },
    "message": "Domain verification status updated"
  }
  ```
</ResponseExample>

### Authorizations

<ParamField path="Authorization" type="string | header" required>
  Bearer authentication header of the form `Bearer <token>`, where `<token>` is your API key.
</ParamField>

#### Path Parameters

<ParamField path="domainId" type="string" required>
  The id of the domain to verify.
</ParamField>

### Response

<ResponseField name="success" type="boolean">
  Indicates whether the request was accepted.
</ResponseField>

<ResponseField name="message" type="string">
  Always `"Domain verification status updated"` on success.
</ResponseField>

<ResponseField name="data" type="object">
  Contains the full domain object and top-level verification status summary fields.

  <Expandable title="Data object">
    <ResponseField name="domain" type="object">
      The full domain object with updated verification state.

      <Expandable title="Domain object">
        <ResponseField name="id" type="string">
          Unique identifier for the domain (id).
        </ResponseField>

        <ResponseField name="domainName" type="string">
          The domain name (e.g. `example.com`).
        </ResponseField>

        <ResponseField name="verificationStatus" type="string">
          Overall domain verification status. One of `PENDING_CONFIGURATION`, `PENDING`, or `VERIFIED`.
        </ResponseField>

        <ResponseField name="ownershipVerified" type="boolean">
          Whether the TXT ownership record has been verified.
        </ResponseField>

        <ResponseField name="dkimEnabled" type="boolean">
          Whether DKIM CNAME records have been verified.
        </ResponseField>

        <ResponseField name="mailFromEnabled" type="boolean">
          Whether the MAIL FROM MX/TXT records have been verified.
        </ResponseField>

        <ResponseField name="dmarcEnabled" type="boolean">
          Whether a DMARC TXT record has been detected.
        </ResponseField>

        <ResponseField name="dnsRecords" type="object">
          DNS records required for domain verification.

          <Expandable title="DNS Records object">
            <ResponseField name="ownership" type="object">
              TXT record for domain ownership verification. Contains `name`, `value`, `type`, and `purpose` fields.
            </ResponseField>

            <ResponseField name="dkim" type="object">
              TXT record for DKIM authentication. Contains `name`, `value`, `type`, and `purpose` fields.
            </ResponseField>

            <ResponseField name="mailFrom" type="array">
              Array of MX and TXT records for the MAIL FROM domain. Each record contains `name`, `value`, `type`, `purpose`, and optionally `priority` fields.
            </ResponseField>

            <ResponseField name="dmarc" type="object">
              TXT record for DMARC policy. Contains `name`, `value`, `type`, and `purpose` fields.
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="createdAt" type="string">
          ISO 8601 timestamp of when the domain was added.
        </ResponseField>

        <ResponseField name="lastCheckedAt" type="string">
          ISO 8601 timestamp of the last DNS verification check.
        </ResponseField>

        <ResponseField name="regionKey" type="string">
          The AWS region key where the domain is configured (e.g. `us-east-1`).
        </ResponseField>

        <ResponseField name="verificationInProgress" type="boolean">
          Whether a DNS verification check is currently in progress for this domain.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="verificationInProgress" type="boolean">
      Whether verification is currently in progress.
    </ResponseField>

    <ResponseField name="ownershipVerified" type="boolean">
      Whether the TXT ownership record has been verified.
    </ResponseField>

    <ResponseField name="verificationStatus" type="string">
      Overall domain verification status. One of `PENDING_CONFIGURATION`, `PENDING`, or `VERIFIED`.
    </ResponseField>

    <ResponseField name="dkimEnabled" type="boolean">
      Whether DKIM CNAME records have been verified.
    </ResponseField>

    <ResponseField name="mailFromEnabled" type="boolean">
      Whether the MAIL FROM MX/TXT records have been verified.
    </ResponseField>

    <ResponseField name="dmarcEnabled" type="boolean">
      Whether a DMARC TXT record has been detected.
    </ResponseField>
  </Expandable>
</ResponseField>

#### Errors

<ResponseField name="404" type="object">
  Returned when no domain with the given `domainId` exists in the project.
</ResponseField>

<ResponseField name="429" type="object">
  Returned when the verify endpoint has been called too many times in a short period. Wait before retrying.
</ResponseField>


## OpenAPI

````yaml POST /domains/{domainId}/verify
openapi: 3.1.0
info:
  title: Autosend Domains API
  description: >-
    Manage your domains associated with your Autosend project. Domains are used
    to send email via AutoSend. After adding a domain you must configure DNS
    records and trigger verification before it can be used for sending.
  version: 1.0.0
servers:
  - url: https://api.autosend.com/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Domains
    description: Manage AutoSend domains for your Autosend project.
paths:
  /domains/{domainId}/verify:
    post:
      tags:
        - Domains
      summary: Verify Domain
      description: >-
        Triggers a background check of the domain's DNS records and verification
        state. 
      operationId: verifyDomain
      parameters:
        - $ref: '#/components/parameters/domainId'
      responses:
        '200':
          description: >-
            Current domain state returned immediately. Verification is running
            in the background.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Domain verification status updated
                  data:
                    $ref: '#/components/schemas/Domain'
              example:
                success: true
                message: Domain verification status updated
                data:
                  id: 60d5ec49f1b2c72d9c8b1111
                  domain: example.com
                  verificationStatus: PENDING
                  ownershipVerified: true
                  dkimEnabled: false
                  mailFromEnabled: false
                  dmarcEnabled: false
                  createdAt: '2026-01-05T10:00:00.000Z'
                  updatedAt: '2026-03-19T09:15:00.000Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    domainId:
      name: domainId
      in: path
      required: true
      description: The id of the domain.
      schema:
        type: string
        pattern: ^[a-f\d]{24}$
        example: 60d5ec49f1b2c72d9c8b1111
  schemas:
    Domain:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the domain (id).
          example: 60d5ec49f1b2c72d9c8b1111
        domain:
          type: string
          description: The domain name.
          example: example.com
        verificationStatus:
          type: string
          enum:
            - PENDING_CONFIGURATION
            - PENDING
            - VERIFIED
          description: >-
            Overall domain verification status. `PENDING_CONFIGURATION` — DNS
            records not yet detected. `PENDING` — DNS records detected, domain
            verification in progress. `VERIFIED` — domain is fully verified and
            ready to send.
          example: VERIFIED
        ownershipVerified:
          type: boolean
          description: >-
            Whether the TXT ownership record has been verified. Once `true`,
            never reverts to `false`.
          example: true
        dkimEnabled:
          type: boolean
          description: >-
            Whether DKIM CNAME records have been verified. Once `true`, never
            reverts to `false`.
          example: true
        mailFromEnabled:
          type: boolean
          description: >-
            Whether the MAIL FROM MX/TXT records have been verified. Once
            `true`, never reverts to `false`.
          example: true
        dmarcEnabled:
          type: boolean
          description: >-
            Whether a DMARC TXT record has been detected. Once `true`, never
            reverts to `false`.
          example: false
        createdAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp of when the domain was added.
          example: '2026-01-05T10:00:00.000Z'
        updatedAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp of the last status update.
          example: '2026-03-10T14:20:00.000Z'
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
  responses:
    Unauthorized:
      description: Missing or invalid Bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            message: Unauthorized
    NotFound:
      description: Domain not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            message: Domain not found
    RateLimited:
      description: Too many verification requests. Wait before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            message: Too many requests, please try again later
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key issued from the Autosend dashboard. Pass as `Authorization:
        Bearer <token>`.

````