Health Check
curl --request GET \
--url https://api.wistx.ai/v1/health \
--header 'Authorization: <authorization>'import requests
url = "https://api.wistx.ai/v1/health"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.wistx.ai/v1/health', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wistx.ai/v1/health",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.wistx.ai/v1/health"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.wistx.ai/v1/health")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wistx.ai/v1/health")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"status": "healthy"
}
API Reference
Health Check
Check API health status and system status
GET
/
v1
/
health
Health Check
curl --request GET \
--url https://api.wistx.ai/v1/health \
--header 'Authorization: <authorization>'import requests
url = "https://api.wistx.ai/v1/health"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.wistx.ai/v1/health', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wistx.ai/v1/health",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.wistx.ai/v1/health"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.wistx.ai/v1/health")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wistx.ai/v1/health")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"status": "healthy"
}
Check API health status and comprehensive system status
Endpoints
WISTX provides three health and status endpoints:GET /v1/health- Basic health check (simple status)GET /v1/status- Comprehensive system status (all services)GET /v1/status/uptime- Uptime statistics
Basic Health Check
GET /v1/health
Simple health check endpoint for quick status verification.
curl --request GET \
--url https://api.wistx.ai/v1/health
import requests
url = "https://api.wistx.ai/v1/health"
response = requests.get(url)
print(response.json())
const url = "https://api.wistx.ai/v1/health";
const response = await fetch(url);
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.wistx.ai/v1/health"
resp, _ := http.Get(url)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
require 'net/http'
require 'json'
require 'uri'
url = URI("https://api.wistx.ai/v1/health")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
response = http.get(url.path)
puts JSON.parse(response.body)
<?php
$url = "https://api.wistx.ai/v1/health";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class HealthCheck {
public static void main(String[] args) throws Exception {
URL url = new URL("https://api.wistx.ai/v1/health");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
System.out.println(response.toString());
}
}
Response
{
"status": "healthy"
}
Response Fields
Get System Status
GET /v1/status
Comprehensive status check for all WISTX services including API, Database, Vector Search, Indexing, and Authentication.
curl --request GET \
--url https://api.wistx.ai/v1/status \
--header 'Authorization: Bearer YOUR_API_KEY'
import requests
api_key = "YOUR_API_KEY"
url = "https://api.wistx.ai/v1/status"
response = requests.get(
url,
headers={"Authorization": f"Bearer {api_key}"}
)
data = response.json()
print(f"Overall Status: {data['status']}")
print(f"API Status: {data['services']['api']['status']}")
print(f"Database Status: {data['services']['database']['status']}")
const apiKey = "YOUR_API_KEY";
const url = "https://api.wistx.ai/v1/status";
const response = await fetch(url, {
headers: {
"Authorization": `Bearer ${apiKey}`
}
});
const data = await response.json();
console.log(`Overall Status: ${data.status}`);
console.log(`API Status: ${data.services.api.status}`);
console.log(`Database Status: ${data.services.database.status}`);
package main
import (
"encoding/json"
"fmt"
"net/http"
"io"
)
func main() {
apiKey := "YOUR_API_KEY"
url := "https://api.wistx.ai/v1/status"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var result map[string]interface{}
json.Unmarshal(body, &result)
fmt.Printf("Overall Status: %v\n", result["status"])
}
require 'net/http'
require 'json'
require 'uri'
api_key = "YOUR_API_KEY"
url = URI("https://api.wistx.ai/v1/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer #{api_key}"
response = http.request(request)
data = JSON.parse(response.body)
puts "Overall Status: #{data['status']}"
puts "API Status: #{data['services']['api']['status']}"
<?php
$apiKey = "YOUR_API_KEY";
$url = "https://api.wistx.ai/v1/status";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer " . $apiKey
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
echo "Overall Status: " . $data['status'] . "\n";
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import org.json.JSONObject;
public class GetStatus {
public static void main(String[] args) throws Exception {
String apiKey = "YOUR_API_KEY";
URL url = new URL("https://api.wistx.ai/v1/status");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setRequestProperty("Authorization", "Bearer " + apiKey);
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
JSONObject json = new JSONObject(response.toString());
System.out.println("Overall Status: " + json.getString("status"));
}
}
Authorization
Response
{
"status": "operational",
"timestamp": "2024-12-20T10:30:00.000Z",
"check_duration_ms": 45.2,
"services": {
"api": {
"status": "operational",
"version": "1.0.0",
"title": "WISTX API",
"uptime_seconds": 86400
},
"database": {
"status": "operational",
"latency_ms": 12.5,
"connections": {
"current": 15,
"available": 35,
"max": 50
},
"server_version": "7.0.0"
},
"vector_search": {
"status": "operational",
"index_name": "wistx",
"total_vectors": 150000,
"indexes": {}
},
"indexing": {
"status": "operational",
"recent_jobs_today": 25,
"active_jobs": 2
},
"authentication": {
"status": "operational",
"total_users": 1250,
"active_users": 1180
}
}
}
Response Fields
Status of individual services:
api- API service statusdatabase- MongoDB database statusvector_search- Pinecone vector search statusindexing- Indexing service statusauthentication- Authentication service status
Get Uptime Statistics
GET /v1/status/uptime
Get uptime statistics for WISTX services over a specified period.
curl --request GET \
--url "https://api.wistx.ai/v1/status/uptime?days=30" \
--header 'Authorization: Bearer YOUR_API_KEY'
import requests
api_key = "YOUR_API_KEY"
url = "https://api.wistx.ai/v1/status/uptime"
response = requests.get(
url,
params={"days": 30},
headers={"Authorization": f"Bearer {api_key}"}
)
data = response.json()
print(f"Uptime: {data['uptime_percentage']}%")
print(f"Total Checks: {data['total_checks']}")
const apiKey = "YOUR_API_KEY";
const url = "https://api.wistx.ai/v1/status/uptime";
const response = await fetch(`${url}?days=30`, {
headers: {
"Authorization": `Bearer ${apiKey}`
}
});
const data = await response.json();
console.log(`Uptime: ${data.uptime_percentage}%`);
console.log(`Total Checks: ${data.total_checks}`);
package main
import (
"encoding/json"
"fmt"
"net/http"
"io"
"net/url"
)
func main() {
apiKey := "YOUR_API_KEY"
baseURL := "https://api.wistx.ai/v1/status/uptime"
params := url.Values{}
params.Add("days", "30")
fullURL := fmt.Sprintf("%s?%s", baseURL, params.Encode())
req, _ := http.NewRequest("GET", fullURL, nil)
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var result map[string]interface{}
json.Unmarshal(body, &result)
fmt.Printf("Uptime: %.2f%%\n", result["uptime_percentage"])
}
require 'net/http'
require 'json'
require 'uri'
api_key = "YOUR_API_KEY"
url = URI("https://api.wistx.ai/v1/status/uptime")
url.query = URI.encode_www_form({ days: 30 })
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer #{api_key}"
response = http.request(request)
data = JSON.parse(response.body)
puts "Uptime: #{data['uptime_percentage']}%"
<?php
$apiKey = "YOUR_API_KEY";
$url = "https://api.wistx.ai/v1/status/uptime?days=30";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer " . $apiKey
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
echo "Uptime: " . $data['uptime_percentage'] . "%\n";
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import org.json.JSONObject;
public class GetUptime {
public static void main(String[] args) throws Exception {
String apiKey = "YOUR_API_KEY";
URL url = new URL("https://api.wistx.ai/v1/status/uptime?days=30");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setRequestProperty("Authorization", "Bearer " + apiKey);
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
JSONObject json = new JSONObject(response.toString());
System.out.println("Uptime: " + json.getDouble("uptime_percentage") + "%");
}
}
Query Parameters
Authorization
Response
{
"period_days": 30,
"total_checks": 43200,
"operational_checks": 43164,
"uptime_percentage": 99.92
}
{
"period_days": 30,
"total_checks": 0,
"operational_checks": 0,
"uptime_percentage": 0.0,
"message": "No historical status data available. Historical uptime statistics require periodic status checks to be stored."
}
Response Fields
Uptime percentage calculated as (operational_checks / total_checks) * 100. Returns 0.0 if no historical data is available.
Informational message about uptime statistics. Present when no historical data is available or when there are issues retrieving statistics.
Historical Data Requirement: Uptime statistics require periodic status checks to be stored in the database. If no historical data exists, the endpoint will return
total_checks: 0 and uptime_percentage: 0.0 with an explanatory message. For real-time status, use /v1/status instead.Use Cases
- Monitoring: Use
/v1/statusto monitor all WISTX services - Load Balancer Health Checks: Use
/v1/healthfor simple health checks - Status Pages: Display comprehensive status using
/v1/status - Uptime Tracking: Track service reliability using
/v1/status/uptime - Alerting: Set up alerts based on status endpoint responses
Related Documentation
- Status Page - Visual status dashboard
- API Reference - Overview of all API endpoints