API reference¶
Everything lives under /api/v1. This page covers the conventions every
endpoint shares and lists the endpoints. The pages below describe each
endpoint fully: every parameter, its allowed values and default, the
response, the errors and examples.
| Page | Endpoints |
|---|---|
| Shared options | Chunking options, metadata, metadata filters, document access, searching as a user, conflicts, the upload response |
| Projects | Create, list, get, change and delete projects; index status and reindexing |
| Adding documents | Upload files, send text, fetch URLs, import from S3, sync |
| Documents | List, get, change, delete, re-process and preview documents; set access in bulk; chunks and parents |
| Retrieval and reranking | Search one project or several, every retrieval option; rerank any texts |
| Knowledge graph | Graph status, build, delete; browse entities, neighbourhoods and relations |
| Jobs | Background jobs: list, poll, cancel; the result of each kind |
| Authentication and access | API keys, /auth/me, access groups |
| LLM and evaluation | The LLM and its check; test questions and retrieval evaluation |
| Data, embeddings and vector DB | File types, chunking preview, text search languages, embeddings, the raw vector DB API, the health checks |
The running server also documents every field:
- Swagger UI: http://localhost:8000/docs (click Authorize to send a key)
- ReDoc: http://localhost:8000/redoc
- OpenAPI schema: http://localhost:8000/openapi.json, for generating a client
Conventions¶
Paths are relative to /api/v1. The examples in these pages use:
Authentication. When authentication
is on, every endpoint except GET / and GET /health needs an API key, sent as
Authorization: Bearer <key> or X-API-Key: <key>. A key has a scope:
read for GET requests and retrieval, write for changes, admin for
keys, access groups and the vector DB API. It can also be limited to some
projects, or bound to a user. See Scopes.
Bodies are JSON, except file uploads (POST .../documents and
POST /data/preview), which are multipart/form-data. Most JSON bodies
refuse unknown fields (422), so a typo in an option name is an error, not
silently ignored.
Pagination. Lists take page (from 1) and page_size (default 50, at
most 200), and answer with the items plus total, page and page_size.
Background work. Ingestion, re-processing, reindexing and graph builds
can run as jobs: send background: true and the request
answers 202 with a job_id to poll.
Users. Documents can carry an access list.
Retrieval, document reads and graph browsing then take a user (and
groups) to answer as that user; see
Searching as a user.
Datetimes are ISO 8601 strings.
Endpoints¶
Projects¶
| Endpoint | |
|---|---|
POST /projects |
Create a project |
GET /projects |
List projects |
GET /projects/{id} |
Get a project |
PATCH /projects/{id} |
Change its name, description, chunking defaults, keyword language or graph settings |
DELETE /projects/{id} |
Delete it with everything in it |
GET /projects/{id}/index |
Whether its index matches the configured vector DB and model |
POST /projects/{id}/reindex |
Rebuild what is stale or failed |
Adding documents¶
| Endpoint | |
|---|---|
POST /projects/{id}/documents |
Upload files (multipart); archives are expanded |
POST /projects/{id}/documents/text |
Text, Markdown, HTML or JSON in the body |
POST /projects/{id}/documents/url |
Web pages or files by URL, optionally crawling a site |
POST /projects/{id}/documents/s3 |
S3 objects by prefix or key |
POST /projects/{id}/sync |
Re-read web and S3 documents and re-index what changed |
Documents¶
| Endpoint | |
|---|---|
GET /projects/{id}/documents |
List documents, with filters |
GET /projects/{id}/documents/{doc} |
Get a document, optionally with its text |
PATCH /projects/{id}/documents/{doc} |
Change its metadata, external id or access |
PUT /projects/{id}/documents/access |
Set the access of many documents |
DELETE /projects/{id}/documents/{doc} |
Delete it |
POST /projects/{id}/documents/{doc}/process |
Re-chunk it with other options |
POST /projects/{id}/documents/{doc}/preview |
Show how other options would chunk it |
GET /projects/{id}/documents/{doc}/chunks |
Its chunks |
GET /projects/{id}/documents/{doc}/parents |
Its parent chunks |
Retrieval and reranking¶
| Endpoint | |
|---|---|
POST /projects/{id}/retrieve |
The most relevant chunks of a project, with citations |
POST /retrieve |
The same across several projects |
POST /rerank |
Rerank any list of texts |
GET /rerank/model |
The configured reranker |
Knowledge graph¶
| Endpoint | |
|---|---|
GET /projects/{id}/graph |
Settings, size and pending chunks |
POST /projects/{id}/graph/build |
Extract entities and relations |
DELETE /projects/{id}/graph |
Delete the graph |
GET /projects/{id}/graph/entities |
Search and list entities |
GET /projects/{id}/graph/entities/{entity} |
An entity, its mentions and related entities |
GET /projects/{id}/graph/entities/{entity}/subgraph |
Its neighbourhood, to draw |
GET /projects/{id}/graph/relations |
Relations, by entity or document |
Jobs¶
| Endpoint | |
|---|---|
GET /projects/{id}/jobs |
List jobs |
GET /projects/{id}/jobs/{job} |
Get a job with its progress and result |
POST /projects/{id}/jobs/{job}/cancel |
Cancel a job |
Authentication and access groups¶
| Endpoint | |
|---|---|
GET /auth/me |
The current key: scope, projects, user |
POST /auth/keys |
Create a key (admin) |
GET /auth/keys |
List keys (admin) |
GET /auth/keys/{key} |
Get a key (admin) |
DELETE /auth/keys/{key} |
Revoke a key (admin) |
PUT /access/groups/{name} |
Create or update a group (admin) |
GET /access/groups |
List groups (admin) |
GET /access/groups/{name} |
Get a group with its members (admin) |
DELETE /access/groups/{name} |
Delete a group (admin) |
POST /access/groups/{name}/members |
Add users (admin) |
POST /access/groups/{name}/members/remove |
Remove users (admin) |
GET /access/users/{user_id}/groups |
A user's stored groups (admin) |
LLM and evaluation¶
| Endpoint | |
|---|---|
GET /llm/model |
The configured LLM |
POST /llm/check |
Test the LLM: reachable, latency, tokens |
POST /projects/{id}/evaluation/questions |
Generate test questions |
POST /projects/{id}/evaluate |
Score retrieval configs on test questions |
Data, embeddings and vector DB¶
| Endpoint | |
|---|---|
GET / |
App name and version (liveness check, no key needed) |
GET /health |
Readiness: Postgres and the vector DB answer; 503 when not (no key needed) |
GET /data/file-types |
File types, chunking strategies, defaults, limits |
GET /data/text-search-languages |
Languages the keyword index can use |
POST /data/preview |
Chunk one file without storing it |
GET /embeddings/model |
The embedding model |
POST /embeddings |
Embed texts |
GET /vectordb/collections |
List collections (admin) |
POST /vectordb/collections |
Create a collection (admin) |
GET /vectordb/collections/{name} |
Collection info (admin) |
DELETE /vectordb/collections/{name} |
Delete a collection (admin) |
POST /vectordb/collections/{name}/records |
Insert records (admin) |
POST /vectordb/collections/{name}/search |
Search records (admin) |
POST /vectordb/collections/{name}/records/delete |
Delete records (admin) |
Status codes¶
Errors return {"detail": "..."} with a readable reason. Validation
errors (422) list each invalid field in detail.
| Status | When |
|---|---|
| 200 | Success |
| 201 | Created: a project, an API key, a collection, a new access group |
| 202 | Accepted: the work runs as a background job; poll the job_id |
| 204 | Success with no body (deletes) |
| 400 | Invalid values the schema could not catch, a project with nothing to ask about, an admin key limited to projects |
| 401 | Authentication is on and the API key is missing, unknown, revoked or expired |
| 403 | The key's scope is too low or it can't use the project, a key bound to a user sends another identity or uses the jobs or graph build endpoints, or a URL or S3 bucket that is not allowed (private network, S3_BUCKETS) |
| 404 | The project, document, job, collection, API key, access group, entity, web page or S3 object does not exist, or the document is hidden from the user asking |
| 409 | A conflict: the project name exists, the document is being processed, the index doesn't match the configured model, no reranker or LLM is configured, the graph is not enabled or a build is already running, a reindex would recreate a shared collection |
| 413 | A file or download over the size limits |
| 422 | Invalid request fields, a file that can't be read, or invalid chunking options |
| 500 | An unexpected error. The details are in the server log |
| 502 | An embedding provider, reranker, LLM, web site, S3 or the GLiNER model failed. The details are in the server log |
| 503 | Listing documents with the stale filter while the vector DB can't be reached |
Upload and import endpoints don't fail as a whole because of one file:
each file gets its own status and message in the
response.