Coinbax API

Health

Health check and monitoring endpoints

View as Markdown

Complete health check

GET/api/v2/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/v2/health'
const response = await fetch('https://api-staging.coinbax.com/api/v2/health', {
});
const result = await response.json();

Liveness probe

GET/api/v2/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
  • successbooleanrequired

    Always `false` on an error response.

  • dataenumrequired

    Always `null` on an error response. Present so success and error bodies share a shape.

    enumnull

    Always `null` on an error response. Present so success and error bodies share a shape.

  • metaErrorResponseMetaDtorequired
    • timestampstringrequired

      ISO 8601 timestamp of the response.

    • requestIdstringrequired

      Request id for this response. Echoes the `X-Request-ID` or `X-Correlation-ID` you sent, whatever its format; when you send neither, the server generates a UUID v4. Quote it when reporting a problem — it is how the request is found in our logs.

    • pathstringrequired

      Request path that produced the error.

    • methodstringrequired

      HTTP method of the request that produced the error.

  • errorApiErrorDtorequired
    • codestringrequired

      Machine-readable error code. Branch on this rather than on `message`, which is free text and may change. Deliberately an open string, NOT a closed enum. Two families of code reach this field: - the status-derived codes in `ErrorCode` (VALIDATION_ERROR, NOT_FOUND, RATE_LIMIT_EXCEEDED, and so on), which `AllExceptionsFilter` assigns from the HTTP status; - domain-specific codes a service sets on the exception it throws, such as `ESCROW_ALREADY_CREATED`, `PRE_ESCROW_PENDING` or `RELEASE_WINDOW_NOT_ELAPSED`. The second family is the larger one, so publishing `ErrorCode` as an enum would make a strict client reject most real error responses. Treat an unrecognised code as its HTTP status.

    • messagestringrequired

      Human-readable description of what went wrong.

    • statusCodenumberrequired

      HTTP status code, repeated here so the body is self-contained.

    • detailsone of

      Structured context for the error, such as per-field validation messages. Shape varies by `code`; treat it as opaque unless you recognise the code.

      • object
        object
      • array of object
        array of object
        object
      • string
        string
    • suggestionstring

      Actionable guidance for fixing the request, intended to be shown to a person. Advice, not data.

{
  "success": false,
  "data": null,
  "meta": {
    "timestamp": "2026-11-06T12:34:56.789Z",
    "requestId": "550e8400-e29b-41d4-a716-446655440000",
    "path": "/api/v1/transactions",
    "method": "POST"
  },
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Request validation failed",
    "statusCode": 400,
    "details": {
      "amount": "must be a positive number"
    },
    "suggestion": "Use one of: base, ethereum"
  }
}
curl 'https://api-staging.coinbax.com/api/v2/health/live'
const response = await fetch('https://api-staging.coinbax.com/api/v2/health/live', {
});
const result = await response.json();

Readiness probe

GET/api/v2/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/v2/health/ready'
const response = await fetch('https://api-staging.coinbax.com/api/v2/health/ready', {
});
const result = await response.json();