curl -X POST "https://kodostatus.com/api/v1/ssl-monitors" \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"domain": "api.example.com",
"alert_days": 30,
"service_id": "svc_xyz789"
}'
const response = await fetch('https://kodostatus.com/api/v1/ssl-monitors', {
method: 'POST',
headers: {
'X-API-Key': 'your_api_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
domain: 'api.example.com',
alert_days: 30,
service_id: 'svc_xyz789'
})
});
const ssl_monitor = await response.json();
{
"id": "ssl_abc123",
"domain": "api.example.com",
"port": 443,
"alert_days": 30,
"enabled": true,
"last_checked_at": "2024-01-15T10:30:00Z",
"certificate": {
"issuer": "Let's Encrypt Authority X3",
"subject": "api.example.com",
"valid_from": "2024-01-01T00:00:00Z",
"valid_to": "2024-04-01T00:00:00Z",
"days_until_expiry": 76,
"is_valid": true
},
"service_id": "svc_xyz789",
"created_at": "2024-01-15T10:30:00Z"
}
SSL Monitors
Create SSL Monitor
Create a new SSL certificate monitor to track certificate expiration
POST
/
ssl-monitors
curl -X POST "https://kodostatus.com/api/v1/ssl-monitors" \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"domain": "api.example.com",
"alert_days": 30,
"service_id": "svc_xyz789"
}'
const response = await fetch('https://kodostatus.com/api/v1/ssl-monitors', {
method: 'POST',
headers: {
'X-API-Key': 'your_api_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
domain: 'api.example.com',
alert_days: 30,
service_id: 'svc_xyz789'
})
});
const ssl_monitor = await response.json();
{
"id": "ssl_abc123",
"domain": "api.example.com",
"port": 443,
"alert_days": 30,
"enabled": true,
"last_checked_at": "2024-01-15T10:30:00Z",
"certificate": {
"issuer": "Let's Encrypt Authority X3",
"subject": "api.example.com",
"valid_from": "2024-01-01T00:00:00Z",
"valid_to": "2024-04-01T00:00:00Z",
"days_until_expiry": 76,
"is_valid": true
},
"service_id": "svc_xyz789",
"created_at": "2024-01-15T10:30:00Z"
}
Request Body
string
required
Domain to monitor (e.g., “api.example.com”). Do not include protocol.
number
default:"443"
Port to check for SSL certificate
number
default:"30"
Number of days before expiration to trigger alerts. Recommended: 30 for production, 14 for staging.
string
Optional service ID to link this monitor to. When linked, service status can auto-update based on certificate validity.
array
Array of notification channel IDs to alert on certificate issues
Response
Returns the created SSL monitor object with initial certificate check results.curl -X POST "https://kodostatus.com/api/v1/ssl-monitors" \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"domain": "api.example.com",
"alert_days": 30,
"service_id": "svc_xyz789"
}'
const response = await fetch('https://kodostatus.com/api/v1/ssl-monitors', {
method: 'POST',
headers: {
'X-API-Key': 'your_api_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
domain: 'api.example.com',
alert_days: 30,
service_id: 'svc_xyz789'
})
});
const ssl_monitor = await response.json();
{
"id": "ssl_abc123",
"domain": "api.example.com",
"port": 443,
"alert_days": 30,
"enabled": true,
"last_checked_at": "2024-01-15T10:30:00Z",
"certificate": {
"issuer": "Let's Encrypt Authority X3",
"subject": "api.example.com",
"valid_from": "2024-01-01T00:00:00Z",
"valid_to": "2024-04-01T00:00:00Z",
"days_until_expiry": 76,
"is_valid": true
},
"service_id": "svc_xyz789",
"created_at": "2024-01-15T10:30:00Z"
}
Error Codes
| Status | Description |
|---|---|
| 400 | Invalid domain format or unreachable |
| 401 | Invalid or missing API key |
| 422 | SSL certificate could not be retrieved |
| 429 | Rate limit exceeded |