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

# Delete custom domain

> <Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Removes a custom domain from the app and stops serving it.

This detaches the domain from Base44's hosting, deletes any email domain configured on it, and removes it from the routing table so it stops resolving to the app. Other domains that were redirecting to this one stop redirecting.

<Warning>Deleting is permanent and there is no undo. The domain itself is not affected at your registrar, so you can point it somewhere else afterwards, but its Base44 configuration is gone. To stop serving a domain while keeping it attached, use [Unlink custom domain](/api-reference/unlink-custom-domain) instead.</Warning>

A failed delete does not necessarily leave the domain working. Detaching it from Base44's hosting and removing its email domain happen first, so a failure after that point takes the domain out of service while its row survives and it still appears in [List custom domains](/api-reference/list-custom-domains). Retrying the delete is safe and is how you finish it. Retrying one that is already gone answers 404.

<Note>This endpoint accepts a personal API key. Workspace API keys are not authorized for it and are rejected with a 403.</Note>



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json delete /api/apps/{app_id}/custom-domains/{domain_id}
openapi: 3.1.0
info:
  title: Base44 App Management API
  version: 1.0.0
servers:
  - url: https://app.base44.com
security:
  - ApiKeyAuth: []
paths:
  /api/apps/{app_id}/custom-domains/{domain_id}:
    delete:
      summary: Delete custom domain
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Removes a custom domain from the app and stops serving it.


        This detaches the domain from Base44's hosting, deletes any email domain
        configured on it, and removes it from the routing table so it stops
        resolving to the app. Other domains that were redirecting to this one
        stop redirecting.


        <Warning>Deleting is permanent and there is no undo. The domain itself
        is not affected at your registrar, so you can point it somewhere else
        afterwards, but its Base44 configuration is gone. To stop serving a
        domain while keeping it attached, use [Unlink custom
        domain](/api-reference/unlink-custom-domain) instead.</Warning>


        A failed delete does not necessarily leave the domain working. Detaching
        it from Base44's hosting and removing its email domain happen first, so
        a failure after that point takes the domain out of service while its row
        survives and it still appears in [List custom
        domains](/api-reference/list-custom-domains). Retrying the delete is
        safe and is how you finish it. Retrying one that is already gone answers
        404.


        <Note>This endpoint accepts a personal API key. Workspace API keys are
        not authorized for it and are rejected with a 403.</Note>
      operationId: delete_domain_api_apps__app_id__custom_domains__domain_id__delete
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            description: ID of the app the domain belongs to.
            title: App Id
          description: ID of the app the domain belongs to.
          example: 6820f3a4e7b91d003c45a1f2
        - name: domain_id
          in: path
          required: true
          schema:
            type: string
            description: >-
              ID of the custom domain, as returned in `id` by [List custom
              domains](/api-reference/list-custom-domains).
            title: Domain Id
          description: >-
            ID of the custom domain, as returned in `id` by [List custom
            domains](/api-reference/list-custom-domains).
          example: 68b1c0d4e7b91d003c45a1f7
      responses:
        '200':
          description: The domain is deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DomainMessageResponse'
        '400':
          description: >-
            The domain could not be detached from Base44's hosting. The domain
            is left attached; retry.
        '401':
          description: Missing or invalid credentials.
        '403':
          description: >-
            You don't have access to this app, or you used a workspace API key.
            These endpoints take a personal API key.
        '404':
          description: The app has no custom domain with this ID.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    DomainMessageResponse:
      properties:
        message:
          type: string
          title: Message
          description: What happened, in plain text.
          example: Domain successfully unlinked
      type: object
      required:
        - message
      title: DomainMessageResponse
      description: A one-line confirmation.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: api_key
      description: Personal API key.

````