Docs
Databases API
Databases API
API endpoint for retrieving available database connections
The Databases API allows you to retrieve a list of database connections associated with the authenticated user. This endpoint returns basic information about each database connection, including its identifier and name.
Endpoint
GET /faas/api/databases
Authentication
All requests must include an API key in the Authorization header:
Authorization: Bearer sk_your_api_key
API keys must start with the prefix sk_
and can be generated from your account dashboard.
Request Format
This endpoint does not require any request parameters. It uses the API key to identify the user and returns all database connections associated with that user.
Response Format
The response is an array of database connection objects, each containing the following fields:
Field | Type | Description |
---|---|---|
id | string | The unique identifier for the database connection |
name | string | The name of the database connection |
Example Response
[
{
"id": "db_12345",
"name": "Production PostgreSQL"
},
{
"id": "db_67890",
"name": "Analytics MySQL"
}
]
Error Codes
Status Code | Description |
---|---|
401 | Missing or invalid API key |
500 | Server error |
Limitations
- The API returns only the id and name of each database connection for security reasons
- Sensitive connection details are not exposed through this API
- Database connections must be created and configured through the web interface
Example Usage
// Fetching available database connections
const response = await fetch('https://app.chatdb.live/faas/api/databases', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer sk_your_api_key'
}
});
const databases = await response.json();
console.log(databases);