Databases API

PostgreSQL database management with 55+ endpoints covering databases, tables, views, triggers, functions, indexes, privileges, SQL execution, and import/export.

All endpoints are prefixed with /api/databases. Admin only.


Database Operations

MethodPathDescription
GET/databases/listList all databases
POST/databases/createCreate database
DELETE/databases/:dbDrop database
PUT/databases/:db/configUpdate DB config
GET/databases/usersList DB users
POST/databases/usersCreate DB user

Schema & Extensions

MethodPathDescription
GET/:db/schemasList schemas
GET/:db/extensionsList extensions

Table Operations

MethodPathDescription
GET/:db/tablesList tables
GET/:db/table/:sch/:tbl/infoColumn info
GET/:db/table/:sch/:tbl/dataBrowse rows
POST/:db/table/:sch/:tbl/rowInsert row
PUT/:db/table/:sch/:tbl/row/:pk/:valUpdate row
DELETE/:db/table/:sch/:tbl/row/:pk/:valDelete row
POST/:db/table/:sch/:tbl/rows/deleteBulk delete
POST/:db/tableCreate table
PUT/:db/table/:sch/:tblUpdate columns
DELETE/:db/table/:sch/:tblDrop table
POST/:db/table/:sch/:tbl/duplicateClone table
PUT/:db/table/:sch/:tbl/renameRename table
DELETE/:db/table/:sch/:tbl/truncateTruncate table
POST/:db/table/:sch/:tbl/vacuumVacuum table
POST/:db/table/:sch/:tbl/analyzeAnalyze table
GET/:db/table/:sch/:tbl/metadataTable metadata
PUT/:db/table/:sch/:tbl/commentSet table comment
PUT/:db/table/:sch/:tbl/column/:col/commentSet column comment
GET/:db/table/:sch/:tbl/column-orderGet column order
PUT/:db/table/:sch/:tbl/column-orderSet column order

Import/Export

MethodPathDescription
GET/:db/table/:sch/:tbl/exportExport table (CSV/JSON/SQL)
POST/:db/table/:sch/:tbl/importImport table data

SQL Execution

MethodPathDescription
POST/:db/queryExecute SQL
GET/query-presetsSQL query presets
POST/query-runExecute SQL (alt)

Foreign Keys & Indexes

MethodPathDescription
GET/:db/table/:sch/:tbl/foreign-keysTable FKs
GET/:db/foreign-keysAll FKs
GET/:db/table/:sch/:tbl/indexesTable indexes
POST/:db/table/:sch/:tbl/indexCreate index
DELETE/:db/index/:sch/:idxDrop index

Views & Materialized Views

MethodPathDescription
GET/:db/viewsList views
POST/:db/viewCreate view
DELETE/:db/view/:sch/:nameDrop view
GET/:db/matviewsList materialized views
POST/:db/matviewCreate mat. view
DELETE/:db/matview/:sch/:nameDrop mat. view
POST/:db/matview/:sch/:name/refreshRefresh mat. view

Functions & Triggers

MethodPathDescription
GET/:db/functionsList functions
GET/:db/functions/:sch/:name/definitionFunction source
DELETE/:db/functions/:sch/:nameDrop function
GET/:db/table/:sch/:tbl/triggersTable triggers
GET/:db/triggersAll triggers
GET/:db/triggers/:sch/:nameTrigger source
POST/:db/triggerCreate trigger
DELETE/:db/trigger/:nameDrop trigger (table)
DELETE/:db/triggers/:sch/:nameDrop trigger (global)

Privileges & Connections

MethodPathDescription
GET/:db/privilegesList privileges
POST/:db/privileges/grantGrant privilege
POST/:db/privileges/revokeRevoke privilege
GET/:db/connectionsActive connections
DELETE/:db/connections/:pidKill connection

Bookmarks & Search

MethodPathDescription
GET/bookmarksQuery bookmarks
POST/bookmarksCreate bookmark
DELETE/bookmarks/:idDelete bookmark
POST/:db/search-allCross-table search
GET/:db/dumpDatabase dump

Part of NexusPanel API Reference

← Back to Documentation