Skip to content

cron_*

The following functions are for listing, retrieving, creating, updating, and deleting your cronjobs.

All parameters are listed in the table. Required parameters are in bold with no default values.

cron_list

List cronjobs under your account, up to 1000 items per page.

NameTypeDefaultDescription
tokenstringYour API token
pageint1Page number
keywordstringnullKeyword to search cronjobs (name, ID, URL)

Returns an array of cronjob data structures.

cron_get

Get a cronjob data.

NameTypeDescription
tokenstringYour API token
idintegerCronjob ID

Returns the cronjob data like this:

{
"data": {
"id": 132,
"group": null,
"expression": "41 3 * * 2",
"timezone": "Europe/London",
"url": "http://example.com/cron_php",
"postData": "",
"fail": 0,
"status": 0,
"name": "weekly",
"notify": true,
"points": 1
},
"status": "success",
"code": 0
}

cron_add

Add a new cronjob.

NameTypeDefaultDescription
tokenstringYour API token
urlstringURL to call
expressionstring1 hourTime expression, may be either crontab syntax or time interval in English
timezonestringaccount timezoneCronjob timezone
timeoutintegerplan timeoutCron timeout - max time to wait for your URL to response.
instancesinteger0Max overlapping cronjob executions: 0: unlimited, 1: single, 2 - 5: 2 - 5 overlapping executions
usernamestringnullUsername for HTTP authentication
passwordstringnullPassword for HTTP authentication
httpMethodstringGETHTTP method of the HTTP request to send to your cronjob URL
postDatastringnullWhen httpMethod is POST or PUT, send this post data with the HTTP request.
httpHeadersstringnullPlain HTTP headers to send to your cronjob URL. Use new lines as delimiters, e.g.
notifybooltrueEnable notification on failure.
notifyEveryint1When notify is true, send notification every notifyEvery fails.
ignoreHttpStatusbooltrueTrue to not check your cron execution’s HTTP result.
retryFailedbooltrueTrue to allow to keep trying failed cronjob.
failureThresholdinteger10Number of failures allowed before we disable your failed cronjob.
patternstringnullIf the cron execution contains the string, mark it as failure
groupintegernullGroup ID
namestringnullName of cronjob

Returns the newly created cronjob.

https://app.fastcron.com/api/v1/cron_add?token=******&expression=*/3 1,2,3 * * *&url=example.com/cron_php
{
"data": {
"id": 132,
"group": null,
"expression": "*/3 1,2,3 * * *",
"timezone": "UTC",
"url": "http://example.com/cron_php",
"postData": "",
"fail": 0,
"status": 0,
"name": "",
"notify": true,
"points": 9
},
"status": "success",
"code": 0
}

cron_edit

Update an existing cronjob

NameTypeDefaultDescription
tokenstringYour API token
idintegerCronjob ID
anyanycurrent valueAny parameter listed in cron_add parameters

Similar to cron_add, except that it’ll update a specific cronjob with provided ID.

Returns the structure of the updated cronjob.

cron_enable

Enable a cronjob

NameTypeDescription
tokenstringYour API token
idintegerCronjob ID

Returns the structure of the updated cronjob.

cron_disable

Disable a cronjob

NameTypeDescription
tokenstringYour API token
idintegerCronjob ID

Returns the structure of the updated cronjob.

cron_pause

Pause a cronjob for a specific duration

NameTypeDefaultDescription
tokenstringYour API token
idintegerCronjob ID
forstringnullAn expression for time modification e.g. 15 minutes, 1 hour, 1 day, etc.

Returns the structure of the paused cronjob.

cron_delete

Delete a cronjob

NameTypeDescription
tokenstringYour API token
idintegerCronjob ID

Returns the structure of the deleted cronjob, with ID set to null.

cron_run

Schedule the cronjob to run within next minute. This doesn’t change the cronjob time settings.

NameTypeDescription
tokenstringYour API token
idintegerCronjob ID

Returns the timestamp which cronjob will run at.

cron_logs

Get your cronjob execution logs.

NameTypeDescription
tokenstringYour API token
idintegerCronjob ID

Returns an array of cron execution results.

cron_failures

Get your cronjobs failed execution logs.

NameTypeDefaultDescription
tokenstringYour API token
idintegernullCronjob ID
limitinteger50Max result limit

Returns an array of cron execution results data structures.

If no id is provided, it will return an array of all cronjobs failure logs.

cron_batch_add

Add multiple cronjobs at once/

NameTypeDefaultDescription
tokenstringnullYour API token
dataarraynullArray of cron_add parameters except token.

This works only with requests in JSON format like this:

Terminal window
curl -X POST "https://app.fastcron.com/api/v1/cron_batch_add" \
-H 'Content-Type: application/json' \
-d '{"token":"***", "data":[{"url":"https://example.com", "expression":"1 hour"},{"url":"https://example.com", "expression":"1 day"}]}'

Returns an array of cronjob data structures.

cron_batch_edit

Update multiple cronjobs at once.

NameTypeDefaultDescription
tokenstringYour API token
idarrayList of cronjob IDs
anyanycurrent valuesAny parameters listed in cron_add parameters except token

Returns an array of updated cronjob data structures.

cron_batch_delete

Delete multiple cronjobs at once.

NameTypeDescription
tokenstringYour API token
idarrayList of cronjob IDs

Returns an array of deleted cronjobs.

cron_group_edit

Update multiple cronjobs in a group at once.

NameTypeDefaultDescription
tokenstringYour API token
idintThe group ID
anynullexisting valueAny parameter listed in cron_add parameters except token

Returns an array of updated cronjob data structures.