Coinbax API

Health

Health check and monitoring endpoints

View as Markdown

Complete health check

GET/api/v1/healthPublic

Returns detailed health status of all system components including database, cache, blockchain, and external services

Responses

200System is healthy
  • statusenumrequired"healthy" · "unhealthy" · "degraded"

    Overall system health status

  • timestampstringrequired

    Timestamp of health check

  • versionstringrequired

    Application version

  • uptimenumberrequired

    Application uptime in seconds

  • databaseobjectrequired

    Database health

    • ComponentHealthDto
      • statusenumrequired"up" · "down" · "degraded"

        Component status

      • responseTimenumberrequired

        Response time in milliseconds

      • detailsobject

        Component details

        object

        Component details

      • errorstring

        Error message if component is down

  • cacheobjectrequired

    Redis cache health

    • ComponentHealthDto
      • statusenumrequired"up" · "down" · "degraded"

        Component status

      • responseTimenumberrequired

        Response time in milliseconds

      • detailsobject

        Component details

        object

        Component details

      • errorstring

        Error message if component is down

  • blockchainobjectrequired

    Blockchain provider health

    • ComponentHealthDto
      • statusenumrequired"up" · "down" · "degraded"

        Component status

      • responseTimenumberrequired

        Response time in milliseconds

      • detailsobject

        Component details

        object

        Component details

      • errorstring

        Error message if component is down

  • riskServiceobjectrequired

    Risk service health

    • ComponentHealthDto
      • statusenumrequired"up" · "down" · "degraded"

        Component status

      • responseTimenumberrequired

        Response time in milliseconds

      • detailsobject

        Component details

        object

        Component details

      • errorstring

        Error message if component is down

  • memoryobjectrequired

    System memory usage

    object

    System memory usage

  • processobjectrequired

    Process information

    object

    Process information

{
  "status": "healthy",
  "timestamp": "2024-10-14T20:30:00.000Z",
  "version": "0.1.0",
  "uptime": 3600,
  "database": {
    "status": "up",
    "responseTime": 12,
    "details": {
      "version": "14.2",
      "connections": 10
    },
    "error": "Connection timeout"
  },
  "cache": {
    "status": "up",
    "responseTime": 12,
    "details": {
      "version": "14.2",
      "connections": 10
    },
    "error": "Connection timeout"
  },
  "blockchain": {
    "status": "up",
    "responseTime": 12,
    "details": {
      "version": "14.2",
      "connections": 10
    },
    "error": "Connection timeout"
  },
  "riskService": {
    "status": "up",
    "responseTime": 12,
    "details": {
      "version": "14.2",
      "connections": 10
    },
    "error": "Connection timeout"
  },
  "memory": {
    "total": 16777216000,
    "free": 8388608000,
    "used": 8388608000,
    "usedPercent": 50
  },
  "process": {
    "pid": 12345,
    "memoryUsage": 150000000,
    "cpuUsage": 5.5
  }
}
503System is unhealthy
  • statusenumrequired"healthy" · "unhealthy" · "degraded"

    Overall system health status

  • timestampstringrequired

    Timestamp of health check

  • versionstringrequired

    Application version

  • uptimenumberrequired

    Application uptime in seconds

  • databaseobjectrequired

    Database health

    • ComponentHealthDto
      • statusenumrequired"up" · "down" · "degraded"

        Component status

      • responseTimenumberrequired

        Response time in milliseconds

      • detailsobject

        Component details

        object

        Component details

      • errorstring

        Error message if component is down

  • cacheobjectrequired

    Redis cache health

    • ComponentHealthDto
      • statusenumrequired"up" · "down" · "degraded"

        Component status

      • responseTimenumberrequired

        Response time in milliseconds

      • detailsobject

        Component details

        object

        Component details

      • errorstring

        Error message if component is down

  • blockchainobjectrequired

    Blockchain provider health

    • ComponentHealthDto
      • statusenumrequired"up" · "down" · "degraded"

        Component status

      • responseTimenumberrequired

        Response time in milliseconds

      • detailsobject

        Component details

        object

        Component details

      • errorstring

        Error message if component is down

  • riskServiceobjectrequired

    Risk service health

    • ComponentHealthDto
      • statusenumrequired"up" · "down" · "degraded"

        Component status

      • responseTimenumberrequired

        Response time in milliseconds

      • detailsobject

        Component details

        object

        Component details

      • errorstring

        Error message if component is down

  • memoryobjectrequired

    System memory usage

    object

    System memory usage

  • processobjectrequired

    Process information

    object

    Process information

