Checkups API — מדריך התחלה
REST + JSON. כל הקריאות יוצאות אל https://api.checkups.co.il/v1/. לתיעוד מלא פר-endpoint עם "Try it" → API Reference.
אימות
צור מפתח ב-/settings/api-keys ( המפתח מוצג פעם אחת בלבד). שלח אותו בכותרת:
Authorization: Bearer upt_live_<your-key>לדוגמאות שלמטה: export CHECKUPS_KEY=upt_live_...
דוגמאות
List monitors
curl https://api.checkups.co.il/v1/monitors \
-H "Authorization: Bearer $CHECKUPS_KEY"Create a monitor
curl https://api.checkups.co.il/v1/monitors \
-X POST \
-H "Authorization: Bearer $CHECKUPS_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Production API",
"url": "https://api.example.com/health",
"intervalSeconds": 60,
"failureThreshold": 3,
"slackWebhookUrl": "https://hooks.slack.com/services/..."
}'Get a monitor (with recent checks + incidents)
curl https://api.checkups.co.il/v1/monitors/MONITOR_ID \
-H "Authorization: Bearer $CHECKUPS_KEY"Update a monitor (any subset of fields)
curl https://api.checkups.co.il/v1/monitors/MONITOR_ID \
-X PATCH \
-H "Authorization: Bearer $CHECKUPS_KEY" \
-H "Content-Type: application/json" \
-d '{"intervalSeconds": 300, "failureThreshold": 5}'Pause / resume
# pause
curl https://api.checkups.co.il/v1/monitors/MONITOR_ID/pause \
-X POST -H "Authorization: Bearer $CHECKUPS_KEY"
# resume
curl https://api.checkups.co.il/v1/monitors/MONITOR_ID/resume \
-X POST -H "Authorization: Bearer $CHECKUPS_KEY"Trigger immediate check
curl https://api.checkups.co.il/v1/monitors/MONITOR_ID/check-now \
-X POST -H "Authorization: Bearer $CHECKUPS_KEY"Delete a monitor
curl https://api.checkups.co.il/v1/monitors/MONITOR_ID \
-X DELETE \
-H "Authorization: Bearer $CHECKUPS_KEY"התראות Slack
קבע slackWebhookUrl פר-מוניטור ( ב-create או ב-PATCH). Checkups שולח POST פשוט ל-webhook הזה ברגע שמוניטור נופל וברגע שהוא מתאושש. ה-webhook עצמו נוצר ב-Slack דרך Incoming Webhooks.
מתי התראה נשלחת
- נפילה: אחרי
failureThresholdכשלים רצופים ועוד confirmation re-check מיידי שאישר שהאתר אכן למטה. - התאוששות: בבדיקה הראשונה שחוזרת ל-
upאחרי שהמוניטור היהdown. - אין retry ב-v1 — אם Slack מחזיר 5xx, ההודעה מאבדת. לוגיקת queue + dedup מתוכננת לנפח גבוה.
מבנה ה-payload
פורמט Slack "simple message" — שדה text בלבד. השם, סיבת הכשל וה-URL מוטמעים בתוך הטקסט.
נפילה (POST → ה-webhook שלך)
{
"text": ":red_circle: *Production API* is DOWN — fetch failed: connect ECONNREFUSED\nhttps://api.example.com/health"
}התאוששות
{
"text": ":large_green_circle: *Production API* recovered\nhttps://api.example.com/health"
}איך זה נראה ב-Slack
🔴 Production API is DOWN — fetch failed: connect ECONNREFUSED
https://api.example.com/healthבדיקה מקומית ללא Slack
להריץ webhook sink מקומי בזמן פיתוח (Python 3, נטו stdlib):
python3 -c '
import http.server, sys
class H(http.server.BaseHTTPRequestHandler):
def do_POST(self):
n=int(self.headers.get("content-length","0"))
sys.stderr.write(self.rfile.read(n).decode()+"\n"); sys.stderr.flush()
self.send_response(200); self.end_headers(); self.wfile.write(b"ok")
def log_message(self,*a): pass
http.server.HTTPServer(("127.0.0.1",9999),H).serve_forever()
'
# ואז קבע slackWebhookUrl=http://127.0.0.1:9999/hook על מוניטור מקומיתגובות וטיפול בשגיאות
200 / 201— הצלחה. גוף תגובה:{ monitor }/{ monitors: [...] }.400— קלט לא תקין. גוף תגובה כולל{ error, issues }(issues = Zod issues array).401— מפתח שגוי, חסר, או פג תוקף.404— המוניטור לא קיים או לא שייך לבעלים של המפתח (בידוד פר-משתמש).409— חרגת ממכסת המוניטורים (100 פר-משתמש כברירת מחדל).
מוכן לעבור ל-reference המלא?
כל endpoint, כל פרמטר, כל schema response — עם "Try it" שלוקח את המפתח שלך.
פתיחת API Reference →