Skip to Content
v2Admin Operations

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.

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 root

If 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.

OperationDescription
create_databaseCreate a database at a tier; returns its new db token
list_databasesList all databases (db_name, db_type, is_active, created_at)
get_databaseInfo for a single database
activate_databaseRe-enable a deactivated database
deactivate_databaseBlock a database’s tokens without deleting data
set_database_typeChange a database’s tier
delete_databaseDelete a database and all its data

Database tiers (db_type): starter, pro, scale, enterprise.

# 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 data

Return 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.

# 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.

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.

admin.health() # {"status": "ok", "timestamp": ...} admin.stats() # {"version", "uptime", "total_requests"}

Method Reference

OperationPythonTypeScript
Create databasecreate_database(db_name, db_type="enterprise")createDatabase(dbName, dbType='scale')
List databaseslist_databases()listDatabases()
Get databaseget_database(db_name)getDatabase(dbName)
Activate databaseactivate_database(db_name)activateDatabase(dbName)
Deactivate databasedeactivate_database(db_name)deactivateDatabase(dbName)
Change tierset_database_type(db_name, db_type)setDatabaseType(dbName, dbType)
Delete databasedelete_database(db_name)deleteDatabase(dbName)
Create tokencreate_token(db_name, name, token_type="rw")createToken(dbName, name, tokenType='rw')
List tokenslist_tokens(db_name)listTokens(dbName)
Delete tokendelete_token(db_name, name)deleteToken(dbName, name)
List a db’s collectionslist_db_collections(db_name)listDbCollections(dbName)
List all collectionslist_all_collections()listAllCollections()
Delete a db’s collectiondelete_db_collection(db_name, collection_name)deleteDbCollection(dbName, collectionName)
Healthhealth()health()
Statsstats()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.