---
title: "Rename a site, change its web address, or both."
method: PATCH
path: "/api/v1/sites/{id}"
tags: ["sites"]
---

# Rename a site, change its web address, or both.

`PATCH /api/v1/sites/{id}`

## Request

- Base URL: `https://harvis.dev`
- URL: `https://harvis.dev/api/v1/sites/{id}`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `better-auth.session_token`

Absent fields are left alone. A subdomain is unique across the whole service, not just this account, so a taken one is refused rather than queued.

## Path parameters

- `id` string, required

## Request body

- UpdateSiteInput
  - `name` string: A label for the dashboard; not shown to visitors.
  - `subdomain` string: 5–63 lowercase letters, numbers or hyphens. The site moves to it immediately.

## Response `200`

Rename a site, change its web address, or both.

- SiteResult
  - `site` Site, required
    - `id` string, required
    - `name` string, required
    - `subdomain` string, required
    - `url` string, required: Where the site is served, e.g. https://sunny-otter-42.harvis.page.
    - `entrypoint` string, required: The file served at the site's root.
    - `fileCount` integer, required
    - `totalSize` integer, required: Bytes stored, summed over every file.
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required

## Other responses

- `400`: `invalidRequest`, `nameRequired`, `subdomainInvalid`
- `401`: `unauthorized`
- `403`: `suspended`
- `404`: `siteNotFound`
- `409`: `subdomainTaken`

---

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