---
title: "Finalize a presigned upload"
method: POST
path: "/documents/uploads/finalize"
tags: ["Documents"]
---

# Finalize a presigned upload

`POST /documents/uploads/finalize`

## Request

- Base URL: `https://dataroom.corgi.com/api/v1`
- URL: `https://dataroom.corgi.com/api/v1/documents/uploads/finalize`
- Auth: HTTP bearer

Step 3 of the presigned flow: after PUTting the file to the `uploadUrl` from POST /documents/uploads, call this with the returned `storageKey` (and `token`) to register the object. By default it creates a NEW document + first version; pass `documentId` to register the object as a NEW VERSION of that existing document instead (it keeps its id and share links). The service confirms the object exists inside your workspace before creating any rows. Scope: `documents:write`.

## Request body

- object
  - `storageKey` string, required: The storageKey returned by POST /documents/uploads
  - `filename` string: Override the document name (defaults to the uploaded filename)
  - `contentType` string: MIME type of the uploaded file (defaults to what storage reports)
  - `folderId` string: Destination library folder id; omit for the top level
  - `documentId` string: Register the upload as a new version of this existing document instead of a new document
  - `token` string: The token returned by POST /documents/uploads (binds the key to this workspace)

## Response `201`

Document (or new version) registered

## Other responses

- `400`: Invalid/missing binding token, invalid key, or empty file
- `404`: Document not found (when documentId is given)
- `409`: File not PUT to the key yet (upload it first), or a concurrent version upload
- `413`: Object exceeds the 100 MiB cap

---

[API](https://skmtc.dev/corgi/apis/dataroom-api.md) - [All operations](https://skmtc.dev/corgi/apis/dataroom-api/llms.txt) - [OpenAPI document](https://skmtc.dev/corgi/apis/dataroom-api/revisions/73f75ef04a00?raw)
