> ## Documentation Index
> Fetch the complete documentation index at: https://docs.truthlocks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Health & Readiness

> Monitoring API health, readiness endpoints, and status page.

Monitor Truthlocks API health, check readiness for dependencies, and integrate with your observability stack.

## Health Endpoints

### Liveness Probe

Check if the API is running. Use for Kubernetes liveness probes:

```http theme={null}
GET https://api.truthlocks.com/health/live

# Response (200 OK)
{
  "status": "ok",
  "timestamp": "2026-01-13T12:00:00Z"
}
```

### Readiness Probe

Check if the API is ready to serve traffic (all dependencies healthy):

```http theme={null}
GET https://api.truthlocks.com/health/ready

# Response (200 OK - All systems operational)
{
  "status": "ok",
  "timestamp": "2026-01-13T12:00:00Z",
  "checks": {
    "database": "ok",
    "redis": "ok",
    "signing_service": "ok",
    "transparency_log": "ok"
  }
}
```

```http theme={null}
# Response (503 Service Unavailable - Degraded)
{
  "status": "degraded",
  "timestamp": "2026-01-13T12:00:00Z",
  "checks": {
    "database": "ok",
    "redis": "timeout",
    "signing_service": "ok",
    "transparency_log": "ok"
  }
}
```

## Kubernetes Configuration

If you're building applications that depend on Truthlocks, configure your probes to check both your app and the Truthlocks API:

```yaml theme={null}
apiVersion: v1
kind: Deployment
metadata:
  name: my-app
spec:
  template:
    spec:
      containers:
        - name: app
          livenessProbe:
            httpGet:
              path: /health/live
              port: 8080
            initialDelaySeconds: 5
            periodSeconds: 10
          readinessProbe:
            httpGet:
              path: /health/ready
              port: 8080
            initialDelaySeconds: 10
            periodSeconds: 5
            failureThreshold: 3
```

### Example Readiness Check (App)

```javascript theme={null}
// Include Truthlocks health in your app's readiness
app.get('/health/ready', async (req, res) => {
  const checks = {
    database: await checkDatabase(),
    truthlock: await checkTruthlock(),
  };

  const allHealthy = Object.values(checks).every(c => c === 'ok');

  res.status(allHealthy ? 200 : 503).json({
    status: allHealthy ? 'ok' : 'degraded',
    checks,
  });
});

async function checkTruthlock(): Promise<string> {
  try {
    const res = await fetch('https://api.truthlocks.com/health/ready', {
      timeout: 5000,
    });
    return res.ok ? 'ok' : 'degraded';
  } catch {
    return 'unreachable';
  }
}
```

## Status page

