Docs Navigation
REST API

Heartbeat Endpoint

Submit periodic health heartbeats directly to Monitor via HTTP POST.

POSThttps://botmonitor.pages.dev/api/public/heartbeat
Authentication: Authorization: Bearer <heartbeat_token> or header x-heartbeat-token: <token>

Request Parameters

FieldTypeRequiredDescription
bot_idstringYesDiscord bot user ID. Must match the token-bound bot.
interval_secondsintegerYesExpected ping interval in seconds (e.g. 60).
shardsarrayNoList of shard telemetry objects.
shards[].shard_idintegerYes*Zero-indexed shard identifier.
shards[].statusstringYes*"healthy" | "degraded" | "disconnected"
shards[].latency_msinteger | nullNoRound-trip WebSocket ping in milliseconds.
shards[].guild_countinteger | nullNoTotal guilds assigned to this shard.

Payload Examples

Standard Single Process Bot:

json
{
  "bot_id": "123456789012345678",
  "interval_seconds": 60
}

Sharded Bot Payload:

json
{
  "bot_id": "123456789012345678",
  "interval_seconds": 60,
  "shards": [
    {
      "shard_id": 0,
      "status": "healthy",
      "latency_ms": 42,
      "guild_count": 125
    },
    {
      "shard_id": 1,
      "status": "healthy",
      "latency_ms": 55,
      "guild_count": 130
    }
  ]
}

Response Codes

StatusMeaningDetails
200 OKSuccessHeartbeat recorded.
400 Bad RequestInvalid PayloadMalformed JSON, missing bot_id, or invalid shard array.
401 UnauthorizedMissing AuthMissing or malformed Authorization header.
403 ForbiddenInvalid TokenToken revoked, invalid hash, or assigned to a different bot ID.
429 Rate LimitToo Many RequestsHeartbeat sent faster than allowed threshold.