Skip to content
Start in HitKeep Cloud

Rename site domain REST API

PUT
/api/sites/{id}/domain
curl --request PUT \
--url https://hitkeep.com/api/sites/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/domain \
--header 'Content-Type: application/json' \
--cookie hk_token=<hk_token> \
--data '{ "domain": "example" }'

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.

id
required
string format: uuid
Media typeapplication/json
object
domain
required

New apex domain without protocol or www prefix (e.g. example.com).

string
Examplegenerated
{
"domain": "example"
}

Renamed site

Media typeapplication/json
object
created_at
string format: date-time
data_retention_days
integer
domain
string
id
string format: uuid
user_id
string format: uuid
Examplegenerated
{
"created_at": "2026-04-15T12:00:00Z",
"data_retention_days": 1,
"domain": "example",
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"user_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

Invalid domain

Media typeapplication/json
object
message
string
Examplegenerated
{
"message": "example"
}

Site not found

Media typeapplication/json
object
message
string
Examplegenerated
{
"message": "example"
}

Domain already in use by another site

Media typeapplication/json
object
message
string
Examplegenerated
{
"message": "example"
}