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

# Initiate Domain Claim

> Start claiming a domain that is already in use by another workspace. Returns the DNS TXT record you must publish at _migma.<rootDomain> to prove ownership. Requires API key with domain:write.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/domains/claims
openapi: 3.1.0
info:
  title: Migma.ai API (v1)
  description: >-
    API for managing brands, contacts, email generation, sending, and
    integrations.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.migma.ai
    description: Production
security:
  - apiKeyAuth: []
tags:
  - name: Projects/Brands
    description: Manage projects (brands) and import from websites
  - name: Contacts
    description: Manage your contacts, segments, tags, and topics
  - name: Segments
    description: Create and manage dynamic contact segments
  - name: Tags
    description: Organize contacts with tags
  - name: Topics
    description: Manage subscription topics and preferences
  - name: Emails
    description: Generate, send, and export emails
  - name: Email Validation
    description: Validate email content for compatibility and deliverability
  - name: Email Previews
    description: Preview emails across devices and email clients
  - name: Domains
    description: Manage sending domains and verification
  - name: Webhooks
    description: Manage webhook endpoints for real-time event notifications
  - name: Integrations
    description: Third-party platform integrations
  - name: Campaigns
    description: Create, schedule, send, and manage email campaigns
  - name: Project Editing
    description: Edit project assets, logos, images, and knowledge base entries
paths:
  /v1/domains/claims:
    post:
      tags:
        - Domains
      summary: Initiate Domain Claim
      description: >-
        Start claiming a domain that is already in use by another workspace.
        Returns the DNS TXT record you must publish at _migma.<rootDomain> to
        prove ownership. Requires API key with domain:write.
      operationId: InitiateDomainClaim
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DomainClaimInitiateRequest'
      responses:
        '200':
          description: >-
            Claim challenge returned. Publish the TXT record, then call
            /v1/domains/claims/{domain}/verify.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponseDomainClaimChallenge'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        Optional key (max 100 chars) for safe retries. Same key + same body
        within 24h replays the original response (same status and body); same
        key + a different body returns 409 IDEMPOTENCY_CONFLICT. Scoped per API
        key.
      schema:
        type: string
        maxLength: 100
  schemas:
    DomainClaimInitiateRequest:
      type: object
      properties:
        domain:
          type: string
          description: >-
            The domain you want to claim, e.g. 'acme.com' or 'send.acme.com'.
            The root apex is resolved automatically.
      required:
        - domain
    ApiResponseDomainClaimChallenge:
      allOf:
        - $ref: '#/components/schemas/ApiResponse'
        - type: object
          properties:
            data:
              $ref: '#/components/schemas/DomainClaimChallenge'
    ApiResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          nullable: true
        error:
          type: string
          nullable: true
      required:
        - success
    DomainClaimChallenge:
      type: object
      properties:
        message:
          type: string
        rootDomain:
          type: string
          description: The apex domain you must prove ownership of.
        record:
          $ref: '#/components/schemas/DnsRecord'
    ApiError:
      type: object
      properties:
        success:
          type: boolean
          default: false
        error:
          type: string
        code:
          type: string
          description: >-
            Machine-readable error code (e.g., IDEMPOTENCY_CONFLICT,
            DOMAIN_CLAIMABLE).
        data:
          type: object
          description: >-
            Additional structured context for the error, such as the affected
            domain.
          additionalProperties: true
      required:
        - success
        - error
    DnsRecord:
      type: object
      properties:
        type:
          type: string
          enum:
            - CNAME
            - TXT
            - MX
        name:
          type: string
        value:
          type: string
        priority:
          type: integer
        status:
          type: string
          enum:
            - pending
            - verified
            - failed
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Forbidden:
      description: Forbidden - Missing required permissions or access denied
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Conflict:
      description: >-
        Conflict - the Idempotency-Key was reused with a different request body
        (code: IDEMPOTENCY_CONFLICT)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key authentication. Use 'Authorization: Bearer YOUR_API_KEY' where
        YOUR_API_KEY is obtained from the Migma dashboard under Settings → API
        Integration.

````