---
search:
  tags:
    - database-services
    - GET
seo:
  description: >-
    Reads the service now and returns the verdict… Reference for the GET
    /api/v1/database-services/{id}/health endpoint in the TimescaleDB Enterprise
    API.
sidebar:
  label: Get service health
  badge: GET
title: Get service health
type: openapi-operation
---
Reads the service now and returns the verdict (health), with the rules of the stored verdict, and the result of each probe (probes) in the shape of its own endpoint. One call gives the data of the per-component endpoints. HAProxy, pgBackRest and the emergency reserve use the results that the health poller read in the last 5 minutes, when it has them. Calls for the same service at the same time share one reading. It does not read an error a second time and does not store the verdict. Like the Patroni endpoint, it sets a failed service to running when Patroni is healthy and the failed operation was a config apply. When the backup config is out of sync, pgbackrest is a not_applicable entry with no backups; /health/pgbackrest runs the probe. A service that is not running or failed reads unknown with no probes. It usually answers in a few seconds, and in at most 3 minutes when a probe does not return or other live checks run. The list and detail responses carry the stored verdict (health), which costs no probe.

`GET /api/v1/database-services/{id}/health`

**Responses**

- `200` — OK
- `default` — Error

Response example, 200:

```json
{
  "health": {
    "checked_at": "2019-08-24T14:15:22Z",
    "components": [
      {
        "key": "patroni",
        "message": "string",
        "name": "string",
        "status": "healthy"
      }
    ],
    "reason": "string",
    "since": "2019-08-24T14:15:22Z",
    "status": "healthy"
  },
  "probes": {
    "etcd": {
      "console_mesh_down": true,
      "error": "string",
      "members": [
        {
          "cause": "down",
          "error": "string",
          "healthy": true,
          "host": "string",
          "overlay_ip": "string",
          "server_id": "string"
        }
      ],
      "status": "healthy"
    },
    "haproxy": {
      "error": "string",
      "members": [
        {
          "backends": [
            {
              "backend": "string",
              "check": "string",
              "server": "string",
              "status": "string"
            }
          ],
          "error": "string",
          "healthy": true,
          "host": "string",
          "server_id": "string"
        }
      ],
      "status": "healthy"
    },
    "patroni": {
      "console_mesh_down": true,
      "error": "string",
      "status": "healthy",
      "topology": {
        "members": [
          {
            "api_url": "string",
            "host": "string",
            "lag": 0,
            "name": "string",
            "nofailover": true,
            "pending_restart": true,
            "port": 0,
            "role": "string",
            "server_id": "string",
            "state": "string",
            "timeline": 0
          }
        ]
      }
    },
    "pgbackrest": {
      "backup_running": true,
      "backups": [
        {
          "checksum_errors": true,
          "database_id": 0,
          "database_size_bytes": 0,
          "label": "string",
          "older": true,
          "pg_version": "string",
          "prior_checksum_errors": true,
          "repo": 0,
          "size_bytes": 0,
          "start_time": "string",
          "stop_time": "string",
          "type": "string",
          "wal_start": "string",
          "wal_stop": "string"
        }
      ],
      "coverage": {
        "assumes_archiving": true,
        "earliest": "string",
        "end": "string",
        "now": "string",
        "repos": [
          {
            "backups": [
              {
                "checksum_errors": true,
                "label": "string",
                "stop_time": "string"
              }
            ],
            "current_tli": 0,
            "database_id": 0,
            "earliest": "string",
            "grant_fingerprint": "string",
            "kind": "local",
            "older": true,
            "pg_version": "string",
            "repo": 0,
            "wal_max": "string",
            "wal_min": "string"
          }
        ]
      },
      "error": "string",
      "first_backup_pending": true,
      "stanza": "string",
      "status": "healthy",
      "wal_max": "string",
      "wal_min": "string"
    },
    "pgbouncer": {
      "error": "string",
      "servers": [
        {
          "error": "string",
          "healthy": true,
          "host": "string",
          "pools": [
            {
              "cl_active": 0,
              "cl_waiting": 0,
              "database": "string",
              "pool_mode": "string",
              "user": "string"
            }
          ],
          "server_id": "string"
        }
      ],
      "status": "healthy"
    },
    "postgresql": {
      "connections": {
        "active": 0,
        "idle": 0,
        "max": 0,
        "total": 0
      },
      "databases": [
        {
          "name": "string",
          "size_bytes": 0
        }
      ],
      "error": "string",
      "members": [
        {
          "error": "string",
          "name": "string",
          "patroni_version": "string",
          "postmaster_start_time": "string",
          "role": "string",
          "server_id": "string",
          "server_version": 0,
          "state": "string"
        }
      ],
      "stats_error": "string",
      "total_size_bytes": 0,
      "uptime_seconds": 0
    },
    "reserve": {
      "error": "string",
      "nodes": [
        {
          "detail": "string",
          "error": "string",
          "expected_bytes": 0,
          "expected_count": 0,
          "files": [
            {
              "name": "string",
              "size_bytes": 0
            }
          ],
          "host": "string",
          "root": {
            "dir": "string",
            "expected_bytes": 0,
            "mount": "string",
            "size_bytes": 0,
            "status": "ok"
          },
          "server_id": "string",
          "status": "ok"
        }
      ],
      "status": "ok"
    }
  }
}
```
