---
updatedAt: 2026-08-31T09:43:57.000Z
agentTools:
  projectIndex: https://api-docs.neon.tech/llms.txt
---

# Delete a custom domain from a branch

Removes a custom domain registered on the branch and stops routing it.

**Note**: This endpoint is currently in Beta.


# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "servers": [
    {
      "url": "https://console.neon.tech/api/v2"
    }
  ],
  "info": {
    "title": "Neon API",
    "description": "The Neon API is the management API for Neon. Use it to provision, configure, and manage resources such as projects, branches, databases, roles, functions, and object storage.\n\nSee the [Neon API reference](https://neon.com/docs/reference/api) for details, and [Manage API keys](https://neon.com/docs/manage/api-keys/) to create and use API keys.",
    "version": "v2",
    "contact": {
      "email": "help@databricks.com"
    },
    "license": {
      "name": "Proprietary"
    }
  },
  "x-readme": {
    "samples-languages": [
      "shell"
    ]
  },
  "security": [
    {
      "BearerAuth": []
    },
    {
      "CookieAuth": []
    },
    {
      "TokenCookieAuth": []
    }
  ],
  "tags": [
    {
      "name": "Functions",
      "description": "These methods allow you to create and manage functions on your Neon branches."
    }
  ],
  "paths": {
    "/projects/{project_id}/branches/{branch_id}/custom-domains/{domain}": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "description": "The Neon project ID",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^[a-z0-9-]{1,60}$"
          }
        },
        {
          "name": "branch_id",
          "in": "path",
          "description": "The Neon branch ID",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^[a-z0-9-]{1,60}$"
          }
        },
        {
          "name": "domain",
          "in": "path",
          "description": "The registered custom domain (case-insensitive).",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 3,
            "maxLength": 254,
            "pattern": "^[A-Za-z0-9.-]+$"
          }
        }
      ],
      "delete": {
        "summary": "Delete a custom domain from a branch",
        "description": "Removes a custom domain registered on the branch and stops routing it.\n\n**Note**: This endpoint is currently in Beta.\n",
        "tags": [
          "Functions"
        ],
        "x-stability-level": "beta",
        "operationId": "deleteProjectBranchCustomDomain",
        "responses": {
          "204": {
            "description": "Custom domain deleted"
          },
          "default": {
            "$ref": "#/components/responses/GeneralError"
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "GeneralError": {
        "description": "General Error.\n\nThe request may or may not be safe to retry, depending on the HTTP method, response status code,\nand whether a response was received.\n\n- If no response is returned from the API, a network error or timeout likely occurred.\n- In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results.\n\nThe following HTTP methods are considered non-idempotent: `POST`, `PATCH`, `DELETE`, and `PUT`. Retrying these methods is generally **not safe**.\nThe following methods are considered idempotent: `GET`, `HEAD`, and `OPTIONS`. Retrying these methods is **safe** in the event of a network error or timeout.\n\nAny request that returns a `503 Service Unavailable` response is always safe to retry.\n\nAny request that returns a `423 Locked` response is safe to retry. `423 Locked` indicates that the resource is temporarily locked, for example, due to another operation in progress.\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GeneralError"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "The Neon API requires an API key to authorize your requests, which you can enter below.\nRefer to our documentation to find out how to generate and use [API keys](https://neon.com/docs/manage/api-keys).\n"
      },
      "CookieAuth": {
        "type": "apiKey",
        "in": "cookie",
        "name": "zenith"
      },
      "TokenCookieAuth": {
        "type": "apiKey",
        "in": "cookie",
        "name": "keycloak_token"
      }
    },
    "schemas": {
      "GeneralError": {
        "type": "object",
        "required": [
          "message",
          "code"
        ],
        "properties": {
          "request_id": {
            "type": "string",
            "description": "Unique identifier for the request, useful for debugging.\nYou can set this value manually by including an `X-Request-ID` header in the request. If not provided, the value will be generated automatically.\n"
          },
          "code": {
            "$ref": "#/components/schemas/ErrorCode",
            "description": "Machine-readable code classifying the error type. See `message` for a human-readable explanation."
          },
          "message": {
            "description": "Error message",
            "type": "string"
          }
        }
      },
      "ErrorCode": {
        "type": "string",
        "default": ""
      }
    }
  }
}
```