Ingesting documents
Upload a file, ingest a URL, or manage documents via the API — parsing, sanitization, and chunking all run through the same pipeline.
Anything you add through the dashboard's Knowledge tab is also reachable over the API — useful for scripting bulk uploads or building your own admin tooling.
Upload a file
curl -s https://apibr.aize.dev/v1/documents \
-H "Authorization: Bearer $BRAIZE_API_KEY" \
-F "[email protected]"Accepted types: PDF, DOCX, XLSX, CSV, MD, HTML, and images, up to 100MB, malware-scanned at ingest. Every upload runs through the same pipeline — parsed, sanitized (HTML stripped, hidden instructions removed before indexing), chunked, and embedded.
Sync vs. async: small files return 200 immediately with the result.
Large uploads (or ?mode=async) return 202 right away and ingest out of
band — poll GET /v1/documents/{document_id} and watch parse_status go
from pending to ok (or failed / quarantined).
Ingest a URL
curl -s https://apibr.aize.dev/v1/documents/url \
-H "Authorization: Bearer $BRAIZE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/pricing"}'This ingests the single page at that URL — not a crawl of the site around it. To re-index a URL-backed document after its source page changes, re-ingest it explicitly:
curl -s -X POST https://apibr.aize.dev/v1/documents/{document_id}/refresh \
-H "Authorization: Bearer $BRAIZE_API_KEY"This creates a new version of the document; the answer cache clears for anything that depended on the old version. There is no automatic change-detection yet — re-ingest on your own schedule (a cron, a CMS webhook you control) until that ships.
List and inspect documents
# List, newest first, with optional filters
curl -s "https://apibr.aize.dev/v1/documents?limit=50&q=pricing" \
-H "Authorization: Bearer $BRAIZE_API_KEY"
# One document's detail + version history
curl -s https://apibr.aize.dev/v1/documents/{document_id} \
-H "Authorization: Bearer $BRAIZE_API_KEY"GET /v1/documents supports limit (≤200), an opaque cursor for the next
page (never parse it — treat it as a token), a free-text q search over
title/filename/URL, and source_id / sync_status filters. Every document
carries a freshness_score (0–100) and a sync_status you can use to build
your own ingestion dashboard.
Delete a document
curl -s -X DELETE https://apibr.aize.dev/v1/documents/{document_id} \
-H "Authorization: Bearer $BRAIZE_API_KEY"Soft-deletes the document and enqueues a content + vector purge — complete within 24 hours (see Trust Center for the full purge guarantee).
What's next
- Rate limits & quotas — pages indexed counts against your plan's cap.
- Full schemas: API reference.