Skip to main content

Health Check

Public endpoint for basic server health check. Does not require authentication and does not check database connectivity.

Headers

No authentication required.

Response

ok
boolean
Always returns true if the server is running

Example Request

curl -X GET https://api.skyteam.dev/health

Example Response

{
  "ok": true
}

Use Case

This endpoint is designed for:
  • Load balancer health checks
  • Monitoring systems
  • Quick server availability verification without database overhead
  • Diagnosing server issues without requiring valid authentication
This is the only endpoint that does not require the x-api-key header.

Status Check

Authenticated endpoint that verifies API key validity and miles system availability.

Headers

x-api-key
string
required
Your airline’s API token

Response

ok
boolean
Overall status (true if authenticated and system operational)
milesAvailable
boolean
Whether the miles system is available (currently always true if server is up)
airline
object
The authenticated airline’s information (excluding token)

Example Request

curl -X GET https://api.skyteam.dev/status \
  -H "x-api-key: your_api_key_here"

Example Response

{
  "ok": true,
  "milesAvailable": true,
  "airline": {
    "airlineId": "skyteam",
    "name": "SkyTeam Airways",
    "inviteLink": "https://discord.gg/skyteam",
    "serverId": "1122953128703168532",
    "createdAt": "2024-01-15T10:30:00.000Z",
    "updatedAt": "2024-01-15T10:30:00.000Z"
  }
}

Error Response

If authentication fails, you’ll receive a 401 error: Status: 401 Unauthorized
{
  "error": "Missing x-api-key header"
}
or
{
  "error": "Invalid API key"
}

Use Case

This endpoint is useful for:
  • Validating your API key is correct
  • Checking that you have proper access to the API
  • Verifying the miles system is operational
  • Getting your airline information in one call
  • Integration testing and debugging

Implementation

Location: apps/api/src/routes/status.ts:6
router.get("/status", async (_req, res) => {
  // airlineAuth runs before; if we're here, token is valid
  const airline = res.locals.safeAirline ?? res.locals.airline;
  // For now, miles system is considered available if server is up
  res.json({ ok: true, milesAvailable: true, airline });
});

Build docs developers (and LLMs) love