cron.*

Available functions

cron.list

List all cronjobs under your account.

Parameters

Name Type Default Description
token string none Your API token
keyword string none Keyword to search cronjobs (name, ID, URL)

Response data

Result data contains an array/collection of cronjob data structures.

cron.get

Get a cronjob data

Parameters

Name Type Default Description
token string none Your API token
id integer none Cronjob ID

Response data

You'll get the cronjob data structure.

Example response

{"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":0,"points":1},"info":[],"status":"success","code":0}

cron.add

Add a new cronjob

Parameters

Name Type Default Description
token string none Your API token
url string none URL to call
expression string '' (empty) Time expression, may be either crontab syntax or time interval in English
timezone string account timezone Cronjob timezone
timeout integer plan timeout Cron timeout - max time to wait for your URL to response.
single boolean false Single instance - if true, skip executions when there's an active cronjob execution.
username string '' (empty) Username for HTTP authentication
password string '' (empty) Password for HTTP authentication
httpMethod string GET HTTP method of the HTTP request to send to your cronjob URL
postData string '' (empty) When httpMethod is POST or PUT, send this post data with the HTTP request.
httpHeaders string '' (empty) Plain HTTP headers to send to your cronjob URL. Use new lines as delimiters, e.g.
X-API-Key: 123ABC456XYZ
Header2: test-value
notify bool false true to enable notification on failure.
ignoreHttpStatus boolean true True to not check your cron execution's HTTP result.
retryFailed boolean true True to allow to keep trying failed cronjob.
failureThreshold integer 10 Number of failures allowed before we disable your failed cronjob.
pattern string '' (empty) If the cron execution contains the string, mark it as failure
group integer null (None) Group ID
name string '' (empty) Name of cronjob

As you can see, just pass your API token (as always) and cron URL, we'll create an hourly cronjob for you.

Response data

You'll get the structure of newly created cronjob.

Example request

https://www.fastcron.com/api/v1/cron.add?token=******&expression=*/3 1,2,3 * * *&url=example.com/cron.php

Example response

{"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":0,"points":9},"info":[],"status":"success","code":0}

cron.edit

Update an existing cronjob

Parameters

Name Type Default Description
token string none Your API token
id integer none Cronjob ID
whatever(s) whatever(s) existing value(s) Any parameter(s) listed in cron.add parameters

Similar to cron.add, except that it'll update a specific cronjob with provided ID.

Response data

You'll get the structure of the updated cronjob.

cron.enable

Enable a cronjob

Parameters

Name Type Default Description
token string none Your API token
id integer none Cronjob ID

Response data

You'll get the structure of the updated cronjob.

cron.disable

Disable a cronjob

Parameters

Name Type Default Description
token string none Your API token
id integer none Cronjob ID

Response data

You'll get the structure of the updated cronjob.

cron.pause

Pause a cronjob for a specific duration

Parameters

Name Type Default Description
token string none Your API token
id integer none Cronjob ID
for string none An expression for time modification e.g. 15 minutes, 1 hour, 1 day, etc.

Response data

You'll get the structure of the paused cronjob.

cron.delete

Delete a cronjob

Parameters

Name Type Default Description
token string none Your API token
id integer none Cronjob ID

Response data

You'll get 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.

Parameters

Name Type Default Description
token string none Your API token
id integer none Cronjob ID

Response data

You'll get the timestamp which cronjob will run at.

cron.logs

Get your cronjob execution logs.

Parameters

Name Type Default Description
token string none Your API token
id integer none Cronjob ID

Response data

You'll get an array/collection of cron execution results data structures.

cron.failures

Get your cronjob(s) failed execution logs.

Parameters

Name Type Default Description
token string none Your API token
id integer none Cronjob ID

Response data

You'll get an array/collection of cron execution results data structures.

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