Skip to content

Ping API

Health check endpoint for the server.


GET /v1/ping

Overview

Health check endpoint for the server.

Request and Response

Headers

Request Headers

None

Response Headers

  • Content-Type: application/json

URI

/v1/ping

Request Body

None

Response

Response is JSON.

{
  "message": "pong"
}

Authentication

This endpoint does not require authentication.

Error Handling

Description Status Code Status Name
Internal server error 500 Internal Server Error

Processing Flow

  1. Receive the request
  2. Return { "message": "pong" }

Detailed Flowchart

flowchart TD
    Start([GET /v1/ping]) --> Route[Route Handler]
    Route --> Success[200 OK<br/>pong]

GET /v1/ping/deep

Overview

Health check endpoint for the server and DB.

Request and Response

Headers

Request Headers

None

Response Headers

  • Content-Type: application/json

URI

GET /v1/ping/deep

Request Body

None

Response

Response is JSON.

200 OK

{
  "message": "pong",
  "db": "ok"
}

503 Service Unavailable (when DB connection fails)

{
  "message": "pong",
  "db": "error"
}

Authentication

This endpoint does not require authentication.

Error Handling

Description Status Code Status Name
DB connectivity check failed 503 Service Unavailable

The implementation catches the DB error and returns {"message": "pong", "db": "error"} with 503, so this endpoint never returns 500.

Processing Flow

  1. Receive the request
  2. Check DB connectivity
  3. Return the result
flowchart TD
    Start([GET /v1/ping/deep]) --> DBCheck[Check DB connectivity]
    DBCheck -->|success| Success[200 OK<br/>db: ok]
    DBCheck -->|failure| E503[503 Service Unavailable<br/>db: error]