PaveDB JavaScript / TypeScript Client — API reference (v0.2.0)
Construct with new PaveDBClient({ baseUrl, apiKey });
fetchImpl and timeoutMs are optional. Errors throw PaveDBError
with status, code, and the server message.
PaveDB 0.9.7 expects addDocument(..., { text }) (or { vector })
and search(..., { q, k }) (or { v, k }). listDocuments returns
the full list. getArchive returns the ZIP Response; inspect its
X-PaveDB-Skipped-Collections header before using the archive.
| Method | HTTP route |
|---|---|
health() | GET /health |
metrics() | GET /metrics |
version() | GET /health |
listTenants() | GET /v1/admin/tenants |
listEmbedders() | GET /v1/admin/embedders |
getArchive() | GET /v1/admin/archive |
listCollections(tenantName: string) | GET /v1/collections/{tenantName} |
createCollection(tenantName: string, name: string, options?: CreateCollectionOptions) | POST /v1/collections/{tenantName}/{name} |
deleteCollection(tenantName: string, name: string) | DELETE /v1/collections/{tenantName}/{name} |
addDocument(tenantName: string, collection: string, body: DocumentInput) | POST /v1/collections/{tenantName}/{collection}/documents |
listDocuments(tenantName: string, collection: string) | GET /v1/collections/{tenantName}/{collection}/documents |
metricsSnapshot() | GET /health/metrics |
search(tenantName: string, collection: string, body: SearchBody) | POST /v1/collections/{tenantName}/{collection}/search |
Notes
metrics— Prometheus exposition text, not JSON.version— Server version from the always-on health endpoint.getArchive— ZIP response; inspect X-PaveDB-Skipped-Collections before using it.metricsSnapshot— Admin-key counters and hardware snapshot.