Check real-time service health and uptime at [status.truthlocks.com](https://status.truthlocks.com). The status page auto-refreshes every 60 seconds and requires no authentication.

### Monitored services

The status page tracks health for each core service independently:

| Service          | Description                                     |
| ---------------- | ----------------------------------------------- |
| API Gateway      | Main API endpoint for all requests              |
| Trust Registry   | Issuer management and governance                |
| Billing          | Subscription and payment processing             |
| Signing          | Cryptographic signing operations                |
| Attestations     | Attestation minting and management              |
| Audit Logs       | Activity logging and compliance                 |
| Transparency Log | Cryptographic append-only log                   |
| Verification     | Proof bundle verification                       |
| Machine Identity | Agent registration, sessions, and trust scoring |
| AI CMO           | AI content moderation and orchestration         |

Each service reports one of four statuses: **operational**, **degraded**, **outage**, or **unknown**. The page displays a per-service response time and an overall system health banner.

### Uptime history

A 90-day uptime bar shows daily availability for each service. Hover over any day to see the date and uptime percentage. An overall uptime percentage is displayed alongside each service.

### Incident history

Visit the **Incident History** page to see past incidents in a timeline format. Each entry includes the severity level, affected services, and timestamped updates from investigation through resolution.

### Subscribe to notifications

Enter your email at the bottom of the status page to receive incident notifications. You will be notified when incidents are created, updated, or resolved.

Enterprise customers can also configure webhook callbacks to receive status change events automatically.

### Programmatic status API

Query the status API for machine-readable service health. Use this to integrate Truthlocks availability into your own dashboards, alerting pipelines, or pre-flight checks. No authentication is required.

```http theme={null}
GET https://status.truthlocks.com/api/health
```

The endpoint returns the overall system status, a timestamp, and an array of per-service health checks:

```json theme={null}
{
  "status": "operational",
  "timestamp": "2026-03-26T14:30:00Z",
  "services": [
    {
      "id": "api-gateway",
      "name": "API Gateway",
      "status": "operational",
      "responseTime": 42
    },
    {
      "id": "signing-service",
      "name": "Signing",
      "status": "degraded",
      "responseTime": 1200,
      "error": "HTTP 503"
    }
  ]
}
```

**Response fields:**

| Field                     | Type           | Description                                                                   |
| ------------------------- | -------------- | ----------------------------------------------------------------------------- |
| `status`                  | string         | Overall system health: `operational`, `degraded`, or `outage`.                |
| `timestamp`               | string         | ISO 8601 timestamp of the check.                                              |
| `services`                | array          | Per-service health results.                                                   |
| `services[].id`           | string         | Machine-readable service identifier (e.g., `api-gateway`, `signing-service`). |
| `services[].name`         | string         | Human-readable service name.                                                  |
| `services[].status`       | string         | Service health: `operational`, `degraded`, or `outage`.                       |
| `services[].responseTime` | number or null | Response time in milliseconds, or `null` if unreachable.                      |
| `services[].error`        | string         | Present only when the service is not operational.                             |

The overall status is `outage` if any service is down, `degraded` if any service is slow or returning errors, and `operational` when all services are healthy.

**Example: poll status from your app**

```javascript theme={null}
async function checkTruthlockStatus() {
  const res = await fetch("https://status.truthlocks.com/api/health");
  const data = await res.json();

  if (data.status !== "operational") {
    console.warn(`Truthlocks is ${data.status}`);
    const issues = data.services.filter((s) => s.status !== "operational");
    issues.forEach((s) => console.warn(`  ${s.name}: ${s.status} — ${s.error}`));
  }

  return data;
}
```

**Example: pre-flight check before minting**

Check that the signing and attestation services are healthy before attempting a mint operation. This avoids unnecessary retries when you already know the required services are down.

```javascript theme={null}
async function mintWithStatusCheck(attestation) {
  const status = await fetch("https://status.truthlocks.com/api/health");
  const health = await status.json();

  const signing = health.services.find((s) => s.id === "signing-service");
  const attestations = health.services.find(
    (s) => s.id === "attestation-service"
  );

  if (
    signing?.status !== "operational" ||
    attestations?.status !== "operational"
  ) {
    throw new Error("Required services are not operational — retry later");
  }

  return client.attestations.mint(attestation);
}
```

<Note>
  The status API is rate-limited to prevent abuse. For continuous monitoring,
  poll no more frequently than once every 30 seconds.
</Note>

For the full response schema, monitored service IDs, and additional examples, see the [status API reference](/api-reference/health/status).

<CardGroup cols={2}>
  <Card title="Status page" icon="globe" href="https://status.truthlocks.com">
    Real-time service health and incident history.
  </Card>

  <Card title="Webhook notifications" icon="plug">
    Enterprise customers can configure webhook callbacks for status changes.
  </Card>

  <Card title="Status API reference" icon="code" href="/api-reference/health/status">
    Full API reference for the programmatic status endpoint.
  </Card>

  <Card title="Email alerts" icon="envelope">
    Subscribe on the status page for incident notifications.
  </Card>
</CardGroup>

## Service Level Agreement

| Tier             | Uptime SLA  | Response Time P99 | Support Response   |
| ---------------- | ----------- | ----------------- | ------------------ |
| **Free**         | Best effort | -                 | Community          |
| **Starter**      | 99.5%       | 500ms             | 48h business hours |
| **Professional** | 99.9%       | 200ms             | 24h business hours |
| **Enterprise**   | 99.99%      | 100ms             | 4h (24/7)          |

<Info>
  **Credits:** If we miss SLA targets, you're entitled to service credits. See
  your contract or contact support for details.
</Info>

## Monitoring Integration

Integrate Truthlocks health checks with your observability tools:

```yaml Prometheus theme={null}
# prometheus.yml
scrape_configs:
  - job_name: "truthlock-health"
    scrape_interval: 30s
    metrics_path: /metrics
    static_configs:
      - targets: ["api.truthlocks.com"]
```

```yaml Datadog theme={null}
# datadog.yaml
init_config:

instances:
  - name: truthlock_api
    url: https://api.truthlocks.com/health/ready
    timeout: 5
    content_match: '"status":"ok"'
    http_response_status_code: 200
    tags:
      - service:truthlock
      - env:production
```

```javascript Custom Dashboard Metrics theme={null}
// Export key metrics for dashboards
const metrics = {
  "truthlock.availability": isHealthy ? 1 : 0,
  "truthlock.latency_ms": responseTime,
  "truthlock.ratelimit_remaining": rateLimitRemaining,
  "truthlock.attestations_today": dailyCount,
};
```

## Gateway resilience

The API gateway includes automatic panic recovery and zero-downtime deployment support:

* **Panic recovery** — If the gateway encounters an unexpected internal error, it recovers automatically and returns a structured error response instead of dropping your connection. You do not need to handle dropped connections caused by gateway-level panics.
* **Graceful shutdown** — During deployments, the gateway and signing service drain in-flight requests over a 15-second window instead of terminating them immediately. If you previously experienced occasional request failures during maintenance windows, those should no longer occur.

These protections work automatically and require no changes to your integration.

## Incident response

If Truthlocks is experiencing issues:

1. **Check status page:** [status.truthlocks.com](https://status.truthlocks.com)
2. **Enable circuit breaker:** Fail gracefully in your app
3. **Queue operations:** Retry attestation minting later
4. **Contact support:** For Enterprise SLA escalation

### Circuit Breaker Pattern

```javascript theme={null}
import CircuitBreaker from "opossum";

const breaker = new CircuitBreaker(
  async (attestation) => client.attestations.mint(attestation),
  {
    timeout: 5000, // Fail if no response in 5s
    errorThresholdPercentage: 50, // Open if 50% fail
    resetTimeout: 30000, // Try again after 30s
  },
);

breaker.fallback(() => {
  // Queue for retry later
  queue.add("retry-attestation", attestation);
  return { queued: true };
});
```

## Next steps

<CardGroup cols={2}>
  <Card title="Observability dashboard" icon="chart-mixed" href="/guides/observability">
    Monitor service health, latency, and usage from the console.
  </Card>

  <Card title="Error reference" icon="circle-exclamation" href="/ops/errors">
    Complete list of error codes and handling.
  </Card>

  <Card title="Rate limits" icon="gauge-high" href="/ops/limits">
    Handle rate limiting gracefully.
  </Card>
</CardGroup>
