---
title: "Replace current maindomain with different one"
method: PUT
path: "/v1/sites/{id}/maindomain"
tags: ["Domains"]
---

# Replace current maindomain with different one

`PUT /v1/sites/{id}/maindomain`

Updates the site's domain name

## Path parameters

- `id` integer, required — ID of the Site you are interacting with

## Request body

- PutMainDomainRequest
  - `domain` string — Site's new domain name
  - `active_wordpress_domain` 'cdn_url' | 'live_domain' — Switch between the Live domain name and CDN URL. WARNING: WordPress can only have 1 URL and this will break your live site if you switch to CDN URL
  - `remove_live_domain` boolean — Use this in conjunction with `active_wordpress_domain` set to `cdn_url` to revert this site back to a cdn_url from live domain. Warning: This will cause the live domain to no longer function and will remove all additional domains
  - `convert_addon_to_maindomain` boolean — Use this to convert an addon domain to the maindomain. The `domain` passed will be converted from an addon domain to the maindomain and the existing maindomain will be removed.

## Response `200`

OK

- MainDomainResponse
  - `success` boolean — whether the request succeeded
  - `errors` string[]
  - `messages` string[], nullable

## Other responses

- `400` — Bad Request
- `401` — Authentication failed
- `403` — Not authorized to access endpoint
- `404` — Given site not found for user
- `405` — Invalid input
- `500` — Internal error

---

[API](https://skmtc.net/rocket/apis/rocket-net-api.md) · [All operations](https://skmtc.net/rocket/apis/rocket-net-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/rocket/rocket-net-api/versions/db0dcbbc5764/schema)