{
  "status": "healthy",
  "timestamp": "2024-10-14T20:30:00.000Z",
  "version": "0.1.0",
  "uptime": 3600,
  "database": {
    "status": "up",
    "responseTime": 12,
    "details": {
      "version": "14.2",
      "connections": 10
    },
    "error": "Connection timeout"
  },
  "cache": {
    "status": "up",
    "responseTime": 12,
    "details": {
      "version": "14.2",
      "connections": 10
    },
    "error": "Connection timeout"
  },
  "blockchain": {
    "status": "up",
    "responseTime": 12,
    "details": {
      "version": "14.2",
      "connections": 10
    },
    "error": "Connection timeout"
  },
  "riskService": {
    "status": "up",
    "responseTime": 12,
    "details": {
      "version": "14.2",
      "connections": 10
    },
    "error": "Connection timeout"
  },
  "memory": {
    "total": 16777216000,
    "free": 8388608000,
    "used": 8388608000,
    "usedPercent": 50
  },
  "process": {
    "pid": 12345,
    "memoryUsage": 150000000,
    "cpuUsage": 5.5
  }
}
curl https://api-staging.coinbax.com/api/v1/health
const response = await fetch('https://api-staging.coinbax.com/api/v1/health', {
});
const result = await response.json();

Liveness probe

GET/api/v1/health/livePublic

Kubernetes liveness probe - checks if the application is running. Returns 200 if alive, 503 if dead.

Responses

200Application is alive
  • statusstringrequired

    Liveness status

  • timestampstringrequired

    Timestamp

  • uptimenumberrequired

    Application uptime in seconds

{
  "status": "alive",
  "timestamp": "2024-10-14T20:30:00.000Z",
  "uptime": 3600
}
503Application is not responding

Response follows the unified success / data / meta / error envelope.

curl https://api-staging.coinbax.com/api/v1/health/live
const response = await fetch('https://api-staging.coinbax.com/api/v1/health/live', {
});
const result = await response.json();

Readiness probe

GET/api/v1/health/readyPublic

Kubernetes readiness probe - checks if application can accept traffic. Validates critical dependencies.

Responses

200Application is ready to accept traffic
  • statusstringrequired

    Readiness status

  • timestampstringrequired

    Timestamp

  • dependenciesobjectrequired

    Critical dependencies status

    object

    Critical dependencies status

{
  "status": "ready",
  "timestamp": "2024-10-14T20:30:00.000Z",
  "dependencies": {
    "database": "up",
    "cache": "up"
  }
}
503Application is not ready
  • statusstringrequired

    Readiness status

  • timestampstringrequired

    Timestamp

  • dependenciesobjectrequired

    Critical dependencies status

    object

    Critical dependencies status

{
  "status": "ready",
  "timestamp": "2024-10-14T20:30:00.000Z",
  "dependencies": {
    "database": "up",
    "cache": "up"
  }
}
curl https://api-staging.coinbax.com/api/v1/health/ready
const response = await fetch('https://api-staging.coinbax.com/api/v1/health/ready', {
});
const result = await response.json();

Test Sentry integration

GET/api/v1/sentry-testPublic

Triggers various types of Sentry events for testing. Use query parameter "type" to select test type: error, log, or span.

Query parameters

  • typeenum

    Type of Sentry test to run

    "error" · "log" · "span"

Responses

200Test completed successfully (log or span)

Response follows the unified success / data / meta / error envelope.

500Test error thrown (error type)

Response follows the unified success / data / meta / error envelope.

curl https://api-staging.coinbax.com/api/v1/sentry-test
const response = await fetch('https://api-staging.coinbax.com/api/v1/sentry-test', {
});
const result = await response.json();