---
title: "Replace every file of a site with the uploaded set."
method: POST
path: "/api/v1/sites/{id}/deploy"
tags: ["sites"]
---

# Replace every file of a site with the uploaded set.

`POST /api/v1/sites/{id}/deploy`

## Request

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

The site's whole file list is replaced: paths absent from the upload are deleted from storage. Form submissions belong to the site, not to the deploy, and survive. The web address does not change. 50 MB and 500 files.

## Path parameters

- `id` string, required

## Response `200`

Replace every file of a site with the uploaded set.

- DeployResult
  - `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
  - `replaced` integer, required: How many files the site now serves.

## Other responses

- `400`: `invalidRequest`, `noFiles`
- `401`: `unauthorized`
- `403`: `suspended`
- `404`: `siteNotFound`
- `413`: `tooLarge`, `tooManyFiles`

---

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