---
title: "Upload a document to a collection"
method: POST
path: "/api/rag/{project_id}/documents"
tags: ["RAG"]
---

# Upload a document to a collection

`POST /api/rag/{project_id}/documents`

## Request

- Base URL: `https://core.blink.new`
- URL: `https://core.blink.new/api/rag/{project_id}/documents`
- Auth: HTTP bearer

Upload text content or URL to be chunked and embedded

## Path parameters

- `project_id` string, required

## Request body

- object
  - `collection_id` string
  - `collection_name` string
  - `filename` string, required
  - `content` string: Text content to embed
  - `url` string: URL to fetch and embed
  - `metadata` object

## Response `201`

Document created (processing async)

## Other responses

- `400`: Invalid request
- `401`: Authentication required or invalid API key

---

[API](https://skmtc.dev/blink/apis/blink-apis.md) - [All operations](https://skmtc.dev/blink/apis/blink-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/blink/apis/blink-apis/revisions/4c59c706078e?raw)
