---
title: "Create a site from a folder of files."
method: POST
path: "/api/v1/sites"
tags: ["sites"]
---

# Create a site from a folder of files.

`POST /api/v1/sites`

## Request

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

The site belongs to the account that authorized the call — there is no claim link and no 24-hour expiry, unlike an anonymous deploy to /api/upload. A single shared top-level folder is stripped, junk files (.DS_Store, __MACOSX…) are dropped, and the homepage is chosen as the root index.html if there is one. 50 MB and 500 files.

## Response `201`

Create a site from a folder of files.

- CreateSiteResult
  - `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
  - `deployToken` string, required: Scoped to this one site. Shown here so a CI job can be given it without the account key.

## Other responses

- `400`: `invalidRequest`, `noFiles`
- `401`: `unauthorized`
- `403`: `suspended`
- `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)
