---
title: "Upload and process files"
method: POST
path: "/api/v1/upload/process"
tags: ["Upload"]
---

# Upload and process files

`POST /api/v1/upload/process`

## Request

- Base URL: `https://backend.caspr.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://backend.caspr.ai/api/v1/upload/process`
- Auth: OAuth 2
  - Password
  - Token URL: `token`

Accept up to 3 files (binary, max 25 MB each) and/or previously-uploaded file IDs (reference_ids) from the user's library. Total files (new + library) must not exceed 3. Kicks off a background task that uploads to S3 and indexes the documents for grep-backed search. Progress is streamed via SSE on ``GET /upload/process-stream/{upload_session_id}``.

## Request body `multipart/form-data`

- BodyUploadProcessApiV1UploadProcessPost
  - `upload_session_id` string, required: Upload session ID from POST /upload/create-session
  - `chat_id` string, required: Chat ID that these files will be associated with
  - `reference_ids` string, nullable: JSON array of uploaded_files.id from library, e.g. '["id1","id2"]'
  - `files` string[]: Files to upload (max 3 files, 25 MB each)

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

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