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

# Connect a custom domain to a site



## OpenAPI

````yaml /api-reference/openapi.json post /custom-domains
openapi: 3.1.0
info:
  title: Replo Public API
  version: '2026-11-14'
servers:
  - url: https://api.replo.app/v1
security: []
paths:
  /custom-domains:
    post:
      tags:
        - Custom-domains
      summary: Connect a custom domain to a site
      operationId: customDomains.create
      parameters:
        - name: Replo-Api-Version
          in: header
          required: true
          schema:
            type: string
            enum:
              - '2026-11-14'
          description: The public API version to use for this request.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                siteId:
                  type: string
                  format: uuid
                domain:
                  type: string
                  minLength: 1
                  maxLength: 253
                  pattern: ^([a-z0-9]([a-z0-9-]*[a-z0-9])?\.)+[a-z]{2,}$
              required:
                - siteId
                - domain
              additionalProperties: false
      responses:
        '201':
          description: Connect a custom domain to a site
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    enum:
                      - custom_domain
                  id:
                    type: string
                    format: uuid
                  domain:
                    type: string
                  status:
                    type: string
                    enum:
                      - pending
                      - active
                      - stale
                  is_pending:
                    type: boolean
                  is_stale:
                    type: boolean
                  dns_instructions:
                    oneOf:
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - root
                          records:
                            type: array
                            items:
                              type: object
                              properties:
                                type:
                                  type: string
                                host:
                                  type: string
                                value:
                                  type: string
                              required:
                                - type
                                - host
                                - value
                              additionalProperties: false
                          verification_token:
                            type:
                              - string
                              - 'null'
                          verification_token_expires_at:
                            type:
                              - string
                              - 'null'
                        required:
                          - type
                          - records
                          - verification_token
                          - verification_token_expires_at
                        additionalProperties: false
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - subdomain
                          records:
                            type: array
                            items:
                              type: object
                              properties:
                                type:
                                  type: string
                                host:
                                  type: string
                                value:
                                  type: string
                              required:
                                - type
                                - host
                                - value
                              additionalProperties: false
                        required:
                          - type
                          - records
                        additionalProperties: false
                required:
                  - object
                  - id
                  - domain
                  - status
                  - is_pending
                  - is_stale
                  - dns_instructions
                additionalProperties: false
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '401':
          description: >-
            Missing or invalid Replo Public API token. Send an active key as
            `Authorization: Bearer replo_sk_...`; if it was revoked, create a
            new key in Replo Settings.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '403':
          description: >-
            You are not authorized to access this resource. Ask a workspace
            owner to perform this action or to grant the key's creator access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '404':
          description: >-
            Not Found. The resource may not exist, this key may lack the
            required scope, or the key's creator may have lost access. Check the
            key's scopes in Replo Settings and the creator's project or
            workspace access; a workspace owner can grant access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '409':
          description: The resource is in a conflicting state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '413':
          description: File content exceeds the 10 MiB limit.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '429':
          description: >-
            Too many requests. Please retry after the time indicated by the
            Retry-After header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '500':
          description: An internal error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '503':
          description: Service temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
      security:
        - bearerAuth: []
components:
  schemas:
    PublicApiError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            doc_url:
              type: string
            issues:
              type: array
              items:
                type: object
                properties:
                  param:
                    type:
                      - string
                      - 'null'
                    description: >-
                      Dotted path to the failing field within the request body,
                      query or path, e.g. "name" or "variants.0.available"; null
                      when the rule covers the whole input.
                  message:
                    type: string
                    description: Why the field was rejected.
                required:
                  - param
                  - message
              description: >-
                Present on an invalid_request whose input failed validation:
                each failing field and why, at most 10.
          required:
            - code
            - message
            - doc_url
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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