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

# Complete an upload session

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

## Request

- Base URL: `https://api.dexto.ai`
- URL: `https://api.dexto.ai/v1/files/uploads/{upload_id}/complete`
- Auth: HTTP bearer

Assemble the parts into the file. Bytes that do not match size_bytes and sha256 are discarded with the upload (400). Completing again returns the file.

## Path parameters

- `upload_id` string, required

## Response `200`

Replaced the file at this path, or the upload was already complete.

- object
  - `content_type` string, required
  - `created_at` string, date-time, required
  - `created_by` object, required: The key, agent or person that wrote the file first; a key or agent is null once deleted.
    - `agent_id` string, uuid, nullable, required
    - `api_key_id` string, uuid, nullable, required
    - `user_id` string, nullable, required: The person who wrote it, by their key or an OAuth token; null for agents and deployed code.
  - `expires_at` string, date-time, nullable, required
  - `id` string, uuid, required
  - `metadata` object, required
  - `object` 'file', required
  - `path` string, required
  - `sha256` string, required
  - `size_bytes` integer, required
  - `updated_at` string, date-time, required

## Other responses

- `201`: Created the file.
- `400`: Invalid JSON or request fields.
- `401`: Missing or invalid API key.
- `402`: The account has insufficient credits.
- `403`: The account cannot perform this operation.
- `404`: The requested resource was not found.
- `409`: The request conflicts with existing resource state.
- `429`: The account exceeded this operation's request rate.
- `500`: Unexpected Dexto failure.
- `502`: The upstream model provider failed.
- `503`: A required Dexto service is temporarily unavailable.

---

[API](https://skmtc.dev/dexto/apis/dexto-api.md) - [All operations](https://skmtc.dev/dexto/apis/dexto-api/llms.txt) - [OpenAPI document](https://skmtc.dev/dexto/apis/dexto-api/revisions/47eb880cffa5?raw)
