---
title: "Request KB Source Upload URL"
method: POST
path: "/knowledge-base/sources/upload"
tags: ["Knowledge Base"]
---

# Request KB Source Upload URL

`POST /knowledge-base/sources/upload`

Creates a KB source record and returns a presigned S3 PUT URL for file upload. After uploading the file, call confirm-upload to validate and trigger indexing. Supported file types: PDF, Markdown, HTML, plain text. Maximum file size: 100 MB.

## Request body

- RequestKBSourceUploadRequest
  - `title` string — Title of the KB source. Optional — if omitted, the server attempts to extract the title from PDF metadata, falling back to 'Untitled upload'.

## Response `201`

Upload URL generated successfully

- RequestKBSourceUploadResponse
  - `source_id` string — UUID of the created KB source
  - `upload_url` string — Presigned S3 PUT URL for uploading the file

## Other responses

- `400` — Invalid request parameters
- `401` — Valid API key required
- `default` — Unexpected error

---

[API](https://skmtc.net/attention/apis/attention-service-v2.md) · [All operations](https://skmtc.net/attention/apis/attention-service-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/attention/attention-service-v2/versions/5de55d3804cf/schema)
