List cronjobs under your account, up to 1000 items per page.
Name | Type | Default | Description |
---|---|---|---|
token | string | none | Your API token |
page | int | 1 | Page number |
keyword | string | none | Keyword to search cronjobs (name, ID, URL) |
Result data contains an array/collection of cronjob data structures.
Get a cronjob data
Name | Type | Default | Description |
---|---|---|---|
token | string | none | Your API token |
id | integer | none | Cronjob ID |
You'll get the cronjob data structure.
{"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}
Add a new cronjob
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
|
notify | bool | false | true to enable notification on failure. |
notifyEvery | int | 1 | When notify is true, send notification every notifyEvery fails. |
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.
You'll get the structure of newly created cronjob.
https://www.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":0,"points":9},"info":[],"status":"success","code":0}
Update an existing cronjob
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.
You'll get the structure of the updated cronjob.
Enable a cronjob
Name | Type | Default | Description |
---|---|---|---|
token | string | none | Your API token |
id | integer | none | Cronjob ID |
You'll get the structure of the updated cronjob.
Disable a cronjob
Name | Type | Default | Description |
---|---|---|---|
token | string | none | Your API token |
id | integer | none | Cronjob ID |
You'll get the structure of the updated cronjob.
Pause a cronjob for a specific duration
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. |
You'll get the structure of the paused cronjob.
Delete a cronjob
Name | Type | Default | Description |
---|---|---|---|
token | string | none | Your API token |
id | integer | none | Cronjob ID |
You'll get the structure of the deleted cronjob, with ID set to null.
Schedule the cronjob to run within next minute. This doesn't change the cronjob time settings.
Name | Type | Default | Description |
---|---|---|---|
token | string | none | Your API token |
id | integer | none | Cronjob ID |
You'll get the timestamp which cronjob will run at.
Get your cronjob execution logs.
Name | Type | Default | Description |
---|---|---|---|
token | string | none | Your API token |
id | integer | none | Cronjob ID |
You'll get an array/collection of cron execution results data structures.
Get your cronjob(s) failed execution logs.
Name | Type | Default | Description |
---|---|---|---|
token | string | none | Your API token |
id | integer | none | Cronjob ID |
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.
Add multiple cronjobs at once. This works only with requests in JSON format.
Name | Type | Default | Description |
---|---|---|---|
token | string | none | Your API token |
data | array | none | Array of cron_add parameters except token. |
curl -X POST "https://www.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"}]}'
Result data contains an array/collection of cronjob data structures.
Update multiple cronjobs at once.
Name | Type | Default | Description |
---|---|---|---|
token | string | none | Your API token |
id | array | none | List of cronjob IDs |
whatever(s) | whatever(s) | existing value(s) | Any parameter(s) listed in cron_add parameters except token |
Result data contains an array/collection of updated cronjob data structures.
Delete multiple cronjobs at once.
Name | Type | Default | Description |
---|---|---|---|
token | string | none | Your API token |
id | array | none | List of cronjob IDs |
Result data contains an array/collection of deleted cronjobs.
Update multiple cronjobs in a group at once.
Name | Type | Default | Description |
---|---|---|---|
token | string | none | Your API token |
id | int | The group ID | |
whatever(s) | whatever(s) | existing value(s) | Any parameter(s) listed in cron_add parameters except token |
Result data contains an array/collection of updated cronjob data structures.