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

# Add custom domain

> Registers a user-owned custom domain on the provider project and returns DNS setup instructions.



## OpenAPI

````yaml https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/deployments.yaml post /api/deployments/domains
openapi: 3.0.3
info:
  title: Insforge Deployments API
  version: 1.0.0
  description: >-
    Frontend deployment sessions, source uploads, environment variables, and
    custom domains.
servers: []
security: []
paths:
  /api/deployments/domains:
    post:
      tags:
        - Admin
      summary: Add custom domain
      description: >-
        Registers a user-owned custom domain on the provider project and returns
        DNS setup instructions.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddCustomDomainRequest'
      responses:
        '201':
          description: Custom domain added
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomDomain'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          description: Unauthorized
        '403':
          description: Admin access required
        '500':
          $ref: '#/components/responses/Error'
        '503':
          description: Deployment provider is not configured
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
        - apiKey: []
components:
  schemas:
    AddCustomDomainRequest:
      type: object
      required:
        - domain
      properties:
        domain:
          type: string
          pattern: ^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}$
          example: app.example.com
          description: User-owned domain. Domains ending in `.insforge.site` are reserved.
    CustomDomain:
      type: object
      required:
        - domain
        - apexDomain
        - verified
        - misconfigured
        - verification
        - cnameTarget
        - aRecordValue
      properties:
        domain:
          type: string
          example: app.example.com
        apexDomain:
          type: string
          example: example.com
        verified:
          type: boolean
        misconfigured:
          type: boolean
        verification:
          type: array
          items:
            $ref: '#/components/schemas/DomainVerificationRecord'
        cnameTarget:
          type: string
          nullable: true
        aRecordValue:
          type: string
          nullable: true
    ErrorResponse:
      type: object
      required:
        - error
        - message
        - statusCode
      properties:
        error:
          type: string
          description: Error code for programmatic handling.
        message:
          type: string
          description: Human-readable error message.
        statusCode:
          type: integer
        nextActions:
          type: string
          description: Suggested action to resolve the error.
    DomainVerificationRecord:
      type: object
      required:
        - type
        - domain
        - value
      properties:
        type:
          type: string
          example: TXT
        domain:
          type: string
        value:
          type: string
  responses:
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Project admin JWT or an API key passed as a Bearer token.
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````