Service Status Webhooks

Update Alert24 Service Status via REST API or curl

Update Alert24 service status from any script, monitoring tool, or CI/CD pipeline using the REST API. Includes curl, Python, and Go examples.

For any tool not covered elsewhere, you can update Alert24 service status directly using the REST API. A single curl call is all it takes — from a shell script, a Makefile, a monitoring agent, or anything that can make an HTTP request.

Direct service status update

Use PUT /api/v1/services/{serviceId} to set a service's status directly:

curl -s -X PUT https://app.alert24.net/api/v1/services/svc_YOUR_SERVICE_ID \
  -H "Authorization: Bearer ak_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status": "down"}'

Valid status values: operational, degraded, down, maintenance

Find your service ID in Alert24 under Services, or via:

curl https://app.alert24.net/api/v1/services \
  -H "Authorization: Bearer ak_live_YOUR_KEY"

Via the incoming webhook receiver

Create a webhook receiver in Alert24 (Settings → Webhook Receivers) and POST any JSON you control. This is useful when you want Alert24 to handle the status mapping rather than your script:

# Your monitoring script detects a problem
curl -s -X POST https://app.alert24.net/api/webhooks/incoming/YOUR_TOKEN \
  -H "Content-Type: application/json" \
  -d '{
    "status": "down",
    "message": "Health check failed: connection refused",
    "source": "custom-monitor"
  }'

# Service recovers
curl -s -X POST https://app.alert24.net/api/webhooks/incoming/YOUR_TOKEN \
  -H "Content-Type: application/json" \
  -d '{
    "status": "operational",
    "message": "Health check passed",
    "source": "custom-monitor"
  }'

Configure the receiver to map statusoperational, degraded, down.

Python

import requests

API_KEY = "ak_live_YOUR_KEY"
SERVICE_ID = "svc_YOUR_SERVICE_ID"

def set_service_status(status: str, description: str = ""):
    """status: operational | degraded | down | maintenance"""
    resp = requests.put(
        f"https://app.alert24.net/api/v1/services/{SERVICE_ID}",
        headers={"Authorization": f"Bearer {API_KEY}"},
        json={"status": status, "description": description},
    )
    resp.raise_for_status()

# Usage
set_service_status("down", "Database connection timeout")
# ... after recovery ...
set_service_status("operational")

Go

package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
    "os"
)

func setServiceStatus(serviceID, status string) error {
    body, _ := json.Marshal(map[string]string{"status": status})
    req, _ := http.NewRequest("PUT",
        fmt.Sprintf("https://app.alert24.net/api/v1/services/%s", serviceID),
        bytes.NewReader(body),
    )
    req.Header.Set("Authorization", "Bearer "+os.Getenv("ALERT24_API_KEY"))
    req.Header.Set("Content-Type", "application/json")
    _, err := http.DefaultClient.Do(req)
    return err
}

Common patterns

Wrap a health check script:

#!/bin/bash
if pg_isready -h db.prod.internal; then
  curl -s -X PUT https://app.alert24.net/api/v1/services/svc_ID \
    -H "Authorization: Bearer $ALERT24_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"status": "operational"}'
else
  curl -s -X PUT https://app.alert24.net/api/v1/services/svc_ID \
    -H "Authorization: Bearer $ALERT24_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"status": "down"}'
fi

In a Makefile:

deploy:
	./scripts/deploy.sh

rollback:
	./scripts/rollback.sh
	curl -s -X PUT https://app.alert24.net/api/v1/services/svc_ID \
	  -H "Authorization: Bearer $(ALERT24_API_KEY)" \
	  -H "Content-Type: application/json" \
	  -d '{"status":"maintenance"}'

Tips

  • API key scope: Use a key with write scope for service status updates, or the granular services scope.
  • Idempotency: Calling PUT with the current status is safe — Alert24 accepts it without side effects.
  • Maintenance mode: Set status: maintenance before planned downtime so your status page shows the right message to visitors instead of showing as down.