top of page
Search
  • Writer's pictureNaresh Padiyar

Cronitor API Examples

List All CronJobs and their code

curl -X GET https://cronitor.io/v2/monitors -u <API Token>: | jq

curl -X GET https://cronitor.io/v2/monitors -u <API Token>: | jq . | jq '.monitors' | jq -c --raw-output '.[]|[.code,.name]|@tsv'

List all activities (Pings and Alerts) for a specific job code

curl -X GET https://cronitor.io/v2/monitors/<Cron Job Key>/activity -u <API Token>: | jq


List all Pings for a specific job code

curl -X GET https://cronitor.io/v2/monitors/<Cron Job Key>/pings -u <API Token>: | jq


curl -X GET https://cronitor.io/v2/monitors/<Cron Job Key>/pings -u <API Token>: | jq . | jq '.<Cron Job Key>' | jq -c --raw-output '.[]|[.monitor_name,.monitor_code,.description,.stamp,.created,.from,.host,.message,.status,.duration,.event,.count,.error_count]|@tsv'


curl -X GET https://cronitor.io/v2/monitors/<Cron Job Key>/pings -u <API Token>: | jq '.<Cron Job Key>[] += {"eventType": "Cronitor_Test1"}' | jq .<Cron Job Key>


List all Alerts for a specific job code

curl -X GET https://cronitor.io/v2/monitors/<Cron Job Key>/alerts -u <API Token>: | jq


curl -X GET https://cronitor.io/v2/monitors/<Cron Job Key>/alerts -u <API Token>: | jq . | jq '.<Cron Job Key>' | jq -c --raw-output '.[]|[.monitor_name,.monitor_code,.description,.stamp,.created,.from,.message,.event]|@tsv'


curl -X GET https://cronitor.io/v2/monitors/<Cron Job Key>/alerts -u <API Token>: | jq '.<Cron Job Key>[] += {"eventType": "Cronitor_Test2"}' | jq .<Cron Job Key>

33 views0 comments

Recent Posts

See All

AWS CLI Cheatsheet

1. Command to export EC2 Details in CSV Format Create the Excel file with Headers echo -e "InstanceID\tInstanceType\tImageId\tCoreCount\tState\tLaunchTime\tAvailabilityZone\tPrivateIpAddress\tPrivateD

Docker Command Cheatsheet

To build a docker image from Dockerfile docker build To pull a docker image docker pull To run a docker image docker run Find docker version docker version docker -v Find docker installation details

bottom of page