---
title: "Create Source"
method: POST
path: "/api/rag/sources"
tags: ["rag"]
---

# Create Source

`POST /api/rag/sources`

## Request

- Base URL: `https://api.corabea.it` (the document declares no server; this is the origin it was published from)
- URL: `https://api.corabea.it/api/rag/sources`
- Auth: HTTP bearer

Multipart: the file, with its title and tutorials as the JSON `fields` part.

## Response `201`

Successful Response

- AssistantSourceItem
  - `id` string, uuid, required
  - `title` string, required
  - `file_name` string, required
  - `file_type` 'pdf' | 'md' | 'txt', required
  - `file_updated_at` string, date-time, required
  - `url` string, required
  - `state` 'indexed' | 'pending' | 'no_text' | 'failed', required
  - `indexed_at` string, date-time, nullable, required
  - `bots` string[], required
  - `trainings` AssistantSourceTrainingRef[], required
    - `id` string, uuid, required
    - `title` string, required
  - `training_id` string, uuid, nullable

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-16** `841b592f039c`: 1 info
  - added the optional property `training_id` to the response with the `201` status
- **2026-10-15** `2287045764a7`: 1 warning
  - added the new `supervisors` enum value to the `bots/items/` response property for the response status `201`
- **2026-10-15** `f32c7ff0d5a0`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/corabea/apis/corabea-api/changes/api/rag/sources/post.md)

---

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