# Update a project

`PUT /v1/upload`

Update project settings or replace content while keeping the hostname.

**Effect.** Content files replace the existing file set. A settings-only or image-only update to an owned project keeps the existing files. Omitting `domain` or sending an unused hostname with files can create a new project.

## Authentication

Send `x-api-key: <key>`. Confirm the target with the user and use the exact `subdomain` returned by [Fetch profile](../fetch-profile/).

## Request

`Content-Type: multipart/form-data`. Use the [Create a project fields](../create-project/#request) with these update rules:

| Field | Required for an update | Behavior |
| --- | --- | --- |
| `domain` | Yes | Existing owned hostname, without scheme or path. |
| `files` | For content replacement | Repeat the binary part once per file. Include all files that should remain hosted. Omit files for a settings-only or image-only update to an owned project. |
| `settings`, `ogImageFile`, `logoImageFile` | For updates without files, provide a nonempty settings change or supported image | Settings are a JSON-encoded multipart text part; image fields are binary parts. |

The server detects updates by hostname. Leave out the `isUpdate` field.

To remove a file under this contract, upload a complete replacement that excludes it. The public API documented here does not offer a per-file inventory, so retain a local copy of the source files and verify the intended set before updating. See [Project data](../../sites/site-data/).

Explore [Projects](../../sites/) for individual workflows, including [access control](../../sites/access-control/), [search indexing](../../sites/search-indexing/), [visitor comments](../../sites/comments/), [link appearance](../../sites/metadata/), and [custom domains](../../sites/domains/).

## Example

```bash
curl --fail-with-body -X PUT https://ext.tiiny.host/v1/upload \
  -H "x-api-key: $TIINY_API_KEY" \
  -F 'domain=example.tiiny.site' -F 'files=@site.zip'
```

## Change settings without uploading files

```bash
curl --fail-with-body -X PUT https://ext.tiiny.host/v1/upload \
  -H "x-api-key: $TIINY_API_KEY" \
  -F 'domain=example.tiiny.site' \
  --form-string 'settings={"comments":true}'
```

The existing files remain in place. See [Project settings](../../guides/project-settings/) for supported fields.

## Success response

`200 OK` returns the [upload result](../create-project/#success-response). The normal envelope contains `data.link`, `data.inPreviewMode`, and `data.linkPreviewType`. Use the returned hostname and inspect the preview status.

Open the returned link and check the updated page and important assets. If the response times out, inspect the project before retrying; listing the hostname alone does not confirm which files were applied. See [recover from an uncertain upload](../../errors/#recover-from-an-uncertain-upload).

## Errors

| HTTP | Condition |
| --- | --- |
| 400 | Invalid hostname, missing or empty content, or `INVALID_SITE_SETTINGS`. Inspect the [field-level errors](../../sites/settings/#validation-response). |
| 401 | Missing key or the target is owned by another account. |
| 403 | Key without API access, or `CUSTOM_DOMAIN_NOT_OWNED` when `domain` is on a custom domain that is not connected to your account. |
| 413 | File, storage, or gateway limit. Updates to projects you own are exempt from the API's new-project count checks. |
| 429 | `RATE_LIMIT_EXCEEDED`. Wait for the daily quota to reset. |
