---
title: "Initialise an in-place edit — validate the upserts/deletes and return presigned PUT URLs for the upserts. Supersedes any revision still pending for the site."
method: POST
path: "/sites/{id}/revisions/init"
tags: ["Sites"]
---

# Initialise an in-place edit — validate the upserts/deletes and return presigned PUT URLs for the upserts. Supersedes any revision still pending for the site.

`POST /sites/{id}/revisions/init`

## Request

- Base URL: `https://api.nippy.host`
- URL: `https://api.nippy.host/sites/{id}/revisions/init`
- Auth: `bearer` (a scheme the document does not define)

## Path parameters

- `id` string, required

## Request body

- InitRevisionDto
  - `upserts` InitUploadFileDto[]: Files to add or replace. A path that already exists is a replace; a new path is an append.
    - `name` string, required: Filename including extension
    - `size` number, required: File size in bytes
    - `contentType` string, required: MIME type the browser will use when uploading
  - `deletes` string[]: Relative paths to remove from the live site.

## Response `200`

Revision accepted — PUT the upserts to the returned URLs, then finalize. `files` is empty for a pure-delete revision.

- APIInitUploadResponse
  - `uploadBatchId` string, required
  - `subdomain` string, required: Subdomain the file will be served from. May differ from the requested value if disambiguation was applied.
  - `expiresAt` string, date-time, required
  - `files` APIPresignedFile[], required
    - `name` string, required: Original filename as supplied to /uploads/init
    - `uploadUrl` string, required: Presigned PUT URL — bind exact ContentType + Content-Length
    - `key` string, required: R2 object key the file will land at

## Other responses

- `400`: No changes requested, file validation failed, a delete target is unknown, or the resulting site would exceed the caps
- `401`: Not authenticated
- `403`: You do not own this site
- `404`: Site not found
- `409`: Site is not live

---

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