Admin Operations
The root token unlocks Endee’s control plane: creating and managing databases, minting tokens for any database, and inspecting collections across the whole deployment. These operations are available to Enterprise and self-managed deployments that hold the server’s root token (NDD_ROOT_TOKEN).
On Endee Serverless, the platform owns the root token and exposes database/token management through the dashboard . You don’t handle it yourself. The operations on this page apply when you run or own the Endee deployment (Enterprise / self-managed) and have the root token.
The root token administers databases and tokens only and cannot run data operations (collections, upsert, search) directly. Use it to mint a db token (db_name:secret), then do all data work with that db token. See Authentication for the token model.
Initialize the Admin Client
Create a client with the root token and point it at your server’s /api/v2 root. The same Endee class is used; the token’s privileges determine what it can do.
Python
from endee import Endee
# Use the server's NDD_ROOT_TOKEN (in dev, the insecure default is "unsafe_root_token").
admin = Endee(token="your-root-token")
admin.set_base_url("http://localhost:8080/api/v2") # point at the /api/v2 rootIf the server (Enterprise / self-managed) is started without an NDD_ROOT_TOKEN, Endee falls back to the insecure dev default unsafe_root_token. This is meant for local development only. Always set your own NDD_ROOT_TOKEN in production so the control plane isn’t open to anyone.
Database Administration
A database is the top-level namespace: fully isolated, addressed by its own db token. Creating one returns a brand-new db token for that database.
| Operation | Description |
|---|---|
create_database | Create a database at a tier; returns its new db token |
list_databases | List all databases (db_name, db_type, is_active, created_at) |
get_database | Info for a single database |
activate_database | Re-enable a deactivated database |
deactivate_database | Block a database’s tokens without deleting data |
set_database_type | Change a database’s tier |
delete_database | Delete a database and all its data |
Database tiers (db_type): starter, pro, scale, enterprise.
Python
# Create a database → returns its new db token ("alice:9f3...").
db_token = admin.create_database("alice", db_type="enterprise")
admin.list_databases() # [{db_name, db_type, is_active, created_at}, ...]
admin.get_database("alice") # info for database "alice"
admin.set_database_type("alice", "scale") # change tier
admin.deactivate_database("alice") # disable its tokens (data kept)
admin.activate_database("alice") # re-enable
admin.delete_database("alice") # delete the database and ALL its dataReturn shape: the Python client’s create_database returns the new db token string directly; the TypeScript client returns the raw response object. Read the token from res.db_token.
Token Administration
With the root token you can mint and manage named tokens for any database. Each token is read-write (rw, default) or read-only (r). Listing tokens returns names and types only; secrets are never returned.
Python
# Mint a token for database "alice"; returns the new db token string.
ingest_token = admin.create_token("alice", name="ingest", token_type="rw")
admin.list_tokens("alice") # [{name, token_type, ...}, ...] (no secrets)
admin.delete_token("alice", "ingest") # delete the token named "ingest"A database can also manage its own tokens without the root token, using a db token (create_my_token / list_my_tokens / delete_my_token). See Authentication → Managing Tokens.
Collections Across Databases
The root token gives an admin-wide view of collections in every database.
Python
admin.list_db_collections("alice") # collection names in database "alice"
admin.list_all_collections() # collections across ALL databases, grouped by db
admin.delete_db_collection("alice", "products") # delete a collection inside database "alice"Server Info
Health check and stats don’t require any token.
Python
admin.health() # {"status": "ok", "timestamp": ...}
admin.stats() # {"version", "uptime", "total_requests"}Method Reference
| Operation | Python | TypeScript |
|---|---|---|
| Create database | create_database(db_name, db_type="enterprise") | createDatabase(dbName, dbType='scale') |
| List databases | list_databases() | listDatabases() |
| Get database | get_database(db_name) | getDatabase(dbName) |
| Activate database | activate_database(db_name) | activateDatabase(dbName) |
| Deactivate database | deactivate_database(db_name) | deactivateDatabase(dbName) |
| Change tier | set_database_type(db_name, db_type) | setDatabaseType(dbName, dbType) |
| Delete database | delete_database(db_name) | deleteDatabase(dbName) |
| Create token | create_token(db_name, name, token_type="rw") | createToken(dbName, name, tokenType='rw') |
| List tokens | list_tokens(db_name) | listTokens(dbName) |
| Delete token | delete_token(db_name, name) | deleteToken(dbName, name) |
| List a db’s collections | list_db_collections(db_name) | listDbCollections(dbName) |
| List all collections | list_all_collections() | listAllCollections() |
| Delete a db’s collection | delete_db_collection(db_name, collection_name) | deleteDbCollection(dbName, collectionName) |
| Health | health() | health() |
| Stats | stats() | stats() |
delete_database and delete_db_collection are irreversible and remove all contained data. Deactivate a database instead if you only need to block access temporarily.