Welcome to the cron.io api reference guide

All api calls start with:

http://api.cron.io/v1

Authentication

Requests that require authentication use http basic auth

Format

All data sent to and from this api is in Json

Status Codes

  • 200 Successful GET and PUT.
  • 201 Successful POST.
  • 204 Successful DELETE
  • 401 Unauthenticated.
  • 404 Not Found.
  • 409 Unsuccessful POST, PUT, or DELETE (Will return an errors object).

Users

Create User

POST /users

Create a user account.

email

The user's email address.

username

The username to be used when accessing cron.io

password

The password to be used when accessing cron.io

example request
curl http://api.cron.io/v1/users -H "Content-Type: application/json" -X POST -d '{"email":"joan@example.com","username":"joan","password":"secret"}'
response
  {
      "message":"Account created. Please confirm your email address by clicking the link provided in an email we will send you shortly."
  }
        

Crons

List Crons

GET /crons

List all the crons you have stored in your account

example request
curl -u username:password http://api.cron.io/v1/crons
response
  [
      {
          "id": "4df99697314a97b68f000004",
          "name": "my cron",
          "url": "http://example.com",
          "schedule": "* * * * *"
      },
      {
          "id": "4df9fa7b2d4c06f59d000004",
          "name": "my cron",
          "url": "http://example.com",
          "schedule": "30-40 * * * *"
      }
  ]

Create a Cron

POST /crons

When creating a new cron you must supply 3 properties; name, url and schedule. It can take up to 1 and a half minutes for your cron to become active.

name

The name of your cron

url

The url you wish to poll when this cron is run

schedule

The schedule for when you want this cron to run. For more details please see http://en.wikipedia.org/wiki/Cron for formating.

example request
curl -u username:password http://api.cron.io/v1/crons -H "Content-Type: application/json" -X POST -d '{"name":"my cron","url":"http://example.com","schedule":"30-40 * * * *"}'
response
  {
      "id": "4df9fa7b2d4c06f59d000004",
      "name": "my cron",
      "url": "http://example.com",
      "schedule": "30-40 * * * *"
  }

Get a Cron

GET /crons/:id

Get a specific cron

example request
curl -u username:password http://api.cron.io/v1/crons/4df9fa7b2d4c06f59d000004
response
  {
      "id": "4df9fa7b2d4c06f59d000004",
      "name": "my cron",
      "url": "http://example.com",
      "schedule": "30-40 * * * *"
  }

Update a Cron

PUT /crons/:id

Update an existing cron.

example request
curl -u username:password http://api.cron.io/v1/crons/4df9fa7b2d4c06f59d000004 -H "Content-Type: application/json" -X PUT -d '{"name":"My New Cron Name"}'
response
  {
      "id": "4df9fa7b2d4c06f59d000004",
      "name": "My New Cron Name",
      "url": "http://example.com",
      "schedule": "30-40 * * * *"
  }

Delete a Cron

DELETE /crons/:id

example request
curl -u username:password http://api.cron.io/v1/crons/4df9fa7b2d4c06f59d000004 -X DELETE