---
title: "Start an upload session"
method: POST
path: "/v1/files/uploads"
tags: ["Files"]
---

# Start an upload session

`POST /v1/files/uploads`

## Request

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

Start a multipart upload of a file of up to 5 GiB, admitted like a one-request upload. Upload every part to upload_url, then complete the upload; the bytes must match size_bytes and sha256.

## Request body

- object
  - `content_type` string
  - `expires_at` string, date-time: Delete the file at this time. Files are kept until deleted when omitted.
  - `metadata` object: Up to 32 string entries and 4096 bytes; keys are letters, digits, '_', '.' or '-'.
  - `overwrite` boolean: Replace a file that already has this path.
  - `path` string, required: The file's path in the project, such as reports/q3.pdf.
  - `sha256` string, required: Lowercase hex SHA-256 of the bytes.
  - `size_bytes` integer, required

## Response `201`

Created.

- object
  - `expires_at` string, date-time, required
  - `file_id` string, uuid, nullable, required
  - `id` string, uuid, required
  - `object` 'file.upload', required
  - `overwrite` boolean, required
  - `part_count` integer, required
  - `part_size_bytes` integer, required
  - `parts` object[], required
    - `part_number` integer, required
    - `size_bytes` integer, required
  - `path` string, required
  - `sha256` string, required
  - `size_bytes` integer, required
  - `status` 'pending' | 'completed', required
  - `upload_url` string, uri, nullable, required: PUT each part to <upload_url>/<part_number> without an API key; null once completed.

## Other responses

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