> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.etera.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.etera.dev/_mcp/server.

# 🩺 Service Health Check

GET https://api.etera.dev/experience/booking/health

**Comprehensive health check for the Experience Booking Service**

This endpoint provides detailed information about the service health, provider status, and system metrics.

## 🔍 **Health Check Includes**

### **Service Status**

* ✅ **Overall Health** - Service operational status
* 📊 **System Metrics** - Memory usage, CPU statistics, uptime
* 🌍 **Environment Info** - Current deployment environment
* ⚡ **Performance** - Response times and resource utilization

### **Provider Health**

* 🔗 **Headout** - Integration status and connectivity
* 🎭 **Experience Providers** - Platform integration health
* 🔄 **Fallback Status** - Multi-provider redundancy status

### **Infrastructure Dependencies**

* 🗄️ **Database** - PostgreSQL connection status
* ⚡ **Cache** - Redis cache connectivity
* 📨 **Message Queue** - Kafka broker status
* 🔐 **Authentication** - Auth service connectivity

## 🚨 **Status Indicators**

* **🟢 healthy** - All systems operational
* **🟡 degraded** - Some non-critical issues detected
* **🔴 unhealthy** - Critical issues requiring attention
* **⚫ maintenance** - Planned maintenance mode

## 📊 **Monitoring Integration**

This endpoint is designed for:

* **Health Check Probes** - Kubernetes/Docker health checks
* **Load Balancer** - Backend health verification
* **Monitoring Systems** - Prometheus, Grafana, DataDog
* **Alerting** - PagerDuty, Slack notifications
* **SLA Tracking** - Uptime and availability metrics

## 🔗 **Related Endpoints**

* **Provider Health**: `GET /providers/health` - Detailed provider status
* **System Metrics**: `GET /management/{experienceId}/analytics` - Business metrics
* **Performance**: Response time tracking in all endpoints

Reference: https://docs.etera.dev/experience/booking/experience-booking-api/health/get-health

## Authentication

- `Authorization` header (bearer token, required) — JWT token from @etera-ai/auth package (auth.etera.dev) - Format: Bearer \<token>

## Servers

- `https://api.etera.dev/experience/booking` (Production, default)
- `https://api-stage.etera.dev/experience/booking` (Staging)
- `https://api-dev.etera.dev/experience/booking` (Development)

## Response

### 200

✅ Service is healthy and operational

- `status` (enum, required) — Overall service health status
  - Allowed values: `healthy`, `degraded`, `unhealthy`, `maintenance`
- `service` (string, required) — Service identifier
- `version` (string, required) — Current service version
- `timestamp` (datetime, required) — Health check timestamp
- `providers` (HealthGetResponsesContentApplicationJsonSchemaProviders, required) — Booking provider status
- `uptime` (double, optional) — Service uptime in seconds
- `environment` (string, optional) — Deployment environment
- `system` (HealthGetResponsesContentApplicationJsonSchemaSystem, optional) — System performance metrics
- `dependencies` (HealthGetResponsesContentApplicationJsonSchemaDependencies, optional) — External dependency status

## Errors

### 503 Service Unavailable Error

🔴 Service is unhealthy or unavailable

- `status` (string, optional)
- `service` (string, optional)
- `timestamp` (datetime, optional)
- `errors` (list of string, optional)

## Types

### HealthGetResponsesContentApplicationJsonSchemaProviders

Booking provider status

- `headout` (enum, optional) — Headout integration status
  - Allowed values: `configured`, `healthy`, `degraded`, `offline`
- `experienceProviders` (enum, optional) — Experience providers integration status
  - Allowed values: `configured`, `healthy`, `degraded`, `offline`

### HealthGetResponsesContentApplicationJsonSchemaSystem

System performance metrics

- `memory` (HealthGetResponsesContentApplicationJsonSchemaSystemMemory, optional)
- `cpu` (HealthGetResponsesContentApplicationJsonSchemaSystemCpu, optional)

### HealthGetResponsesContentApplicationJsonSchemaDependencies

External dependency status

- `database` (enum, optional) — PostgreSQL database status
  - Allowed values: `connected`, `disconnected`, `degraded`
- `cache` (enum, optional) — Redis cache status
  - Allowed values: `connected`, `disconnected`, `degraded`
- `kafka` (enum, optional) — Kafka message broker status
  - Allowed values: `connected`, `disconnected`, `degraded`

### HealthGetResponsesContentApplicationJsonSchemaSystemMemory

- `used` (double, optional) — Used heap memory in bytes
- `total` (double, optional) — Total heap memory in bytes
- `external` (double, optional) — External memory usage in bytes

### HealthGetResponsesContentApplicationJsonSchemaSystemCpu

- `usage` (HealthGetResponsesContentApplicationJsonSchemaSystemCpuUsage, optional) — CPU usage statistics

### HealthGetResponsesContentApplicationJsonSchemaSystemCpuUsage

CPU usage statistics

- `user` (double, optional)
- `system` (double, optional)

## Examples

### 🟢 Healthy Service

**Response**

```json
{
  "status": "healthy",
  "service": "booking-api",
  "version": "1.0.0",
  "timestamp": "2024-02-15T10:30:00.000Z",
  "providers": {
    "headout": "healthy",
    "experienceProviders": "configured"
  },
  "uptime": 86400,
  "environment": "production",
  "system": {
    "memory": {
      "used": 50331648,
      "total": 67108864,
      "external": 1234567
    },
    "cpu": {
      "usage": {
        "user": 123456,
        "system": 78910
      }
    }
  },
  "dependencies": {
    "database": "connected",
    "cache": "connected",
    "kafka": "connected"
  }
}
```

**SDK Code**

```python 🟢 Healthy Service
import requests

url = "https://api.etera.dev/experience/booking/health"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript 🟢 Healthy Service
const url = 'https://api.etera.dev/experience/booking/health';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go 🟢 Healthy Service
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.etera.dev/experience/booking/health"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby 🟢 Healthy Service
require 'uri'
require 'net/http'

url = URI("https://api.etera.dev/experience/booking/health")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java 🟢 Healthy Service
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.etera.dev/experience/booking/health")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php 🟢 Healthy Service
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.etera.dev/experience/booking/health', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp 🟢 Healthy Service
using RestSharp;

var client = new RestClient("https://api.etera.dev/experience/booking/health");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift 🟢 Healthy Service
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.etera.dev/experience/booking/health")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### 🟡 Degraded Service

**Response**

```json
{
  "status": "degraded",
  "service": "booking-api",
  "version": "1.0.0",
  "timestamp": "2024-02-15T10:30:00.000Z",
  "providers": {
    "headout": "healthy",
    "experienceProviders": "offline"
  },
  "uptime": 3600,
  "environment": "production",
  "dependencies": {
    "database": "connected",
    "cache": "degraded",
    "kafka": "connected"
  }
}
```

**SDK Code**

```python 🟡 Degraded Service
import requests

url = "https://api.etera.dev/experience/booking/health"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript 🟡 Degraded Service
const url = 'https://api.etera.dev/experience/booking/health';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go 🟡 Degraded Service
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.etera.dev/experience/booking/health"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby 🟡 Degraded Service
require 'uri'
require 'net/http'

url = URI("https://api.etera.dev/experience/booking/health")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java 🟡 Degraded Service
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.etera.dev/experience/booking/health")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php 🟡 Degraded Service
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.etera.dev/experience/booking/health', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp 🟡 Degraded Service
using RestSharp;

var client = new RestClient("https://api.etera.dev/experience/booking/health");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift 🟡 Degraded Service
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.etera.dev/experience/booking/health")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```