PUT /api/v1/sites/:site_id
Updates a site’s domain and/or tracker script configuration. You can change the domain, update tracker settings, or both in a single request. Requires thesites:provision:* API scope and at least editor-level access to the site.
Authentication
Requires a valid API key with thesites:provision:* scope passed in the Authorization header.
Path Parameters
string
required
The domain of the site to update. Can be the current domain or the previous domain if it was changed.Examples:
example.com, blog.example.comRequest Body
At least one of
domain or tracker_script_configuration must be provided.string
The new domain for the site. Must be different from the current domain.The domain will be automatically normalized (lowercased, stripped of protocol/www prefix).
object
Tracker script configuration settings to update. Only the fields you provide will be updated; other fields will retain their current values.
Response
string
The domain of the site (updated if changed).
string
The timezone of the site.
array
List of allowed custom event properties for the site.
object
The complete tracker script configuration after the update.
Notes
- Domain changes and tracker configuration updates are performed as a transaction - if one fails, both are rolled back
- You must have at least editor-level access to update a site (owner, admin, or editor role)
- When updating tracker configuration, only the fields you specify are changed - all other fields keep their existing values
- Consolidated views cannot be updated via this API
- The old domain is preserved in the database and can still be used to access the site after a domain change