---
title: "Rename site domain"
method: PUT
path: "/api/sites/{id}/domain"
tags: ["Sites"]
---

# Rename site domain

`PUT /api/sites/{id}/domain`

## Request

- Base URL: `https://demo.hitkeep.com`
- URL: `https://demo.hitkeep.com/api/sites/{id}/domain`
- Auth: one of:
  - API key in cookie `hk_token`
  - HTTP bearer
  - API key in header `X-API-Key`

Renames the tracked domain of a site while keeping its analytics history. Requires site.manage_data (site admin or higher). The tracker only matches hits for the new domain after the rename.

## Path parameters

- `id` string, uuid, required

## Request body

- object
  - `domain` string, required: Apex domain or subdomain without protocol, port, path, query, fragment, or www prefix (e.g. example.com or blog.example.com).

## Response `200`

Renamed site

- Site
  - `created_at` string, date-time
  - `data_retention_days` integer
  - `domain` string
  - `id` string, uuid
  - `user_id` string, uuid

## Other responses

- `400`: Invalid domain
- `404`: Site not found
- `409`: Domain already in use by another site

---

[API](https://skmtc.dev/hitkeep/apis/hitkeep-rest-api.md) · [All operations](https://skmtc.dev/hitkeep/apis/hitkeep-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hitkeep/apis/hitkeep-rest-api/revisions/bb2df36ab2a4?raw)
