---
title: "Upload File"
method: POST
path: "/knowledge/{knowledge_base_id}/upload"
tags: ["knowledge"]
---

# Upload File

`POST /knowledge/{knowledge_base_id}/upload`

Upload a file directly to a knowledge base.

This is a simplified alternative to the three-step upload process
(get_upload_url -> upload to S3 -> register_file). Use this endpoint
for smaller files or when you prefer a simpler API.

The file will be uploaded to S3 and queued for processing automatically.

## Path parameters

- `knowledge_base_id` string, uuid, required — The id of the knowledge base to upload the file to

## Response `201`

Successful Response

- UploadFileResponse
  - `id` string, uuid, required
  - `key` string, required
  - `original_filename` string, required
  - `document_id` integer, required
  - `metadata` object

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `402` — Payment Required (out of credits)
- `404` — Not Found
- `422` — Request Validation Error

---

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