---
title: "Get a presigned URL to upload a file"
method: POST
path: "/v1/uploads/presign"
tags: ["Uploads"]
---

# Get a presigned URL to upload a file

`POST /v1/uploads/presign`

Returns a presigned S3 URL plus the s3Key the file lands at. PUT the raw file bytes to that URL, then call the feature tool (e.g. upload-and-parse) with the s3Key instead of sending file data. Bytes never pass through the LLM.

## Headers

- `X-Organization-Id` string

## Request body

- CreateUploadUrlDto
  - `purpose` 'questionnaire' | 'policy_pdf' | 'evidence' | 'attachment' | 'document' | 'general', required — What the file is for. Controls where the file is stored and which feature is expected to consume the returned s3Key.
  - `fileName` string, required — Original filename, used for the stored object name. Non-alphanumeric characters are replaced with underscores.
  - `fileType` string, required — MIME type of the file (e.g. application/pdf, text/csv). Recorded as metadata and passed to the feature endpoint; the PUT itself is content-type agnostic, so the upload never fails on a header mismatch.

## Response `201`

- UploadUrlResponseDto
  - `uploadUrl` string, required — Presigned S3 URL. Send the raw file bytes with a plain HTTP PUT to this URL — no Content-Type or auth headers are required (the signature is in the URL). Then call the feature endpoint with the s3Key below.
  - `s3Key` string, required — The S3 key the file will land at. Pass this to the feature endpoint (e.g. questionnaire upload-and-parse) instead of base64 file data.
  - `expiresIn` number, required — Seconds until the presigned URL expires.

## Changes

> 56 revisions in range; 4 could not be searched.

- **2026-06-05** `33c685841b7a` — 1 info
  - added the new `document` enum value to the request property `purpose`
- **2026-06-05** `7ca7c363a732` — 1 breaking
  - removed the enum value `document` of the request property `purpose`
- **2026-06-05** `d0f58f24175b` — 1 info
  - added the new `document` enum value to the request property `purpose`
- **2026-06-04** `d7d0199d846f` — 1 info
  - the endpoint scheme security `oauth2` was removed from the API
- **2026-05-29** `5382c53ab431` — 1 info
  - the endpoint scheme security `oauth2` was added to the API

[Full history](https://skmtc.dev/trycompai/apis/comp-ai-api/changes/v1/uploads/presign/post.md)

---

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