# Assign or clear the page’s custom domain

> Source: /api-reference/partner/explorer/pages/assign-custom-domain
> Full replacement; send an empty assignment to clear it. Applies immediately, as the domain is part of the live route.
> Full spec: https://docs.journey.com/openapi/partner.v1.json

## `PUT /v1/partner/pages/{pageGroupId}/custom-domain`

```json
{
  "description": "Full replacement; send an empty assignment to clear it. Applies immediately, as the domain is part of the live route.",
  "operationId": "pagesPartner_assignCustomDomain",
  "parameters": [
    {
      "description": "External id of the page group.",
      "in": "path",
      "name": "pageGroupId",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "Global (Journey staff) callers name the organization they act within.",
      "in": "query",
      "name": "organizationId",
      "required": false,
      "schema": {
        "maxLength": 100,
        "type": "string"
      }
    },
    {
      "description": "Which revision. Required when a page has both a draft and a published\nrevision; otherwise the only revision is used.",
      "in": "query",
      "name": "state",
      "required": false,
      "schema": {
        "enum": [
          "draft",
          "archived",
          "published"
        ],
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/AssignPartnerPageCustomDomainRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "description": "The page’s domain assignment."
    },
    "400": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/PartnerErrorResponse"
          }
        }
      },
      "description": "Request validation failed. `errors` lists the offending fields."
    },
    "401": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/PartnerErrorResponse"
          }
        }
      },
      "description": "No usable credential. Send `Authorization: Bearer <jwt>` or `X-API-Key: jny_...`."
    },
    "403": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/PartnerErrorResponse"
          }
        }
      },
      "description": "The credential authenticated but lacks the scopes in `x-required-scopes`, or the resource belongs to another organization."
    },
    "404": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/PartnerErrorResponse"
          }
        }
      },
      "description": "No such resource, or it is outside the organization the credential resolves to."
    },
    "409": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/PartnerErrorResponse"
          }
        }
      },
      "description": "The request conflicts with the current state of the resource."
    }
  },
  "security": [
    {
      "partnerBearer": []
    },
    {
      "partnerApiKey": []
    }
  ],
  "summary": "Assign or clear the page’s custom domain",
  "tags": [
    "partner/pages"
  ],
  "x-required-scopes": [
    [
      "partner:pages:manage"
    ]
  ]
}
```