Databases API

Reference for the 4 Databases operations in the Intuidy API.

Updated in Intuidy 2026.11.216 min read

Responses are JSON. A successful response is { "success": true, "data": …, "meta": … }, and each operation below documents its data. Errors use the error envelope described in Errors, pagination and limits.

OperationMethod and pathAuthorization
List managed databasesGET /databasesdatabases:read
List the tables in one managed databaseGET /databases/{databaseId}/tablesdatabases:read
Check a managed database's healthGET /databases/{databaseId}/healthdatabases:read
Run SQL against a managed databasePOST /databases/{databaseId}/querydatabases:read

List managed databases

GET /databases

The managed databases this key may read. Each row carries BOTH ids: id is the database, credential_id is its connection — notebook query cells and DB workflow nodes take the credential id, and swapping the two silently points them at a different database.

Each row also lists the extensions enabled in the database (extensions, for example postgis on a PostgreSQL database), so a caller knows whether spatial SQL will run. Extensions are listed here and managed in the web app, in the Extensions section of the database page.

Data plane only. Provisioning, database users, backups, restore, import, connection logs and enabling or disabling an extension are not published: they hand out credentials and reshape infrastructure, and are available only in the web app.

Authorization: scope databases:read.

Response 200 OK

data fields:

FieldTypeDescription
databasesarray of object—
databases[].idinteger—
databases[].namestring—
databases[].credential_idinteger or nullThe CONNECTION id — what notebook cells and DB nodes take
databases[].statusstring—
databases[].enginestringThe engine's display name, e.g. MySQL or PostgreSQL. SQL against this database uses its dialect.
databases[].engine_type"mysql" or "postgres"The engine's machine key
databases[].engine_versionstring or null—
databases[].extensionsarray of stringKeys of the extensions enabled in the database, for example postgis on a PostgreSQL database. Empty when none is enabled. This is the recorded list; it is managed in the web app.
databases[].size_mbinteger or null—
databases[].max_size_mbinteger or null—
databases[].createdstring (date-time)—
totalinteger—

Errors 403. See Errors, pagination and limits.

Example request

bash
curl -X GET "https://vantage.intuidy.com/api/v1/databases" \
  -H "Authorization: Bearer $INTUIDY_API_KEY"

List the tables in one managed database

GET /databases/{databaseId}/tables

Table names with row counts, sizes and comments, the same listing the web app shows. Relations that an extension owns (PostGIS's spatial_ref_sys and geometry_columns, for example) are not listed and can still be queried by name. The key owner needs the query_databases permission; without it the answer is 403 PERMISSION_DENIED.

Authorization: scope databases:read.

Path parameters

NameTypeRequiredDescription
databaseIdintegerYes—

Response 200 OK

data fields:

FieldTypeDescription
database_idinteger—
tablesarray of object—
totalinteger—

Errors 400 (DATABASE_NOT_ACTIVE, NO_CREDENTIAL, CREDENTIAL_NOT_FOUND), 404. See Errors, pagination and limits.

Example request

bash
curl -X GET "https://vantage.intuidy.com/api/v1/databases/<databaseId>/tables" \
  -H "Authorization: Bearer $INTUIDY_API_KEY"

Check a managed database's health

GET /databases/{databaseId}/health

Authorization: scope databases:read.

Path parameters

NameTypeRequiredDescription
databaseIdintegerYes—

Query parameters

NameTypeRequiredDescription
fresh"1"NoProbe again instead of returning the recent result. A probe opens a real connection, so a recent result is reused for a short time — a monitor polling every minute would otherwise cost one connection per poll.

Response 200 OK

data fields:

FieldTypeDescription
database_idinteger—

Errors 404 (NOT_FOUND). See Errors, pagination and limits.

Example request

bash
curl -X GET "https://vantage.intuidy.com/api/v1/databases/<databaseId>/health" \
  -H "Authorization: Bearer $INTUIDY_API_KEY"

Run SQL against a managed database

POST /databases/{databaseId}/query

READ or WRITE is decided by the statement, not by the caller — the same way the query console in the web app decides. A read (SELECT, SHOW, DESCRIBE, EXPLAIN) needs databases:read; anything that mutates needs databases:write, so a reporting key cannot change data by sending an UPDATE. Anything that is neither is refused 422 and runs nowhere.

A read passes your organization's data rules on the way out, and data_rules_applied counts how many fired. The rules for the ai channel apply as on MCP query_managed_db: a rule on a table's classification can mask columns or refuse the read (403 POLICY_BLOCKED). It is capped and server-timed out.

DROP, TRUNCATE, ALTER … DROP and RENAME destroy a schema object and additionally need allow_destructive_ddl: true. No write scope is taken to authorise them on its own, and the refusal names the statement. It cannot be undone.

On a PostgreSQL database, CREATE EXTENSION, ALTER EXTENSION and DROP EXTENSION are refused with SQL_STATEMENT_BLOCKED, with or without allow_destructive_ddl. Extensions are enabled and disabled on the database's page in the web app.

Beside the scope, the key owner's role decides: a read needs the query_databases permission and a write needs edit_databases. Without it the answer is 403 PERMISSION_DENIED, naming the permission.

Authorization: scope databases:read.

Path parameters

NameTypeRequiredDescription
databaseIdintegerYes—

Request body (application/json)

FieldTypeRequiredDescription
sqlstringYesOne statement. Multi-statement input is refused.
paramsarray of objectNoPrepared-statement values. WRITES only — a read that sends them is refused 400.
variablesobjectNoValues for {{dash.name}} tokens in a dashboard SQL tile's query. Bound, never spliced.
row_limitintegerNoRows to return (default 1000, capped)
allow_destructive_ddlbooleanNoRequired for DROP, TRUNCATE, ALTER … DROP and RENAME. Set it only when the object is meant to go.

Response 200 OK

data fields:

FieldTypeDescription
database_idinteger—
rowsarray of object—
columnsarray of string—
total_rowsinteger—
truncatedboolean—
data_rules_appliedintegerPresent when your organization's data rules changed the rows
affected_rowsintegerWrites only
insert_idintegerWrites only

Errors 400 (DB_SQL, DB_REJECTED, INVALID_INPUT), 403 (INSUFFICIENT_SCOPE, SQL_STATEMENT_BLOCKED, SQL_DESTRUCTIVE_DDL, POLICY_BLOCKED, POLICY_UNEVALUABLE), 422 (SQL_STATEMENT_REFUSED), 500 (DB_UNKNOWN), 502 (DB_CONNECTIVITY, DB_AUTH, DB_CONFIG), 504 (DB_TIMEOUT). See Errors, pagination and limits.

Example request

bash
curl -X POST "https://vantage.intuidy.com/api/v1/databases/<databaseId>/query" \
  -H "Authorization: Bearer $INTUIDY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sql":"<sql>"}'