Skip to main content

Gateway Service API Reference

Base URL

http://localhost:8000/api

Authentication

All requests require authentication via JWT tokens in the Authorization header:

Authorization: Bearer <jwt-token>

GraphQL Endpoint

Federated GraphQL

POST /graphql

Execute GraphQL queries that may span multiple services via federation.

Example:

query {
users {
id
name
payments {
id
amount
}
}
}

REST API

Health Check

GET /health

Response:

{
"status": "healthy",
"version": "0.5.2",
"uptime": 3600
}

Service Routes

The gateway proxies requests to backend services:

GET /api/v1/payment/transactions
GET /api/v1/auth/users
GET /api/v1/lms/courses

Metrics

GET /metrics

Prometheus metrics endpoint.

Rate Limiting

Rate limits are applied per API key/user:

  • Premium: 1000 requests/minute
  • Standard: 100 requests/minute
  • Free: 10 requests/minute

Rate limit headers:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1640000000

WebSocket

WS /ws

WebSocket endpoint for real-time communication.

gRPC

The gateway supports gRPC proxying on port 50051 (configurable).