Skip to main content
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"
  }'
{
  "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

domain
string
required
Domain to monitor (e.g., “api.example.com”). Do not include protocol.
port
number
default:"443"
Port to check for SSL certificate
alert_days
number
default:"30"
Number of days before expiration to trigger alerts. Recommended: 30 for production, 14 for staging.
service_id
string
Optional service ID to link this monitor to. When linked, service status can auto-update based on certificate validity.
notification_channels
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"
  }'
{
  "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

StatusDescription
400Invalid domain format or unreachable
401Invalid or missing API key
422SSL certificate could not be retrieved
429Rate limit exceeded