Add a knowledge base source — file, URL, or inline text (auto-creates the KB)
The single endpoint to add content to a knowledge base. You don’t create a KB first — we auto-create one (named from name, the filename, or the URL) and attach your source. Returns a job_id; ingestion (parse → S3 → token count → vector index) runs in the background — poll GET /v1/knowledge-bases/{kb_id}/jobs/{job_id}.
Three call shapes, one endpoint:
- File upload (multipart/form-data):
file=@path/to/doc.pdf. Allowed: pdf, docx, xlsx/xls, txt, md. - URL (multipart):
type=url&source=https://... - Inline text (multipart):
type=text&source=...
The response’s source.knowledge_base_id is the new KB id. To remove a source, use DELETE /v1/knowledge-bases/{kb_id}/sources/{source_id}.
Authorizations
Your API key sent as a Bearer credential — Authorization: Bearer <api_key>, where <api_key> starts with oi_sk_ (create one via POST /v1/api-keys). Although the field is labelled 'token', paste your API key here. A dashboard JWT is also accepted on this header for the same endpoints.
Body
Response
Successful Response