REST-API
Verwalten Sie Ihre Cronjobs programmgesteuert, in JSON.
Authentifizierung
Erstellen Sie einen Schlüssel unter Konto › API-Schlüssel und senden Sie ihn im Header Authorization: Bearer (oder X-API-Key).
curl -H "Authorization: Bearer 7c_xxxxxxxx…" https://7cron.com/api/v1/me
Limit: 120 Anfragen pro Minute. Datumsangaben in UTC (ISO 8601). Der API-Zugang kann je nach Tarif eine Option sein.
Endpunkte
| GET /me | Ihr Konto und Ihre Limits |
| GET /jobs | Ihre Jobs auflisten |
| POST /jobs | Job erstellen (HTTP oder Heartbeat) |
| GET /jobs/{id} | Job-Details |
| PATCH /jobs/{id} | Job bearbeiten (nur gesendete Felder) |
| DELETE /jobs/{id} | Job und Verlauf löschen |
| POST /jobs/{id}/run | HTTP-Job jetzt ausführen |
| POST /jobs/{id}/pause | Job pausieren |
| POST /jobs/{id}/resume | Job fortsetzen |
| GET /jobs/{id}/logs?limit=50 | Letzte Ausführungen (max. 500) |
Base URL : https://7cron.com/api/v1
Beispiel und Felder
Gleiche Felder und Regeln wie im Webformular:
curl -X POST https://7cron.com/api/v1/jobs \
-H "Authorization: Bearer 7c_xxxxxxxx…" -H "Content-Type: application/json" \
-d '{"name":"Nightly backup","url":"https://example.com/cron/backup",
"method":"POST","cron_expr":"0 3 * * *","timezone":"Europe/Zurich",
"timeout":30,"retries":1,"alert_threshold":3,"success_keyword":"OK"}'
# Heartbeat
curl -X POST https://7cron.com/api/v1/jobs -H "Authorization: Bearer 7c_…" -H "Content-Type: application/json" \
-d '{"type":"heartbeat","name":"Backup script","hb_period_min":1440,"hb_grace_min":30}'
type, name, url, method, headers, body, cron_expr, timezone, timeout, enabled, notify_on_failure, notify_chat, alert_threshold, webhook_url, success_keyword, keyword_mode (contains|absent), retries, hb_period_min, hb_grace_min, on_status_page
Fehler
{"error": {"code": 422, "message": "Validation failed.", "fields": {"cron_expr": "…"}}}
Codes: 400 ungültiges JSON, 401 Schlüssel fehlt, 403 nicht erlaubt, 404 nicht gefunden, 405 Methode, 422 Validierung, 429 Ratenlimit.