Application health check

The health check calls a GET route of your HTTP application every 1 minute and restarts the instance when a failure is confirmed. These routes let you read and change the configuration and list recorded failures. The full behavior is described in Health checks for HTTP projects.

Authentication and permissions

The routes accept an organization API Key (x-api-key: znf_... or Authorization: Bearer znf_...) or a user token with x-organization-id.

RouteScope on project:<project-id>Limit
GET /v1/project/:id/healthcheckproject.read100 per minute
PATCH /v1/project/:id/healthcheckproject.instances.update20 every 5 minutes
GET /v1/project/:id/healthcheck/failuresproject.metrics.read100 per minute

owner has full access; assistant, member, and API Keys need the scope for the action. The routes only apply to HTTP projects; other types return 400 with healthcheck is available only for HTTP projects.

Read the configuration

GET /v1/project/:id/healthcheck
{
  "status": "success",
  "data": {
    "available": true,
    "healthcheck": { "enabled": true, "path": "/health" },
    "interval_seconds": 60,
    "retention_days": 30
  }
}
FieldDescription
availabletrue when the project plan includes health checks. Same value as capabilities.healthcheck in GET /v1/project/plans
healthcheck.enabledWhether the check is active
healthcheck.pathChecked route. Projects that never configured the feature return { "enabled": false, "path": "/health" }
interval_secondsInterval between checks (fixed at 60)
retention_daysPeriod during which failures remain available (fixed at 30)

Enable, change, or disable

PATCH /v1/project/:id/healthcheck
FieldTypeRequiredDescription
healthcheck.enabledbooleanYestrue enables; false disables
healthcheck.pathstringWith enabled: trueAbsolute path from 1 to 256 characters, starting with a single /, without domain, query string, or fragment
{
  "healthcheck": {
    "enabled": true,
    "path": "/health"
  }
}

The response confirms the applied configuration:

{
  "status": "success",
  "data": {
    "healthcheck": { "enabled": true, "path": "/health" },
    "interval_seconds": 60,
    "retention_days": 30
  }
}

To disable, send { "healthcheck": { "enabled": false } }. The last configured route is kept and the failure history remains available. Disabling is allowed on any plan; enabling requires a plan with the feature.

CodeSituation
400Invalid body, path in the wrong format, project that is not HTTP, or plan not found
403Plan without health check (HEALTHCHECK_NOT_AVAILABLE_FOR_PLAN) or insufficient scope
404Project not found (project not exists)
429Rate limit exceeded

List failures

GET /v1/project/:id/healthcheck/failures?page=1&limit=50
ParameterTypeDefaultDescription
pageinteger1Page, starting at 1
limitinteger50Items per page, from 1 to 100
{
  "status": "success",
  "data": {
    "failures": [
      { "occurred_at": "2026-10-08T12:03:00.000Z", "status_code": 503 }
    ],
    "pagination": { "page": 1, "limit": 50, "total": 1, "total_pages": 1 },
    "retention_days": 30
  }
}

Failures are sorted from newest to oldest and only cover the last 30 days. status_code is the HTTP status returned by the application and is absent when there was no response, such as a timeout or connection failure.

Example

curl -X PATCH "https://api.zenifra.com/v1/project/6650f1a2b3c4d5e6f7a8b9c0/healthcheck" \
  -H "x-api-key: znf_..." \
  -H "Content-Type: application/json" \
  -d '{"healthcheck": {"enabled": true, "path": "/health"}}'

Next steps

Last updated on

On this page