---
title: "Complete file upload"
method: POST
path: "/api/v1/files/uploads/{upload_id}/complete"
tags: ["Files"]
---

# Complete file upload

`POST /api/v1/files/uploads/{upload_id}/complete`

## Request

- Base URL: `https://api.studio.kaitoi.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.studio.kaitoi.io/api/v1/files/uploads/{upload_id}/complete`
- Auth: HTTP bearer

Verifies that the bytes were uploaded to the signed URL returned by `Create file upload session`, then promotes the object to a durable REST API file record. This call is idempotent by `upload_id`; retrying after a successful completion returns the same file metadata. When the session was created with `sha256`, the API verifies the stored object's SHA-256 before completing it.

## Path parameters

- `upload_id` string, required

## Headers

- `authorization` string, nullable

## Request body

- PublicFileUploadCompleteRequest
  - `actualSizeBytes` integer, nullable: Optional client-observed byte count.
  - `actualSha256` string, nullable: Optional client-observed lowercase hex SHA-256. Required for multipart uploads when the session was created with sha256.
  - `multipartParts` PublicMultipartUploadPart[], nullable: Required for multipart uploads. Use the ETag returned by each part PUT response.
    - `partNumber` integer, required
    - `etag` string, required

## Response `200`

Completed file metadata.

- PublicFileDetail
  - `fileId` string, required: Stable file identifier for REST API inputs and outputs.
  - `filename` string, required: Original filename supplied by the developer.
  - `contentType` string, required: Detected or supplied media type.
  - `sizeBytes` integer, required: Stored file size in bytes.
  - `externalId` string, nullable: Developer-provided external file identifier.
  - `externalUserId` string, nullable: Developer-provided end-user identifier.
  - `externalWorkspaceId` string, nullable: Developer-provided workspace/team identifier.
  - `createdAt` string, date-time, required: Upload timestamp.
  - `updatedAt` string, date-time, required: Last metadata update timestamp.

## Other responses

- `401`: Missing, malformed, expired, or revoked bearer token.
- `403`: The API key lacks the required scope or account capability.
- `404`: The upload session does not exist.
- `410`: The upload session expired or was aborted.
- `422`: The uploaded object failed completion verification.
- `429`: The client or API key exceeded the REST API rate limit.
- `503`: The shared REST API rate limiter is temporarily unavailable.

---

[API](https://skmtc.dev/kaitoi/apis/kaitoi-rest-api.md) · [All operations](https://skmtc.dev/kaitoi/apis/kaitoi-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/kaitoi/apis/kaitoi-rest-api/revisions/239a74aa2c64?raw)
