Programmatic Ingestion REST API
Automate your knowledge sync workflows by pushing files and database records directly to the ToolsWallet Ingestion API from your backend servers, cron jobs, or CI/CD pipelines.
1. Upload File via API (Multipart Form-Data)
Upload a .json, .txt, or .md file directly to a Knowledge Base:
Endpoint: POST http://localhost:8081/api/ingest/file
cURL Command:
curl -X POST http://localhost:8081/api/ingest/file \
-H "Authorization: Bearer YOUR_AUTH_TOKEN" \
-F "ragId=YOUR_RAG_ID" \
-F "file=@faq.json"2. Sync Raw Text or JSON Snippet
Push raw markdown or JSON string data programmatically:
Endpoint: POST http://localhost:8081/api/ingest/text
cURL Command:
curl -X POST http://localhost:8081/api/ingest/text \
-H "Authorization: Bearer YOUR_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"ragId": "YOUR_RAG_ID",
"text": "# Refund Policy\n100% full refund within 30 days of purchase."
}'3. Deduplication & Response Format
The API returns the exact count of new records indexed and your total quota status:
{
"success": true,
"message": "Successfully indexed 4 passages into Knowledge Base (5 / 25 total).",
"chunksIndexed": 4,
"totalChunks": 5,
"quotaLimit": 25
}