{"openapi":"3.1.0","info":{"title":"Alert51 Developer API","version":"1.0.0","description":"Report job runs and read monitoring state. Authenticate with an account API token: `Authorization: Bearer <token>`. Monitoring starts with the first check-in. Defaults: timezone UTC, graceSeconds 300. Plans: Free 3 monitors, Startup 15 monitors, Basic 50 monitors, Pro 250 monitors, Max 500 monitors."},"servers":[{"url":"https://api.alert51.com/v1","description":"Developer API"},{"url":"https://alert51.com/api/v1","description":"Same API on the web origin"}],"security":[{"bearerAuth":[]}],"paths":{"/check-ins":{"post":{"operationId":"createCheckIn","summary":"Report a job run","description":"Creates the project and monitor on the first check-in (cron required), records the result, and returns the next run and deadline. Slot = latest cron fire time at or before (scheduledAt ?? received time) + 60 s. Reports older than the latest applied one are stored as stale.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":255},"description":"Same key and body within 24 h returns the original response with `Idempotent-Replayed: true`. A different body returns 409."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckInRequest"}}}},"responses":{"200":{"description":"Recorded for an existing monitor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckInResponse"}}}},"201":{"description":"Monitor created and check-in recorded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckInResponse"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, invalid or revoked token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"quota_exceeded or email_not_verified","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"idempotency_key_reuse","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body larger than 16 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"cron_required, invalid_cron, invalid_timezone or scheduled_at_out_of_range","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: more than 3 requests per second for this token. Wait Retry-After seconds (also in error.details.retryAfterSeconds).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/projects":{"get":{"operationId":"listProjects","summary":"List projects","responses":{"200":{"description":"Projects","content":{"application/json":{"schema":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Project"}},"nextCursor":{"type":["string","null"]}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/projects/{project}/monitors":{"get":{"operationId":"listMonitors","summary":"List monitors in a project","parameters":[{"name":"project","in":"path","required":true,"schema":{"type":"string"},"description":"Project slug"},{"name":"status","in":"query","schema":{"type":"string","enum":["up","down","paused"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Opaque cursor from nextCursor"}],"responses":{"200":{"description":"Monitors","content":{"application/json":{"schema":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Monitor"}},"nextCursor":{"type":["string","null"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/projects/{project}/monitors/{job}":{"get":{"operationId":"getMonitor","summary":"Get one monitor","parameters":[{"name":"project","in":"path","required":true,"schema":{"type":"string"},"description":"Project slug"},{"name":"job","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Monitor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Monitor"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/projects/{project}/check-ins":{"get":{"operationId":"listCheckIns","summary":"Check-in history","parameters":[{"name":"project","in":"path","required":true,"schema":{"type":"string"},"description":"Project slug"},{"name":"job","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"until","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Opaque cursor from nextCursor"}],"responses":{"200":{"description":"Check-ins, newest first","content":{"application/json":{"schema":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CheckIn"}},"nextCursor":{"type":["string","null"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/projects/{project}/incidents":{"get":{"operationId":"listIncidents","summary":"Incident history","parameters":[{"name":"project","in":"path","required":true,"schema":{"type":"string"},"description":"Project slug"},{"name":"job","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"until","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Opaque cursor from nextCursor"}],"responses":{"200":{"description":"Incidents, newest first","content":{"application/json":{"schema":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Incident"}},"nextCursor":{"type":["string","null"]}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"a51_..."}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}}},"requestId":{"type":"string"}}},"CheckInRequest":{"type":"object","additionalProperties":false,"required":["project","job","status"],"properties":{"project":{"type":"string","pattern":"^[a-z0-9][a-z0-9_.-]{0,62}$"},"job":{"type":"string","pattern":"^[a-z0-9][a-z0-9_.-]{0,62}$"},"status":{"type":"string","enum":["success","failure"]},"cron":{"type":"string","description":"Five-field cron expression. Required on the first check-in; omit later to keep the stored schedule."},"timezone":{"type":"string","description":"IANA time zone, default UTC"},"graceSeconds":{"type":"integer","minimum":0,"maximum":604800,"description":"Default 300"},"scheduledAt":{"type":"string","format":"date-time","description":"Slot this run belongs to (7 days back, 5 minutes ahead)"},"name":{"type":"string","maxLength":120},"message":{"type":"string","maxLength":1000},"durationMs":{"type":"integer","minimum":0}}},"CheckInResponse":{"type":"object","properties":{"monitorId":{"type":"string","format":"uuid"},"project":{"type":"string"},"job":{"type":"string"},"created":{"type":"boolean"},"checkIn":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["success","failure"]},"receivedAt":{"type":"string","format":"date-time"},"slotAt":{"type":"string","format":"date-time"},"outcome":{"type":"string","enum":["applied","stale","paused"]},"late":{"type":"boolean"}}},"schedule":{"type":"object","properties":{"cron":{"type":"string"},"timezone":{"type":"string"},"graceSeconds":{"type":"integer"},"changed":{"type":"boolean"}}},"monitorStatus":{"type":"string","enum":["up","down"]},"nextRunAt":{"type":["string","null"],"format":"date-time"},"deadlineAt":{"type":["string","null"],"format":"date-time"},"incident":{"type":["object","null"],"properties":{"id":{"type":"string"},"status":{"type":"string","enum":["open","resolved"]},"cause":{"type":"string","enum":["failure","missed"]}}}}},"Project":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"monitorCount":{"type":"integer"},"downCount":{"type":"integer"}}},"Monitor":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"projectSlug":{"type":"string"},"projectName":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"cron":{"type":"string"},"timezone":{"type":"string"},"graceSeconds":{"type":"integer"},"status":{"type":"string","enum":["up","down"]},"paused":{"type":"boolean"},"lastResult":{"type":["string","null"]},"lastCheckInAt":{"type":["string","null"],"format":"date-time"},"lastSlotAt":{"type":["string","null"],"format":"date-time"},"nextRunAt":{"type":["string","null"],"format":"date-time"},"deadlineAt":{"type":["string","null"],"format":"date-time"},"openIncidentId":{"type":["string","null"]},"scheduleUpdatedAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}}},"CheckIn":{"type":"object","properties":{"id":{"type":"string"},"monitorId":{"type":"string"},"status":{"type":"string"},"receivedAt":{"type":"string","format":"date-time"},"reportedScheduledAt":{"type":["string","null"],"format":"date-time"},"slotAt":{"type":"string","format":"date-time"},"applied":{"type":"boolean"},"outcome":{"type":"string","enum":["applied","stale","paused"]},"late":{"type":"boolean"},"scheduleChanged":{"type":"boolean"},"message":{"type":["string","null"]},"durationMs":{"type":["integer","null"]}}},"Incident":{"type":"object","properties":{"id":{"type":"string"},"monitorId":{"type":"string"},"monitorName":{"type":"string"},"monitorSlug":{"type":"string"},"projectId":{"type":"string"},"projectSlug":{"type":"string"},"cause":{"type":"string","enum":["failure","missed"]},"status":{"type":"string","enum":["open","resolved"]},"slotAt":{"type":["string","null"],"format":"date-time"},"openedAt":{"type":"string","format":"date-time"},"resolvedAt":{"type":["string","null"],"format":"date-time"},"lastEventAt":{"type":"string","format":"date-time"},"failureCount":{"type":"integer"},"missedCount":{"type":"integer"}}}}}}