API Overview

Eden-MDBS provides a REST API for interacting with your database infrastructure. All API endpoints are available at http://{host}:8000/api/v1/.

Base URL

http://{host}:8000/api/v1

Authentication

Most API endpoints require authentication via JWT tokens. See Authentication for details.

Authentication Methods

MethodUse CaseHeader Format
Bearer TokenMost API callsAuthorization: Bearer
Basic AuthLogin onlyAuthorization: Basic
Org Creation TokenCreating organizationsAuthorization: Bearer

API Categories

Organization Management

EndpointMethodDescription
/api/v1/newPOSTCreate a new organization
/api/v1/organizationsGETGet organization details
/api/v1/organizationsPATCHUpdate organization
/api/v1/organizationsDELETEDelete organization

Authentication

EndpointMethodDescription
/api/v1/auth/loginPOSTLogin and get JWT token
/api/v1/auth/refreshPOSTRefresh JWT token

Endpoints (Database Connections)

EndpointMethodDescription
/api/v1/endpointsGETList all endpoints
/api/v1/endpointsPOSTCreate new endpoint
/api/v1/endpoints/{id}GETGet endpoint details
/api/v1/endpoints/{id}PATCHUpdate endpoint
/api/v1/endpoints/{id}DELETEDelete endpoint
/api/v1/endpoints/{id}/readPOSTExecute read query
/api/v1/endpoints/{id}/writePOSTExecute write query
/api/v1/endpoints/{id}/transactionPOSTExecute transaction

MCP Tooling

EndpointMethodDescription
/api/v1/endpoints/{id}/mcpGETList MCP servers for an endpoint
/api/v1/endpoints/{id}/mcp/{mcp_server}POSTSend MCP JSON-RPC message (streamable HTTP)
/api/v1/endpoints/{id}/mcp/{mcp_server}GETOpen SSE stream for server-to-client messages
/api/v1/endpoints/{id}/mcp/{mcp_server}DELETEClose MCP session
/api/v1/mcp/migrationsPOSTSend MCP JSON-RPC message (streamable HTTP)
/api/v1/mcp/migrationsGETOpen SSE stream for server-to-client messages
/api/v1/mcp/migrationsDELETEClose MCP session

Users & IAM

EndpointMethodDescription
/api/v1/iam/usersPOSTCreate user
/api/v1/iam/users/{user}GETGet user details
/api/v1/iam/users/{user}PATCHUpdate user
/api/v1/iam/users/{user}DELETEDelete user

RBAC (Role-Based Access Control)

EndpointMethodDescription
/api/v1/iam/rbac/endpoints/{id}GETGet endpoint permissions
/api/v1/iam/rbac/endpoints/subjectsPOSTAdd endpoint permissions
/api/v1/iam/rbac/organizationsGETGet organization permissions
/api/v1/iam/rbac/organizations/subjectsPOSTAdd organization permissions

Templates

EndpointMethodDescription
/api/v1/templatesGETList all templates
/api/v1/templatesPOSTCreate template
/api/v1/templates/{id}GETGet template details
/api/v1/templates/{id}POSTExecute template
/api/v1/templates/{id}DELETEDelete template

Workflows

EndpointMethodDescription
/api/v1/workflowsPOSTCreate workflow
/api/v1/workflows/{id}GETGet workflow details
/api/v1/workflows/{id}DELETEDelete workflow

Request Format

All requests should use JSON format:

bash
curl http://{host}:8000/api/v1/endpoints \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>" \
  -d '{"key": "value"}'

Response Format

Successful responses return JSON with a status field:

json
{
  "status": "success",
  "data": { ... }
}

Error responses include error details:

json
{
  "error": "Error Type",
  "message": "Detailed error message"
}

See Error Responses for complete error code reference.

HTTP Status Codes

CodeMeaning
200Success
400Bad Request - Invalid input
401Unauthorized - Invalid or missing authentication
403Forbidden - Insufficient permissions
404Not Found - Resource doesn't exist
409Conflict - Resource already exists
429Too Many Requests - Rate limit exceeded
500Internal Server Error

Rate Limiting

Eden-MDBS supports configurable rate limiting via the EDEN_RATE_LIMIT environment variable. When rate limiting is enabled, responses include:

  • X-RateLimit-Limit: Maximum requests per window
  • X-RateLimit-Remaining: Remaining requests in current window
  • X-RateLimit-Reset: Time when the rate limit resets

API Documentation

Eden-MDBS provides auto-generated API documentation:

  • Swagger UI: http://{host}:8000/swagger-ui/
  • OpenAPI JSON: http://{host}:8000/api-docs/openapi.json

Quick Examples

Create Organization

bash
curl http://{host}:8000/api/v1/new \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer {EDEN_NEW_ORG_TOKEN}" \
  -d '{
    "id": "my_company",
    "super_admins": [
      {"username": "admin", "password": "secure_password"}
    ]
  }'

Login

bash
curl http://{host}:8000/api/v1/auth/login \
  -u admin:secure_password \
  -X POST

Create Endpoint

bash
curl http://{host}:8000/api/v1/endpoints \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
    "id": "mydb",
    "kind": "Postgres",
    "config": {
      "write_conn": {
        "url": "postgresql://user:pass@host:5432/db"
      }
    }
  }'

Execute Query

bash
curl http://{host}:8000/api/v1/endpoints/mydb/read \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{"query": "SELECT * FROM users LIMIT 10"}'

Next Steps

Last updated: October 20, 2018
Size: 7.81 KB
    Eden