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

# Add TXT

> Adds a TXT record to the domain's DNS zone. TXT records store arbitrary text data and are widely used for domain verification and email authentication.

**Common use cases:**
- **Domain verification:** Prove ownership to Google Search Console, Stripe, and similar services (e.g. `google-site-verification=abc123`).
- **SPF:** Define authorised mail senders to reduce spam (e.g. `v=spf1 include:_spf.google.com ~all`).
- **DKIM:** Publish a public key for email signing (typically on a `selector._domainkey` host).
- **DMARC:** Set email authentication policy (typically on `_dmarc` host).

**Prerequisite:** DNS service must be activated for the domain via `POST /api/v1/dns/activate` before records can be added.



## OpenAPI

````yaml POST /api/v1/dns/txt-record
openapi: 3.1.0
info:
  title: Namify API
  description: >-
    The Namify API gives resellers and platform builders programmatic access to
    domain search, registration, renewal, customer management, and DNS
    configuration — all through a single authenticated REST interface.


    All requests require a bearer token issued from the Namify dashboard
    (Settings > API Key). The API is scoped to your partner account: TLD
    availability, pricing, and order history are all filtered to your configured
    product catalogue.


    **Base URL:** `https://dev.namify.host`


    **Typical integration flow:**

    1. Create a customer account with `POST /api/v1/customers/signup`.

    2. Check domain availability with `GET /api/v1/domains/availability`.

    3. Register the domain with `POST /api/v1/domains/register`.

    4. Activate DNS with `POST /api/v1/dns/activate` and add records as needed.

    5. Renew the domain before expiry with `POST /api/v1/domains/renew`.
  version: 1.0.0
  license:
    name: MIT
servers:
  - url: https://dev.namify.host
security:
  - bearerAuth: []
paths:
  /api/v1/dns/txt-record:
    post:
      tags:
        - DNS
      summary: Add a TXT record
      description: >-
        Adds a TXT record to the domain's DNS zone. TXT records store arbitrary
        text data and are widely used for domain verification and email
        authentication.


        **Common use cases:**

        - **Domain verification:** Prove ownership to Google Search Console,
        Stripe, and similar services (e.g. `google-site-verification=abc123`).

        - **SPF:** Define authorised mail senders to reduce spam (e.g. `v=spf1
        include:_spf.google.com ~all`).

        - **DKIM:** Publish a public key for email signing (typically on a
        `selector._domainkey` host).

        - **DMARC:** Set email authentication policy (typically on `_dmarc`
        host).


        **Prerequisite:** DNS service must be activated for the domain via `POST
        /api/v1/dns/activate` before records can be added.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - order_id
                - value
              properties:
                order_id:
                  type: integer
                  description: Order ID of the domain.
                  example: 124680932
                value:
                  type: string
                  description: Text content of the record.
                  example: v=spf1 include:_spf.google.com ~all
                host:
                  type: string
                  description: >-
                    Subdomain label relative to the zone. Use `@` or omit for
                    the apex, or a specific label for targeted records (e.g.
                    `_dmarc`, `google._domainkey`).
                  example: '@'
                time_to_live:
                  type: integer
                  description: TTL in seconds. Minimum 300. Omit to use the zone default.
                  example: 300
            examples:
              spf:
                summary: SPF record
                value:
                  order_id: 124680932
                  value: v=spf1 include:_spf.google.com ~all
                  host: '@'
              domain_verification:
                summary: Domain ownership verification
                value:
                  order_id: 124680932
                  value: google-site-verification=rXOxyAbCdEfGh
                  host: '@'
              dmarc:
                summary: DMARC policy
                value:
                  order_id: 124680932
                  value: v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com
                  host: _dmarc
      responses:
        '200':
          description: TXT record added successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DnsRecordResponse'
              example:
                status: SUCCESS
                message: Record added successfully
        '401':
          description: API key is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorUnauthorized'
        '422':
          description: >-
            The `order_id` does not belong to this partner, or the upstream DNS
            provider rejected the record. The `message` field contains the
            reason — either `Invalid order ID` or a descriptive error from the
            DNS provider (e.g. `Duplicate record found`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInvalidOrder'
              examples:
                invalid_order:
                  summary: Unknown or unauthorised order ID
                  value:
                    status: ERROR
                    message: Invalid order ID
                upstream_rejection:
                  summary: DNS provider rejected the record
                  value:
                    status: ERROR
                    message: Duplicate record found
components:
  schemas:
    DnsRecordResponse:
      type: object
      properties:
        status:
          type: string
          example: SUCCESS
        message:
          type: string
          example: Record added successfully
    ErrorUnauthorized:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          example: Unauthorized
    ErrorInvalidOrder:
      type: object
      required:
        - status
        - message
      properties:
        status:
          type: string
          example: ERROR
        message:
          type: string
          example: Invalid order ID
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A personal access token. Obtain one from the dashboard under Settings >
        API Key. Include it in the `Authorization` header as `Bearer <token>`.
        Unauthenticated requests to protected routes return `401 Unauthorized`.

````