---
title: "Get presigned URL for document upload"
method: POST
path: "/api/v1/knowledge-base/upload-url"
tags: ["main", "knowledge-base"]
---

# Get presigned URL for document upload

`POST /api/v1/knowledge-base/upload-url`

## Request

- Base URL: `https://app.dograh.com`
- URL: `https://app.dograh.com/api/v1/knowledge-base/upload-url`
- Auth: none declared

Generate a presigned PUT URL for uploading a document.

This endpoint:
1. Generates a unique document UUID for organizing the S3 key
2. Generates a presigned S3/MinIO URL for uploading the file
3. Returns the upload URL and document metadata

After uploading to the returned URL, call /process-document to create
the document record and trigger processing.

Access Control:
* All authenticated users can upload documents scoped to their organization.

## Headers

- `authorization` string, nullable
- `X-API-Key` string, nullable

## Request body

- DocumentUploadRequestSchema: Request schema for initiating document upload.
  - `filename` string, required: Name of the file to upload
  - `mime_type` string, required: MIME type of the file
  - `custom_metadata` object, nullable: Optional custom metadata

## Response `200`

Successful Response

- DocumentUploadResponseSchema: Response schema containing upload URL and document metadata.
  - `upload_url` string, required: Signed URL for uploading the file
  - `document_uuid` string, required: Unique identifier for the document
  - `s3_key` string, required: S3 key where file should be uploaded

## Other responses

- `404`: Not found
- `422`: Validation Error

## Changes

- **2026-11-03** `faa00cf76fcb`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/dograh/apis/dograh-api/changes/api/v1/knowledge-base/upload-url/post.md)

---

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