Health Check
The health endpoint provides a simple way to check if the Submagic API is operational. This endpoint does not require authentication and can be used for monitoring and health checks.
This endpoint does not require authentication and is not subject to rate
limiting.
Request
This endpoint does not accept any parameters.
Response
The current status of the API service
ISO 8601 timestamp of when the response was generated
curl -X GET "https://api.submagic.co/health"
{
"status" : "healthy" ,
"service" : "submagic-public-api" ,
"timestamp" : "2024-01-15T10:30:00.000Z"
}
Use Cases
Uptime Monitoring Use this endpoint to monitor API availability in your monitoring systems
Load Balancer Health Checks Configure your load balancer to use this endpoint for health checks
CI/CD Pipeline Validation Verify API availability before running integration tests
Status Page Integration Include this endpoint in your status page monitoring
Status Values
Status Description healthyAPI is operational and ready to accept requests degradedAPI is operational but experiencing issues unhealthyAPI is not operational
Example Monitoring Script
Here’s a simple monitoring script you can use:
#!/bin/bash
response = $( curl -s -o /dev/null -w "%{http_code}" https://api.submagic.co/health )
if [ $response -eq 200 ]; then
echo "API is healthy"
exit 0
else
echo "API is not responding (HTTP $response )"
exit 1
fi
The health endpoint is designed to respond quickly (typically under 100ms) to
provide fast health check results for monitoring systems.