Skip to Content
Docs

POST /api/manage_source_files

POST
/api/manage_source_files

Add files, remove files, remove directories, or replace the whole file set (sync) of an existing source. The source is then re-ingested: only added, removed and edited files are re-embedded.

Personal access token scope: sources:write.

Authorization

bearer
headerAuthorizationBearer <token>

A session token or a personal access token. Leave it empty when the instance runs without authentication (AUTH_TYPE unset).

Request Body

application/json
  1. body
directory_path?string

Directory path to remove (for remove_directory operation)

file?

Files to add (for add operation) or the new file set (for sync)

file_paths?array<string>

File paths to remove (for remove operation)

operation*string

Operation: 'add', 'remove', 'remove_directory', or 'sync' (the uploaded files and ZIPs become the source's whole file set; files not in the upload are removed)

parent_dir?string

Parent directory path relative to source root

source_id*string

Source ID to modify

Response Body

Success

Example Request
curl -X POST 'http://localhost:7091/api/manage_source_files' \  -H 'Content-Type: application/json' \  -d '{  "operation": "string",  "source_id": "string"}'
Example Response200
Empty