---
title: "Set a domain for a Site"
method: POST
path: "/v1/sites/{id}/maindomain"
tags: ["Domains"]
---

# Set a domain for a Site

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

This can only be done on sites that are not staging sites. Once this is done, you must use PUT to change the maindomain

## Path parameters

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

## Request body

- SetMainDomainRequest
  - `domain` string — Site's domain name
  - `keep_cdn_url` boolean — When set, DNS records for the live domain will be returned but the WordPress install will stay on the CDN URL (WordPress can only have one domain). This is useful for testing the site before going live while setting TXT records for SSL and Hostname validation

## 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)
