GET
/docs/
Help docs

This page. Lists all available routes, environment variables, and links to detailed docs for each area.

Core routes

  • GET /health - service status, uptime, memory
  • GET /health/db (alias: GET /db/health) - database connection health
  • GET /health/services - pings every configured MAGICSTACK_* external service

Admin API (Mock Data Service) - under /admin

  • GET/POST /admin/spaces
  • GET/PATCH /admin/spaces/{id}
  • GET /admin/spaces/{id}/members
  • POST /admin/spaces/{id}/invitations
  • PATCH/DELETE /admin/spaces/{id}/members/{userId}
  • POST /admin/invitations/{token}/accept
  • GET/POST /admin/spaces/{id}/projects
  • GET/PATCH/DELETE /admin/projects/{id}
  • GET /admin/projects/{id}/members
  • POST /admin/projects/{id}/invitations
  • PATCH/DELETE /admin/projects/{id}/members/{userId}
  • GET/POST /admin/projects/{id}/types
  • GET/PUT/DELETE /admin/projects/{id}/types/{typeId}
  • GET/POST /admin/projects/{id}/relationships
  • DELETE /admin/projects/{id}/relationships/{relationshipId}
  • GET/POST /admin/projects/{id}/routes
  • PUT/DELETE /admin/projects/{id}/routes/{routeId}
  • POST /admin/projects/{id}/template/generate
  • GET /admin/projects/{id}/template/{typeName}
  • PUT /admin/projects/{id}/template/{typeName}/{identifier}
  • GET/POST /admin/projects/{id}/api-keys
  • DELETE /admin/projects/{id}/api-keys/{apiKeyId}
  • POST /admin/projects/{id}/api-keys/{apiKeyId}/reset
  • POST /admin/projects/{id}/openapi/import
  • GET /admin/projects/{id}/openapi/export
  • POST /admin/spaces/{id}/subscription/checkout
  • GET /admin/locales
  • Spaces docs
  • Projects docs
  • Data Types docs
  • Relationships docs
  • Mock Routes docs
  • Master Template docs
  • API Keys docs
  • OpenAPI Import docs
  • OpenAPI Export docs
  • Locales docs

Runtime API (Mock Data Service)

Payment routes

  • POST /payment
  • POST /payment/webhook
  • GET /docs/payments
GET
/health
Service health

Returns service status, uptime, and resource usage. No authentication required.

Request

Nothing required. No headers, body, or query parameters.

Response

{
  "service": "mockz",
  "status": "ok",
  "deployed_at": "2026-01-01T00:00:00.000Z",
  "started_at": "2026-01-01T00:00:00.000Z",
  "time_now": "2026-01-01T00:05:00.000Z",
  "hostname": "host",
  "node_version": "v20.0.0",
  "pid": 1234,
  "uptime_seconds": 300,
  "cpu_percent": 2.5,
  "memory": {
    "rss_mb": 100,
    "heap_used_mb": 40,
    "heap_total_mb": 60,
    "external_mb": 5
  }
}
GET
/health/db (alias: /db/health)
Database health

Verifies the API can acquire a connection from the MySQL pool and execute a query, plus a snapshot of connection/status metrics. Returns 503 if the connection fails.

Request

Nothing required. No headers, body, or query parameters.

Response

{
  "service": "mockz",
  "status": "ok",
  "message": "Database connection successful",
  "database": "your_db",
  "database_server_time": "2026-01-01T00:00:00.000Z",
  "database_response_ms": 5,
  "db_connections": 2,
  "server_threads_connected": 3,
  "max_connections": 151,
  "slow_queries": 0,
  "buffer_pool_hit_ratio_pct": 99.9,
  "uptime_seconds": 1000
}

Returns 503 with "status": "error" when the connection fails.

GET
/health/services
External service health

Pings every configured MAGICSTACK_* environment variable's {baseUrl}/health in parallel (Auth, Payment, Keystore, and any others configured). Returns 200 if every one responded OK, 207 if any didn't.

Request

Nothing required. No headers, body, or query parameters.

Response

{
  "time_now": "2026-01-01T00:00:00.000Z",
  "services": [
    {
      "service": "auth_api",
      "url": "https://auth.example.com/health",
      "status": "ok",
      "http_status": 200,
      "response_ms": 42
    }
  ]
}