Browse the documentation

REST API

The optional self-hosted HTTP API.

Enterprise

Enable the API

AddNetlyDBAPI(port) starts a self-hosted HTTP API (default port 9020) in your process. It serves NetlyDB's endpoints only, on its own port, behind NetlyDBOptions.Security.

builder.Services.AddNetlyDB(options =>
{
    options.Security.ApiKeyHashes = [apiKeyHash]; // or ApiKeys, or JWT bearer (Enterprise)
});

builder.Services.AddNetlyDBAPI(port: 9020);
  • Authentication is required by default, and startup fails if no API key or JWT configuration is present. See Authentication.
  • The API binds to localhost. Expose it beyond the machine only through a reverse proxy you secure.
  • HTTPS is off by default; enable it with Security.EnableTls and a certificate.
  • Swagger UI is off by default.

Endpoints

AreaRoutes
CollectionsGET /Collections/names, GET /Collections/infos, GET /Collections/{name}/count, POST /Collections/file/{name}, collection delete
DocumentsRead, insert, replace, patch and delete documents; top/{n}
QueriesFilter queries, select projections, and POST /Collections/{name}/explain
IndexesCreate, update and drop indexes
Operations/Snapshots (save, load, last), /Cluster, /Database/events/history, /health probes

A write that violates a collection's schema is answered with 400 and the field violations.

An unhandled error has occurred. Reload X

Reconnecting

Restoring the connection to the server...

Still trying

Next attempt in seconds

Connection lost

We could not reach the server.