---
title: "Upload file"
method: POST
path: "/files"
tags: ["Files"]
---

# Upload file

`POST /files`

Upload a file that can be used with the Batch API.
The Batch API only supports `.jsonl` files with a specific required format.

## Request body

- object
  - `file` string, required — The <a href="https://w3c.github.io/FileAPI/#file-section" target="_blank">file object</a> (not file name) to be uploaded.
  - `purpose` string, required — The intended purpose of the uploaded file. Currently, this value must be set to `batch`.

## Response `200`

Success

- FileObject
  - `id` string — The file identifier.
  - `object` string — The object type, which is always `file`.
  - `bytes` integer — The size of the file, in bytes.
  - `created_at` string — RFC 3339 datetime string for when the file was created.
  - `expires_at` string — RFC 3339 datetime string for when the file expires. Currently, this is 30 days after the file is created.
  - `filename` string — The name of the file.
  - `purpose` string — The intended purpose of the file. Supported values are `batch`, `batch-output`, and `batch-error`.

## Other responses

- `4XX` — Client error <p> This indicates an issue with the request format or frequency. Please see our [Error Codes](https://docs.voyageai.com/docs/error-codes) guide. </p>
- `5XX` — Server Error <p> This indicates our servers are experiencing high traffic or having an unexpected issue. Please see our [Error Codes](https://docs.voyageai.com/docs/error-codes) guide. </p>

---

[API](https://skmtc.net/voyageai/apis/voyage-api.md) · [All operations](https://skmtc.net/voyageai/apis/voyage-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/voyageai/voyage-api/revisions/b5a3e09c43ce/schema)
