0% found this document useful (0 votes)
2 views3 pages

API Reference

The document provides an API reference for accessing various endpoints related to databases, queries, and user management within an application. It includes details on authentication, database operations, saved queries, shared queries, API token management, user profiles, and admin user management. Additionally, it features an AI endpoint for generating SQL queries from natural language descriptions, with rate limits specified.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

API Reference

The document provides an API reference for accessing various endpoints related to databases, queries, and user management within an application. It includes details on authentication, database operations, saved queries, shared queries, API token management, user profiles, and admin user management. Additionally, it features an AI endpoint for generating SQL queries from natural language descriptions, with rate limits specified.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

API Reference

All endpoints are relative to the application base URL (e.g.


[Link] ).

Authentication – Browser sessions authenticate automatically via Clerk cookies. Programmatic


clients must include a bearer token:

Authorization: Bearer <token>

Tokens are created and scoped to specific databases through the Settings → API page.

Databases
Browse connected databases and their structure.

Method Endpoint Description

GET /databases List all available databases

GET /databases/:database/schemas List schemas in a database

GET /databases/:database/tables List tables in a database

GET /databases/:database/tables/:table Retrieve rows from a table (paginated)

GET /databases/:database/views List views in a database

GET /databases/:database/procedures List stored procedures

GET /databases/tree Full schema tree for all databases

POST /databases/:database/query Execute a SQL query against a database

Legacy data endpoints


These are an earlier set of data-access endpoints. New integrations should prefer the /databases
group above.

Method Endpoint Description

GET /data/databases/:database/tables/:table Get table data (paginated, supports query-param


filtering)

POST /data/databases/:database/tables/:table Insert a row into a table

POST /data/databases/:database/query Execute a SQL SELECT query

api-reference · 1/3
Queries
Retrieve the authenticated user's query execution history.

Method Endpoint Description

GET /queries List queries for the current user

Saved Queries
Create, retrieve, update, delete, and share persisted queries.

Method Endpoint Description

GET /saved-queries List saved queries for the current user

POST /saved-queries Create a new saved query

GET /saved-queries/:id Get a saved query by ID

PUT /saved-queries/:id Update a saved query

DELETE /saved-queries/:id Delete a saved query

Shared Queries
Access publicly shared queries by their share ID — no authentication required.

Method Endpoint Description

GET /share/:shareId Retrieve a public shared query

API Tokens
Manage bearer tokens for programmatic access. Each token can be scoped to specific databases
with granular read / write / query permissions.

api-reference · 2/3
Method Endpoint Description

GET /tokens List tokens for the current user

POST /tokens Create a new token

GET /tokens/:id Get a token by ID

PUT /tokens/:id Update a token

DELETE /tokens/:id Revoke and delete a token

Users
Retrieve the current user's profile.

Method Endpoint Description

GET /users Current user profile

Admin – Users
Full user management. Requires an Admin role.

Method Endpoint Description

GET /admin/users List all users

POST /admin/users Create a user

GET /admin/users/:id Get a user by ID

PUT /admin/users/:id Update a user

DELETE /admin/users/:id Delete a user

AI – SQL Generation
Generate SQL queries from natural language descriptions using the Anthropic Claude API.

Method Endpoint Description

POST /ai/sql-generate Generate a SQL query from a prompt

!!! note Rate-limited to 50 requests per hour. Input prompts are capped at 1 000 characters.

api-reference · 3/3

You might also like