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

# Add a domain

> Add a new custom domain to the platform configuration.



## OpenAPI

````yaml /openapi/admin.json post /domains
openapi: 3.1.0
info:
  title: Nudj Admin API
  version: 1.0.0
servers:
  - url: https://{subdomain}.nudj.cx/api/v2/admin
    description: Organization API Server
    variables:
      subdomain:
        description: Your organization's subdomain (required)
        default: your-org
security:
  - ApiToken: []
paths:
  /domains:
    post:
      tags:
        - Domains
      summary: Add a domain
      description: Add a new custom domain to the platform configuration.
      operationId: addDomain
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                domain:
                  type: string
                  minLength: 1
                  description: The custom domain to add to the platform
              required:
                - domain
              description: The input required to add a custom domain to the platform
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddDomainResponse'
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
components:
  schemas:
    AddDomainResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Whether the operation was successful
        code:
          type: number
          description: HTTP status code
        message:
          type: string
          description: Error message if operation failed
        data:
          type: object
          properties:
            verified:
              type: boolean
              description: Whether the domain is verified and ready to use
            verification:
              type:
                - array
                - 'null'
              items:
                type: object
                properties:
                  type:
                    type: string
                    description: Type of DNS record to add
                  domain:
                    type: string
                    description: Domain or subdomain to add record to
                  value:
                    type: string
                    description: Value for the DNS record
                  reason:
                    type: string
                    description: Additional information about the verification
                required:
                  - type
                  - domain
                  - value
              description: DNS verification records needed if domain is not verified
          required:
            - verified
          description: Response data containing domain verification status
      required:
        - success
        - code
      description: The response returned when adding a custom domain to the platform
    error.BAD_REQUEST:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Invalid input data
        code:
          type: string
          description: The error code
          example: BAD_REQUEST
        issues:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
          description: An array of issues that were responsible for the error
          example: []
      required:
        - message
        - code
      title: Error
      description: The error information
      example:
        code: BAD_REQUEST
        message: Invalid input data
        issues: []
    error.INTERNAL_SERVER_ERROR:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Internal server error
        code:
          type: string
          description: The error code
          example: INTERNAL_SERVER_ERROR
        issues:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
          description: An array of issues that were responsible for the error
          example: []
      required:
        - message
        - code
      title: Error
      description: The error information
      example:
        code: INTERNAL_SERVER_ERROR
        message: Internal server error
        issues: []
  securitySchemes:
    ApiToken:
      type: apiKey
      in: header
      name: x-api-token

````