API Docs

Introduction

With an API Token, you can work with your cronjobs, groups, and account settings programmatically without logging in.

The API token is a 32-character string that is uniquely generated for all SetCronJob users. You can visit Account > API Key to copy your API key, and regenerate the API token just in case.

Authentication

All API requests must be sent via HTTP to a URL with the format

https://www.setcronjob.com/api/[target].[action]

Support targets are cron, group, account, and server. Target's actions can be found under each target's section.

For example, to list your cronjobs, send your HTTP request to

https://www.setcronjob.com/api/cron.list

Each API request requires a token variable that can be sent via either POST, GET, or URL params as described in the Request formats section below.

Request formats

You can pass parameters via either POST or GET parameters.

POST recommended

All data including the token must be sent to

https://www.setcronjob.com/api/[target].[action]

The POST body must be either query string or JSON format:

token=******&id=1&name=weekly
{"token":"******","id":1,"name":"weekly"}

GET variables

https://www.setcronjob.com/api/[target].[action]?token=[token]&name=value

Example requests:

https://www.setcronjob.com/api/cron.list?token=******
https://www.setcronjob.com/api/cron.edit?token=******&id=1&name=weekly

Response format

The response is in JSON format, includes these members

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

Sample API Request

https://www.setcronjob.com/api/cron.list?token=******

Success response

{"data":[{"id":123456,...}],"status":"success","code":0}

Error response

{"message":"Invalid API token, user not found.","status":"error","code":11}

Rate limit

The rate limit for API requests is 10 requests per second. If you exceed that limit, you'll get HTTP error code 503 Service Temporarily Unavailable.