Skip to main content

/api/database/*

Endpoints for managing the database provider.

GET /api/database/config

Returns the current database provider and whether it’s configured.

POST /api/database/config

Sets a new database provider.

Request body

Supported providers: sqlite, supabase, turso, planetscale.

POST /api/database/test

Tests a database connection with the provided credentials.

Request body

Same format as POST /api/database/config.

Response

or

POST /api/database/migrate

Creates the required tables (user_settings, api_cache) in the current database provider.

Response

For Supabase and PlanetScale, the endpoint returns the SQL statements for manual execution instead of running them directly.

GET /api/database/export

Exports all database data as JSON.

POST /api/database/import

Imports a previously exported JSON dump.

Request body

The JSON object returned by the export endpoint.