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

# Upload a file

`POST /v2/files`

Files are used to upload documents that can be used with features like Deployments.

## Request body

- CreateFileRequest
  - `filename` string, required — Name to store for the uploaded file, including extension when available.
  - `content` string, bytes, required — Base64-encoded file contents.
  - `purpose` 'FILE_PURPOSE_UNSPECIFIED' | 'FILE_PURPOSE_RETRIEVAL' | 'FILE_PURPOSE_KNOWLEDGE_DATASOURCE' | 'FILE_PURPOSE_BATCH' | 'FILE_PURPOSE_CODE_INTERPRETER'
  - `content_type` string — MIME type of the uploaded content, for example `application/pdf`.
  - `project_id` string — Project the file is created in. Optional: project-scoped API keys default to the key's bound project; workspace-scoped callers default to the workspace's default project.

## Response `200`

OK

- CreateFileResponse
  - `file` File, required
    - `file_id` string, required — Unique file identifier assigned by ORQ.
    - `purpose` 'FILE_PURPOSE_UNSPECIFIED' | 'FILE_PURPOSE_RETRIEVAL' | 'FILE_PURPOSE_KNOWLEDGE_DATASOURCE' | 'FILE_PURPOSE_BATCH' | 'FILE_PURPOSE_CODE_INTERPRETER', required
    - `file_name` string, required — Display file name, including extension when available.
    - `bytes` string, required — Size of the uploaded file in bytes.
    - `created_at` string, date-time, required — Time when the file was created.
    - `project_id` string, required — Identifier of the project the file belongs to. Files are project-scoped; an API key may only access files in projects it is authorized for.

## Changes

> 257 revisions in range; 71 not diffed.

- **2026-07-17** `2f27caf6888c` — 1 warning, 1 info
  - added the new `FILE_PURPOSE_CODE_INTERPRETER` enum value to the `file/allOf[#/components/schemas/File]/purpose` response property for the response status `200`
  - added the new `FILE_PURPOSE_CODE_INTERPRETER` enum value to the request property `purpose`
- **2026-07-16** `bee257c5b248` — 1 breaking, 1 info
  - removed the enum value `FILE_PURPOSE_CODE_INTERPRETER` of the request property `purpose`
  - removed the `FILE_PURPOSE_CODE_INTERPRETER` enum value from the `file/allOf[#/components/schemas/File]/purpose` response property for the response status `200`
- **2026-07-16** `801f61a5a056` — 1 warning, 1 info
  - added the new `FILE_PURPOSE_CODE_INTERPRETER` enum value to the `file/allOf[#/components/schemas/File]/purpose` response property for the response status `200`
  - added the new `FILE_PURPOSE_CODE_INTERPRETER` enum value to the request property `purpose`
- **2026-07-16** `42d5d2062527` — 1 breaking, 1 info
  - removed the enum value `FILE_PURPOSE_CODE_INTERPRETER` of the request property `purpose`
  - removed the `FILE_PURPOSE_CODE_INTERPRETER` enum value from the `file/allOf[#/components/schemas/File]/purpose` response property for the response status `200`
- …earlier changes not shown

[Full history](https://skmtc.dev/orq-ai/apis/orq-ai-api/changes/v2/files/post.md)

---

[API](https://skmtc.dev/orq-ai/apis/orq-ai-api.md) · [All operations](https://skmtc.dev/orq-ai/apis/orq-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/orq-ai/orq-ai-api/revisions/359a7831a2f0/schema)
