---
title: "Initiate a file upload"
method: POST
path: "/v1beta/files"
tags: ["Files"]
---

# Initiate a file upload

`POST /v1beta/files`

## Request

- Base URL: `https://api.indices.io`
- URL: `https://api.indices.io/v1beta/files`
- Auth: HTTP bearer

Create a pending file and get a signed URL to PUT the bytes to.

## Request body

- InitiateFileUploadRequest
  - `name` string, required: User-facing filename, e.g. 'report.pdf'.
  - `size_bytes` integer, required: Exact size of the file in bytes. Enforced by the signed upload URL.
  - `content_type` string, required: MIME type of the file content.

## Response `200`

Successful response

- InitiateFileUploadResponse
  - `file_id` string, required: Server-assigned ID of the pending file.
  - `upload_url` string, required: Signed URL the sandbox must PUT the file bytes to.
  - `upload_headers` object, required: Headers that must be sent verbatim with the PUT; they are covered by the URL signature.
  - `expires_at` string, date-time, required: When the upload URL stops being valid.

## Other responses

- `422`: Validation error

---

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