Skip to content

Get Cron Jobs

Get the cron jobs of current user.

Method

GET

Endpoint

https://api.easycron.com/v1/cron-jobs
Some other possible URLs:
https://api.easycron.com/v1/cron-jobs
https://api.easycron.com/v1/cron-jobs?page=33&cron_job_group_id=39533&order=asc
https://api.easycron.com/v1/cron-jobs?page=33&cron_job_group_id=39533&order=asc&pretty
https://api.easycron.com/v1/cron-jobs?sort_by=total_successes&order=desc"

NOTE:  By appending pretty in the request URL query string, you can get a pretty printed JSON (indented with spaces).

Query parameters

nametyperequireddefaultdescriptionlimits
cron_job_group_idintoptionalThe ID of the cron job group that the returned results should belong to.
pageintoptional1Page number.
page_sizeintoptional10The result number in one page.min=1, max=500
sort_bystringoptionalcron_job_idWhat to sort results by.
Allowed values: cron_job_id, cron_job_name, url, epds_occupied, total_successes, total_failures, current_failures
orderstringoptionaldescThe order the returned results should be in.
Allowed values: desc, asc

Example API call

Terminal window
curl \
--include \
--request GET \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <API_KEY>' \
"https://api.easycron.com/v1/cron-jobs?pretty"

Example Success Response

Together with the HTTP code 200, the following content will be responded:

{
"cron_jobs": [
{
"cron_job_id": 2133739,
"url": "https://www.example.com/xxx",
"http_auth_user": "",
"http_auth_pw": "",
"cron_expression": "* * * * * *",
"timezone": "Asia/Hong_Kong",
"http_method": "GET",
"http_headers": "",
"http_message_body": "",
"timeout": 0,
"success_criterion": 1,
"success_regexp": "",
"failure_regexp": "",
"send_email": 1,
"email_threshold": 2,
"send_slack": 2,
"slack_threshold": 1,
"slack_url": "https://hooks.slack.com/services/xxx/yyy/zzz",
"send_webhook": 2,
"webhook_http_method": "POST",
"webhook_url": "https://example.com/webhook",
"webhook_data": [
"CRON_JOB_ID",
"CRON_JOB_NAME",
"CRON_JOB_URL",
"CRON_JOB_HTTP_STATUS_CODE",
"CRON_JOB_EXECUTION_STATUS",
"CRON_JOB_EXECUTION_ERROR"
],
"status": 0,
"epds_occupied": 1440,
"cron_job_name": "notifications",
"description": "",
"group_id": 25138,
"total_successes": 234,
"total_failures": 0,
"current_failures": 0
},
{
"cron_job_id": 3988278,
"url": "https://www.example.com",
"http_auth_user": "",
"http_auth_pw": "",
"cron_expression": "23 13 22 5 * *",
"timezone": "Asia/Hong_Kong",
"http_method": "GET",
"http_headers": "",
"http_message_body": "",
"timeout": 0,
"success_criterion": 1,
"success_regexp": "",
"failure_regexp": "",
"send_email": 0,
"email_threshold": 1,
"send_slack": 0,
"slack_threshold": 1,
"slack_url": "",
"send_webhook": 0,
"webhook_http_method": "GET",
"webhook_url": "",
"webhook_data": [],
"status": 1,
"epds_occupied": 1,
"cron_job_name": "",
"description": "",
"group_id": 0,
"total_successes": 13,
"total_failures": 0,
"current_failures": 0
},
...
],
"meta": {
"page": 1,
"page_size": 10,
"result_count": 10,
"total_count": 58
}
}

Example Failure Response

Together with the HTTP code of the error, the following error message will be responded:

{"message":"ERROR_MESSAGE"}