# pub.chive.admin.getSystemHealth

> Published by [chive.pub](https://lexicon.garden/identity/did:plc:7natp5xae72bddaqlkef2t4e)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.admin.getSystemHealth)
- [Documentation](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.admin.getSystemHealth/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.admin.getSystemHealth/examples)

## Definitions

### `pub.chive.admin.getSystemHealth`

**Type**: `query`

Get health status of all database connections

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `status` | `string` | Yes | Overall system health status |
| `uptime` | `integer` | Yes | Server uptime in seconds |
| `databases` | `array` | Yes | Health status for each database connection |
| `timestamp` | `string` (datetime) | Yes | Timestamp of the health check |

#### Errors

- **AuthenticationRequired**
- **AdminRequired**

### `pub.chive.admin.getSystemHealth#databaseHealth`

**Type**: `object`

Health status of a single database connection

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `name` | `string` | Yes | Database name |
| `error` | `string` | No | Error message if unhealthy |
| `healthy` | `boolean` | Yes | Whether the database is reachable |
| `latencyMs` | `integer` | No | Connection latency in milliseconds |

## Raw Schema

```json
{
  "id": "pub.chive.admin.getSystemHealth",
  "defs": {
    "main": {
      "type": "query",
      "errors": [
        {
          "name": "AuthenticationRequired"
        },
        {
          "name": "AdminRequired"
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "status",
            "databases",
            "uptime",
            "timestamp"
          ],
          "properties": {
            "status": {
              "type": "string",
              "description": "Overall system health status",
              "knownValues": [
                "healthy",
                "degraded",
                "unhealthy"
              ]
            },
            "uptime": {
              "type": "integer",
              "description": "Server uptime in seconds"
            },
            "databases": {
              "type": "array",
              "items": {
                "ref": "#databaseHealth",
                "type": "ref"
              },
              "description": "Health status for each database connection"
            },
            "timestamp": {
              "type": "string",
              "format": "datetime",
              "description": "Timestamp of the health check"
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "properties": {}
      },
      "description": "Get health status of all database connections"
    },
    "databaseHealth": {
      "type": "object",
      "required": [
        "name",
        "healthy"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "Database name"
        },
        "error": {
          "type": "string",
          "description": "Error message if unhealthy"
        },
        "healthy": {
          "type": "boolean",
          "description": "Whether the database is reachable"
        },
        "latencyMs": {
          "type": "integer",
          "description": "Connection latency in milliseconds"
        }
      },
      "description": "Health status of a single database connection"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "revision": 1
}
```
