# Health

Unauthenticated liveness and readiness probes for uptime monitoring. These return a flat body rather than the standard response envelope.

Source: https://docs.gunspec.io/en/api/health

## Health Check

`GET /health`

Auth: Public  
Tier: Explorer+

Liveness probe. Answers 200 whenever the API worker is running, and deliberately does not touch the database, so it stays green through a database incident. Use `/ready` to know whether requests will succeed. No authentication, no rate limit, and a flat body rather than the `{ success, data }` envelope.

### Response 200 (application/json)

| Field | Type | Description |
| --- | --- | --- |
| `status` | string | Always `ok`. Getting an answer at all is the signal; there is no degraded value. |
| `timestamp` | string | When the probe answered, ISO 8601 UTC. A value that does not move between calls means something in between is caching the reply. |
| `version` | string | The API version every endpoint is served under: the `v1` in `/v1/...`. Not a build number. |
| `environment` | string | Which deployment answered: `production` (api.gunspec.io), `staging`, or `development` for a worker running locally. |

```json
{
  "status": "ok",
  "timestamp": "2026-09-11T07:35:44.688Z",
  "version": "v1",
  "environment": "production"
}
```

### Example

```bash
curl --request GET \
  --url 'https://api.gunspec.io/health'
```

## Readiness Check

`GET /ready`

Auth: Public  
Tier: Explorer+

Readiness probe. Runs one query against the database: 200 `ready` when it answers, 503 `not_ready` when it does not, so a load balancer or status page can tell "the API is up" from "the API can serve data". No authentication, no rate limit, and a flat body rather than the `{ success, data }` envelope.

### Response 200 (application/json)

| Field | Type | Description |
| --- | --- | --- |
| `status` | string | Always `ready` on a 200. |
| `database` | string | The database answered the probe query. |

```json
{
  "status": "ready",
  "database": "connected"
}
```

### Errors

| Status | Code | Message |
| --- | --- | --- |
| 503 |  | The database did not answer the probe query |

### Example

```bash
curl --request GET \
  --url 'https://api.gunspec.io/ready'
```
