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

# Add a custom domain

> Add a custom domain and register it with the hosting provider. After adding it, create a CNAME record for the hostname that points to `dns_target`. For a root domain, create an A record that points to `dns_target_ip`. The domain turns `active` in the background. Check the progress with the [Get a custom domain](/api/custom-domains/show) API.

> [!NOTE]
>
> Replace `{your-subdomain}` with your workspace’s subdomain. \
> Learn how to find your subdomain in [Workspace subdomain](https://apidocs.neetoform.com/api/workspace-subdomain.md).


## OpenAPI

````yaml bundled/custom-domains.yaml POST /custom_domains
openapi: 3.0.3
info:
  title: NeetoForm Custom Domains APIs
  version: 2.0.0
servers:
  - description: NeetoForm APIs
    url: https://{your-subdomain}.neetoform.com/api/external/v2
    variables:
      your-subdomain:
        default: spinkart
        description: >-
          Replace **spinkart** with your [workspace's
          subdomain](/api/workspace-subdomain).
security: []
tags:
  - name: Custom Domains
    description: APIs to manage custom domains of the workspace.
paths:
  /custom_domains:
    post:
      tags:
        - Custom Domains
      summary: Add a custom domain
      description: >-
        Add a custom domain and register it with the hosting provider. After
        adding it, create a CNAME record for the hostname that points to
        `dns_target`. For a root domain, create an A record that points to
        `dns_target_ip`. The domain turns `active` in the background. Check the
        progress with the [Get a custom domain](/api/custom-domains/show) API.
      parameters:
        - $ref: '#/components/parameters/api_key_header'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                hostname:
                  type: string
                  description: Hostname to add.
                  example: forms.example.com
              required:
                - hostname
      responses:
        '201':
          description: Created - Custom domain added successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/custom_domain_response'
        '400':
          description: Bad Request - The `hostname` parameter is missing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_response'
              example:
                error: 'param is missing or the value is empty: hostname'
        '422':
          description: Unprocessable Entity - The domain could not be added
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Couldn't add custom domain. Please try again
                  key:
                    type: string
                    description: Machine readable reason for the failure.
                  hostname:
                    type: string
                    example: forms.example.com
components:
  parameters:
    api_key_header:
      in: header
      name: X-Api-Key
      description: >-
        Use the X-Api-Key header to provide your workspace API key. Refer to
        [Authentication](/api/authentication) for more information.
      required: true
      schema:
        type: string
        default: your-api-key
  schemas:
    custom_domain_response:
      type: object
      properties:
        custom_domain:
          $ref: '#/components/schemas/custom_domain'
    error_response:
      type: object
      properties:
        error:
          type: string
    custom_domain:
      type: object
      properties:
        id:
          type: string
          example: 5f1c2a9e-7b4d-4e3a-8c6f-1d2e3f4a5b6c
        hostname:
          type: string
          example: forms.example.com
        status:
          type: string
          description: Setup status of the domain, for example `pending` or `active`.
          example: pending
        status_reason:
          type: string
          nullable: true
          description: Reason for the current status, when there is one.
          example: null
        created_at:
          $ref: '#/components/schemas/date_time_field'
        dns_target:
          type: string
          description: Value for the CNAME record to create for the hostname.
          example: neetodeployapp.com
        dns_target_ip:
          type: string
          description: >-
            IP address for the A record to create when the hostname is a root
            domain.
          example: 98.89.128.226
    date_time_field:
      type: string
      format: date-time

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.