FastCron provides a simple API to list, create, and update your cron jobs with your API token. The API token can be found in the user menu > My Profile.
You can make API requests by sending an HTTP request to our API endpoint at
https://www.fastcron.com/api/v1/{function}
The endpoint accepts both GET and POST methods.
url=example.com&expression=5
minutes.
{"url":"example.com", "expression": "5 minutes"}.
Authenticate by including your API token in the Authorization header, prefixed with Bearer. For example:
Authorization: Bearer YOUR_API_TOKEN
You can also add the token in the POST payload.
The response is in JSON format and includes these fields:
| Name | Description |
|---|---|
| status | Either success or error. |
| code | The error code, 0 means ok/success. |
| data | Result data, available in success result only |
| message | The error message, available in error result only |
Available functions:
cron_list - List cronjobs under your accountcron_get - Get a cron jobcron_add - Add a new cronjobcron_edit - Update an existing cronjobcron_enable - Enable a cronjobcron_disable - Disable a cronjobcron_pause - Pause a cronjob for a specific durationcron_delete - Delete a cronjobcron_run - Schedule the cronjob to runcron_logs - Get your cronjob execution logscron_failures - Get your cronjobs failed execution logscron_next - Get next execution times of your cronjobcron_batch_add - Add multiple cronjobs at oncecron_batch_delete - Delete multiple cronjobs at oncecron_listList cronjobs under your account, up to 1000 items per page.
| Name | Type | Description |
|---|---|---|
| page | ?int | Page number |
| keyword | ?string | Keyword to search cronjobs (name, ID, URL) |
Returns an array of cron jobs.
cron_getGet a cron job.
| Name | Type | Description |
|---|---|---|
| id | integer | Cronjob ID |
Returns the cronjob data like this:
{
"data": {
"id": 132,
"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_addAdd a new cronjob.
| Name | Type | Default | Description |
|---|---|---|---|
| url | string | URL to call | |
| expression | string | 15 minutes | Time expression. Must be either crontab syntax or time interval in English |
| delay | integer | 0 | Random delay (in minutes) before running your cronjob. No delay by default. |
| timezone | string | account timezone | Cronjob timezone |
| timeout | integer | 30 | Request timeout – max time to wait for your URL to response. Min 5 seconds. |
| instances | integer | 0 | Max overlapping cronjob executions: 0: unlimited, 1: single, 2–5: 2–5 overlapping executions |
| username | string | null | Username for HTTP authentication |
| password | string | null | Password for HTTP authentication |
| httpMethod | string | GET | HTTP method of the HTTP request to send to your cronjob URL |
| postData | string | null | When httpMethod is POST, PUT, or PATCH, send this post data with the HTTP
request.
|
| httpHeaders | string | null | Plain HTTP headers to send to your cronjob URL. Use new lines \r\n as delimiters. |
| userAgent | string | null | User agent, default is Mozilla/5.0 (compatible; FastCron/1.0;
https://www.fastcron.com/) |
| notify | bool | true | Enable notification on failure. |
| keyword | string | null | Text to search for in the output. Max 100 characters. |
| name | string | null | Name of cronjob |
| run | integer | null | Run the created cron job immediately. Can use a Unix timestamp to schedule time. |
| payload | string | null | When run > 0, send the payload to run this time. See cron_run.
|
Returns the newly created cronjob.
cron_editUpdate an existing cronjob
| Name | Type | Default | Description |
|---|---|---|---|
| id | integer | Cronjob ID | |
| any | any | current value | Any parameter listed in cron_add parameters |
| run | integer | null | Run the updated cron job immediately. Can use a Unix timestamp to schedule time. |
| payload | string | null | When run > 0, send the payload to run this time. See cron_run.
|
Similar to cron_add, except that it'll update a specific cronjob with provided ID.
Returns the updated cronjob.
cron_enableEnable a cronjob
| Name | Type | Description |
|---|---|---|
| id | integer | Cronjob ID |
Returns the updated cronjob.
cron_disableDisable a cronjob
| Name | Type | Description |
|---|---|---|
| id | integer | Cronjob ID |
Returns the updated cronjob.
cron_pausePause a cronjob for a specific duration
| Name | Type | Default | Description |
|---|---|---|---|
| id | integer | Cronjob ID | |
| for | string | null | An expression for time modification e.g., 15 minutes, 1 hour, 1 day, etc. |
Returns the paused cronjob.
cron_deleteDelete a cronjob
| Name | Type | Description |
|---|---|---|
| id | integer | Cronjob ID |
Returns the deleted cronjob, with ID set to null.
cron_runSchedule the cronjob to run within a few seconds or at a specific time. This doesn't change the cronjob time settings.
| Name | Type | Description |
|---|---|---|
| id | integer | Cronjob ID |
| time | integer | Timestamp to run cronjob |
| payload | string | Payload to send this time (read more below). |
payload should be valid HTTP query string name=value&name2=value2
or valid JSON {"name": "value", "number":
1}.
If cronjob's httpMethod is POST, PUT, or PATCH, payload will
overwrite the cronjob's postData.
If payload is valid JSON, FastCron will add Content-Type:
application/json to the HTTP request headers.
If cronjob's httpMethod is GET, HEAD, or DELETE, payload must
be an HTTP query string and will append to the cronjob URL.
FastCron automatically add ? or & before appending the payload
so you don't need to.
You can also use keywords like __timestamp__ in your payload,
which will be replaced with the current Unix timestamp when it runs.
Returns the timestamp which cronjob will run at.
cron_logsGet your cronjob execution logs.
| Name | Type | Description |
|---|---|---|
| id | integer | Cronjob ID |
| keyword | string | Keyword to search in execution time, output, IP addresses, error messages, etc. |
Returns an array of cron execution results.
{
"status": "success",
"code": 0,
"data": [
{
"result": {
"id": 20037375,
"time": 1789443086,
"status": 0,
"startTime": 1789443086,
"downloaded": 19265,
"httpStatus": 200,
"error": "",
"output": "...",
"payload": null,
"ip": "68.183.134.52",
"server": "app3",
"executionTime": 0.15
}
}, {...}
]
}
cron_failuresGet your cronjobs failed execution logs.
| Name | Type | Description |
|---|---|---|
| id | integer | Cronjob ID |
| keyword | string | Keyword to search in execution time, output, IP addresses, error messages, etc. |
Returns an array of cron execution results.
cron_nextGet next execution times of your cronjob.
| Name | Type | Description |
|---|---|---|
| id | integer | Cronjob ID |
Returns an array of queued/scheduled execution times (Unix timestamp). Max 100 results. Example response:
{ "status": "success", "code": 0, "data": [1723256352, 1723342752, 1723429152] }
cron_batch_addAdd multiple cronjobs at once/
| Name | Type | Default | Description |
|---|---|---|---|
| data | array | null | Array of cron_add parameters except token. |
This works only with requests in JSON format like this:
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"}]}'
Returns an array of cron jobs.
cron_batch_deleteDelete multiple cronjobs at once.
| Name | Type | Description |
|---|---|---|
| id | array | List of cronjob IDs |
Returns an array of deleted cronjobs.
Need help? Reach out to support@fastcron.com - we're happy to help.
See why 8,000+ website developers and their teams use FastCron to run their cronjobs 12 million times a day.
The reliable online cronjob service for your websites since 2009.