---
title: "Confirm files landed in R2 and publish the preview (live for 24 hours)"
method: POST
path: "/previews/uploads/finalize"
tags: ["Previews"]
---

# Confirm files landed in R2 and publish the preview (live for 24 hours)

`POST /previews/uploads/finalize`

## Request

- Base URL: `https://api.nippy.host`
- URL: `https://api.nippy.host/previews/uploads/finalize`
- Auth: `bearer` (a scheme the document does not define)

## Request body

- FinalizePreviewUploadDto
  - `uploadBatchId` string, uuid, required: Batch id returned by /previews/uploads/init

## Response `200`

Preview is now serving

- APIFinalizePreviewResponse
  - `previewId` string, required
  - `slug` string, required
  - `url` string, required: Public URL the preview now serves at
  - `expiresAt` string, date-time, required: When the preview stops serving (24 h from now; every revision resets it)

## Other responses

- `400`: Batch already finalized, expired, or some expected files are missing
- `401`: Not authenticated
- `403`: The batch does not belong to the authenticated account
- `404`: Upload batch id not found

---

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