{"openapi":"3.0.0","info":{"title":"Croncool API","version":"1.0.0","description":"Public REST API for Croncool. Authenticate with an API key created in the Croncool dashboard: send the base64-encoded key secret with HTTP Basic auth. Each key carries per-resource scopes like `jobs:read` or `jobs:write`."},"servers":[{"url":"https://api.cron.cool"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"basic","description":"HTTP Basic auth carrying only the API key secret: `Authorization: Basic base64(<key secret>)`."},"accessToken":{"type":"apiKey","in":"header","name":"Authorization","description":"Operator session token issued by the Croncool dashboard: `Authorization: Token <access token>`."}}},"paths":{"/api/jobs":{"get":{"tags":["Jobs"],"summary":"List cron jobs","description":"Lists the cron jobs of your project, newest first. Requires the `jobs:read` scope.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"query","name":"projectId","schema":{"type":"string"}},{"in":"query","name":"limit","description":"Opt into pagination; returns a { data, cursor, hasMore } envelope.\n","schema":{"type":"integer"}},{"in":"query","name":"cursor","description":"Page forward by resending the cursor from the last page.","schema":{"type":"string"}},{"in":"query","name":"fields","description":"Comma-separated projection of fields to return","schema":{"type":"string"}}],"responses":{"200":{"description":"Array of jobs (or a paginated envelope)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"API key is missing the `jobs:read` scope"},"429":{"description":"API key rate limit exceeded"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'GET',\n  url: 'https://api.cron.cool/api/jobs',\n  qs: {\n    projectId: 'SOME_STRING_VALUE',\n    limit: 'SOME_INTEGER_VALUE',\n    cursor: 'SOME_STRING_VALUE',\n    fields: 'SOME_STRING_VALUE'\n  },\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url 'https://api.cron.cool/api/jobs?projectId=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&cursor=SOME_STRING_VALUE&fields=SOME_STRING_VALUE' \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http GET 'https://api.cron.cool/api/jobs?projectId=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&cursor=SOME_STRING_VALUE&fields=SOME_STRING_VALUE' \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.cron.cool\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"GET\", \"/api/jobs?projectId=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&cursor=SOME_STRING_VALUE&fields=SOME_STRING_VALUE\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.cron.cool/api/jobs?projectId=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&cursor=SOME_STRING_VALUE&fields=SOME_STRING_VALUE\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.cron.cool/api/jobs');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setQueryData([\n  'projectId' => 'SOME_STRING_VALUE',\n  'limit' => 'SOME_INTEGER_VALUE',\n  'cursor' => 'SOME_STRING_VALUE',\n  'fields' => 'SOME_STRING_VALUE'\n]);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.cron.cool/api/jobs');\n$request->setRequestMethod('GET');\n$request->setQuery(new http\\QueryString([\n  'projectId' => 'SOME_STRING_VALUE',\n  'limit' => 'SOME_INTEGER_VALUE',\n  'cursor' => 'SOME_STRING_VALUE',\n  'fields' => 'SOME_STRING_VALUE'\n]));\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]},"post":{"tags":["Jobs"],"summary":"Create a cron job","description":"Requires the `jobs:write` scope.","security":[{"apiKey":[]},{"accessToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["expression"],"properties":{"name":{"type":"string"},"expression":{"type":"string","description":"EventBridge Scheduler schedule expression","example":"rate(1 day)"},"type":{"type":"string","example":"webhook"},"url":{"type":"string","example":"https://example.com/task"},"httpMethod":{"type":"string","example":"POST"},"contentType":{"type":"string","example":"application/json"},"input":{"type":"object"}}}}}},"responses":{"200":{"description":"The created job"},"403":{"description":"API key is missing the `jobs:write` scope"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'POST',\n  url: 'https://api.cron.cool/api/jobs',\n  headers: {'content-type': 'application/json', Authorization: 'Basic REPLACE_BASIC_AUTH'},\n  body: {\n    name: 'string',\n    expression: 'rate(1 day)',\n    type: 'webhook',\n    url: 'https://example.com/task',\n    httpMethod: 'POST',\n    contentType: 'application/json',\n    input: {}\n  },\n  json: true\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://api.cron.cool/api/jobs \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH' \\\n  --header 'content-type: application/json' \\\n  --data '{\"name\":\"string\",\"expression\":\"rate(1 day)\",\"type\":\"webhook\",\"url\":\"https://example.com/task\",\"httpMethod\":\"POST\",\"contentType\":\"application/json\",\"input\":{}}'"},{"lang":"Shell + Httpie","source":"echo '{\"name\":\"string\",\"expression\":\"rate(1 day)\",\"type\":\"webhook\",\"url\":\"https://example.com/task\",\"httpMethod\":\"POST\",\"contentType\":\"application/json\",\"input\":{}}' |  \\\n  http POST https://api.cron.cool/api/jobs \\\n  Authorization:'Basic REPLACE_BASIC_AUTH' \\\n  content-type:application/json"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.cron.cool\")\n\npayload = \"{\\\"name\\\":\\\"string\\\",\\\"expression\\\":\\\"rate(1 day)\\\",\\\"type\\\":\\\"webhook\\\",\\\"url\\\":\\\"https://example.com/task\\\",\\\"httpMethod\\\":\\\"POST\\\",\\\"contentType\\\":\\\"application/json\\\",\\\"input\\\":{}}\"\n\nheaders = {\n    'content-type': \"application/json\",\n    'Authorization': \"Basic REPLACE_BASIC_AUTH\"\n    }\n\nconn.request(\"POST\", \"/api/jobs\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.cron.cool/api/jobs\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n  CURLOPT_POSTFIELDS => \"{\\\"name\\\":\\\"string\\\",\\\"expression\\\":\\\"rate(1 day)\\\",\\\"type\\\":\\\"webhook\\\",\\\"url\\\":\\\"https://example.com/task\\\",\\\"httpMethod\\\":\\\"POST\\\",\\\"contentType\\\":\\\"application/json\\\",\\\"input\\\":{}}\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\",\n    \"content-type: application/json\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.cron.cool/api/jobs');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$request->setBody('{\"name\":\"string\",\"expression\":\"rate(1 day)\",\"type\":\"webhook\",\"url\":\"https://example.com/task\",\"httpMethod\":\"POST\",\"contentType\":\"application/json\",\"input\":{}}');\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$body = new http\\Message\\Body;\n$body->append('{\"name\":\"string\",\"expression\":\"rate(1 day)\",\"type\":\"webhook\",\"url\":\"https://example.com/task\",\"httpMethod\":\"POST\",\"contentType\":\"application/json\",\"input\":{}}');\n\n$request->setRequestUrl('https://api.cron.cool/api/jobs');\n$request->setRequestMethod('POST');\n$request->setBody($body);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}},"/api/jobs/{jobId}":{"get":{"tags":["Jobs"],"summary":"Get a cron job","description":"Requires the `jobs:read` scope.","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"path","name":"jobId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The job"},"404":{"description":"No such job in your project"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'GET',\n  url: 'https://api.cron.cool/api/jobs/%7BjobId%7D',\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url https://api.cron.cool/api/jobs/%7BjobId%7D \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http GET https://api.cron.cool/api/jobs/%7BjobId%7D \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.cron.cool\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"GET\", \"/api/jobs/%7BjobId%7D\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.cron.cool/api/jobs/%7BjobId%7D\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.cron.cool/api/jobs/%7BjobId%7D');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.cron.cool/api/jobs/%7BjobId%7D');\n$request->setRequestMethod('GET');\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]},"put":{"tags":["Jobs"],"summary":"Update a cron job","description":"Requires the `jobs:write` scope.","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"path","name":"jobId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"The updated job"},"404":{"description":"No such job in your project"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'PUT',\n  url: 'https://api.cron.cool/api/jobs/%7BjobId%7D',\n  headers: {'content-type': 'application/json', Authorization: 'Basic REPLACE_BASIC_AUTH'},\n  body: {},\n  json: true\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request PUT \\\n  --url https://api.cron.cool/api/jobs/%7BjobId%7D \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH' \\\n  --header 'content-type: application/json' \\\n  --data '{}'"},{"lang":"Shell + Httpie","source":"echo '{}' |  \\\n  http PUT https://api.cron.cool/api/jobs/%7BjobId%7D \\\n  Authorization:'Basic REPLACE_BASIC_AUTH' \\\n  content-type:application/json"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.cron.cool\")\n\npayload = \"{}\"\n\nheaders = {\n    'content-type': \"application/json\",\n    'Authorization': \"Basic REPLACE_BASIC_AUTH\"\n    }\n\nconn.request(\"PUT\", \"/api/jobs/%7BjobId%7D\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.cron.cool/api/jobs/%7BjobId%7D\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"PUT\",\n  CURLOPT_POSTFIELDS => \"{}\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\",\n    \"content-type: application/json\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.cron.cool/api/jobs/%7BjobId%7D');\n$request->setMethod(HTTP_METH_PUT);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$request->setBody('{}');\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$body = new http\\Message\\Body;\n$body->append('{}');\n\n$request->setRequestUrl('https://api.cron.cool/api/jobs/%7BjobId%7D');\n$request->setRequestMethod('PUT');\n$request->setBody($body);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]},"delete":{"tags":["Jobs"],"summary":"Delete a cron job","description":"Requires the `jobs:write` scope.","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"path","name":"jobId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted"},"404":{"description":"No such job in your project"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'DELETE',\n  url: 'https://api.cron.cool/api/jobs/%7BjobId%7D',\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request DELETE \\\n  --url https://api.cron.cool/api/jobs/%7BjobId%7D \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http DELETE https://api.cron.cool/api/jobs/%7BjobId%7D \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.cron.cool\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"DELETE\", \"/api/jobs/%7BjobId%7D\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.cron.cool/api/jobs/%7BjobId%7D\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"DELETE\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.cron.cool/api/jobs/%7BjobId%7D');\n$request->setMethod(HTTP_METH_DELETE);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.cron.cool/api/jobs/%7BjobId%7D');\n$request->setRequestMethod('DELETE');\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}},"/api/jobs/{jobId}/executions":{"get":{"tags":["Jobs"],"summary":"List a job's execution history","description":"Returns the recorded executions of a job (status, http status, duration, truncated response body), newest first. Requires the `executions:read` scope.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"path","name":"jobId","required":true,"schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"type":"integer","default":50}}],"responses":{"200":{"description":"Array of job executions"},"404":{"description":"No such job in your project"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'GET',\n  url: 'https://api.cron.cool/api/jobs/%7BjobId%7D/executions',\n  qs: {limit: 'SOME_INTEGER_VALUE'},\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url 'https://api.cron.cool/api/jobs/%7BjobId%7D/executions?limit=SOME_INTEGER_VALUE' \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http GET 'https://api.cron.cool/api/jobs/%7BjobId%7D/executions?limit=SOME_INTEGER_VALUE' \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.cron.cool\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"GET\", \"/api/jobs/%7BjobId%7D/executions?limit=SOME_INTEGER_VALUE\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.cron.cool/api/jobs/%7BjobId%7D/executions?limit=SOME_INTEGER_VALUE\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.cron.cool/api/jobs/%7BjobId%7D/executions');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setQueryData([\n  'limit' => 'SOME_INTEGER_VALUE'\n]);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.cron.cool/api/jobs/%7BjobId%7D/executions');\n$request->setRequestMethod('GET');\n$request->setQuery(new http\\QueryString([\n  'limit' => 'SOME_INTEGER_VALUE'\n]));\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}},"/api/jobs/{jobId}/execute":{"post":{"tags":["Jobs"],"summary":"Execute a cron job now","description":"Runs the job immediately, out of schedule, and returns the target's response. Also records a job execution and fires the `job.executed` webhook. Requires the `jobs:write` scope.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"path","name":"jobId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The target's response"},"404":{"description":"No such job in your project"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'POST',\n  url: 'https://api.cron.cool/api/jobs/%7BjobId%7D/execute',\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://api.cron.cool/api/jobs/%7BjobId%7D/execute \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http POST https://api.cron.cool/api/jobs/%7BjobId%7D/execute \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.cron.cool\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"POST\", \"/api/jobs/%7BjobId%7D/execute\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.cron.cool/api/jobs/%7BjobId%7D/execute\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.cron.cool/api/jobs/%7BjobId%7D/execute');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.cron.cool/api/jobs/%7BjobId%7D/execute');\n$request->setRequestMethod('POST');\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}},"/api/webhooksubscriptions":{"get":{"tags":["Webhook subscriptions"],"summary":"List webhook subscriptions","description":"Webhook subscriptions deliver `job.created`, `job.updated`, `job.deleted` and `job.executed` events to your server as signed POST requests (`X-Croncool-Signature: t=<timestamp>,v1=<hex HMAC-SHA256 of \"timestamp.body\">`). An endpoint failing 20 times in a row is disabled automatically. Subscriptions are managed with an operator access token; the `secret` is only returned once, on create.\n","security":[{"accessToken":[]}],"parameters":[{"in":"query","name":"projectId","schema":{"type":"string"}}],"responses":{"200":{"description":"Array of webhook subscriptions (without secrets)"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'GET',\n  url: 'https://api.cron.cool/api/webhooksubscriptions',\n  qs: {projectId: 'SOME_STRING_VALUE'},\n  headers: {Authorization: 'REPLACE_KEY_VALUE'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url 'https://api.cron.cool/api/webhooksubscriptions?projectId=SOME_STRING_VALUE' \\\n  --header 'Authorization: REPLACE_KEY_VALUE'"},{"lang":"Shell + Httpie","source":"http GET 'https://api.cron.cool/api/webhooksubscriptions?projectId=SOME_STRING_VALUE' \\\n  Authorization:REPLACE_KEY_VALUE"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.cron.cool\")\n\nheaders = { 'Authorization': \"REPLACE_KEY_VALUE\" }\n\nconn.request(\"GET\", \"/api/webhooksubscriptions?projectId=SOME_STRING_VALUE\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.cron.cool/api/webhooksubscriptions?projectId=SOME_STRING_VALUE\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: REPLACE_KEY_VALUE\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.cron.cool/api/webhooksubscriptions');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setQueryData([\n  'projectId' => 'SOME_STRING_VALUE'\n]);\n\n$request->setHeaders([\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.cron.cool/api/webhooksubscriptions');\n$request->setRequestMethod('GET');\n$request->setQuery(new http\\QueryString([\n  'projectId' => 'SOME_STRING_VALUE'\n]));\n\n$request->setHeaders([\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]},"post":{"tags":["Webhook subscriptions"],"summary":"Create a webhook subscription","description":"The response includes the signing `secret` exactly once — store it; it cannot be retrieved again.\n","security":[{"accessToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["projectId","url"],"properties":{"projectId":{"type":"string"},"url":{"type":"string","example":"https://example.com/croncool-webhook"},"events":{"type":"array","description":"Empty array subscribes to all events","items":{"type":"string","enum":["job.created","job.updated","job.deleted","job.executed"]}}}}}}},"responses":{"200":{"description":"The created subscription, including its secret"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'POST',\n  url: 'https://api.cron.cool/api/webhooksubscriptions',\n  headers: {'content-type': 'application/json', Authorization: 'REPLACE_KEY_VALUE'},\n  body: {\n    projectId: 'string',\n    url: 'https://example.com/croncool-webhook',\n    events: ['job.created']\n  },\n  json: true\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://api.cron.cool/api/webhooksubscriptions \\\n  --header 'Authorization: REPLACE_KEY_VALUE' \\\n  --header 'content-type: application/json' \\\n  --data '{\"projectId\":\"string\",\"url\":\"https://example.com/croncool-webhook\",\"events\":[\"job.created\"]}'"},{"lang":"Shell + Httpie","source":"echo '{\"projectId\":\"string\",\"url\":\"https://example.com/croncool-webhook\",\"events\":[\"job.created\"]}' |  \\\n  http POST https://api.cron.cool/api/webhooksubscriptions \\\n  Authorization:REPLACE_KEY_VALUE \\\n  content-type:application/json"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.cron.cool\")\n\npayload = \"{\\\"projectId\\\":\\\"string\\\",\\\"url\\\":\\\"https://example.com/croncool-webhook\\\",\\\"events\\\":[\\\"job.created\\\"]}\"\n\nheaders = {\n    'content-type': \"application/json\",\n    'Authorization': \"REPLACE_KEY_VALUE\"\n    }\n\nconn.request(\"POST\", \"/api/webhooksubscriptions\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.cron.cool/api/webhooksubscriptions\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n  CURLOPT_POSTFIELDS => \"{\\\"projectId\\\":\\\"string\\\",\\\"url\\\":\\\"https://example.com/croncool-webhook\\\",\\\"events\\\":[\\\"job.created\\\"]}\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: REPLACE_KEY_VALUE\",\n    \"content-type: application/json\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.cron.cool/api/webhooksubscriptions');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\n$request->setBody('{\"projectId\":\"string\",\"url\":\"https://example.com/croncool-webhook\",\"events\":[\"job.created\"]}');\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$body = new http\\Message\\Body;\n$body->append('{\"projectId\":\"string\",\"url\":\"https://example.com/croncool-webhook\",\"events\":[\"job.created\"]}');\n\n$request->setRequestUrl('https://api.cron.cool/api/webhooksubscriptions');\n$request->setRequestMethod('POST');\n$request->setBody($body);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}},"/api/webhooksubscriptions/{webhookSubscriptionId}":{"put":{"tags":["Webhook subscriptions"],"summary":"Update a webhook subscription","description":"`url`, `events` and `active` are editable; the secret and project are immutable. Re-enabling an auto-disabled endpoint is done by setting `active` back to true.\n","security":[{"accessToken":[]}],"parameters":[{"in":"path","name":"webhookSubscriptionId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"The updated subscription (without secret)"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'PUT',\n  url: 'https://api.cron.cool/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D',\n  headers: {'content-type': 'application/json', Authorization: 'REPLACE_KEY_VALUE'},\n  body: {},\n  json: true\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request PUT \\\n  --url https://api.cron.cool/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D \\\n  --header 'Authorization: REPLACE_KEY_VALUE' \\\n  --header 'content-type: application/json' \\\n  --data '{}'"},{"lang":"Shell + Httpie","source":"echo '{}' |  \\\n  http PUT https://api.cron.cool/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D \\\n  Authorization:REPLACE_KEY_VALUE \\\n  content-type:application/json"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.cron.cool\")\n\npayload = \"{}\"\n\nheaders = {\n    'content-type': \"application/json\",\n    'Authorization': \"REPLACE_KEY_VALUE\"\n    }\n\nconn.request(\"PUT\", \"/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.cron.cool/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"PUT\",\n  CURLOPT_POSTFIELDS => \"{}\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: REPLACE_KEY_VALUE\",\n    \"content-type: application/json\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.cron.cool/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D');\n$request->setMethod(HTTP_METH_PUT);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\n$request->setBody('{}');\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$body = new http\\Message\\Body;\n$body->append('{}');\n\n$request->setRequestUrl('https://api.cron.cool/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D');\n$request->setRequestMethod('PUT');\n$request->setBody($body);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]},"delete":{"tags":["Webhook subscriptions"],"summary":"Delete a webhook subscription","security":[{"accessToken":[]}],"parameters":[{"in":"path","name":"webhookSubscriptionId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'DELETE',\n  url: 'https://api.cron.cool/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D',\n  headers: {Authorization: 'REPLACE_KEY_VALUE'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request DELETE \\\n  --url https://api.cron.cool/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D \\\n  --header 'Authorization: REPLACE_KEY_VALUE'"},{"lang":"Shell + Httpie","source":"http DELETE https://api.cron.cool/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D \\\n  Authorization:REPLACE_KEY_VALUE"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.cron.cool\")\n\nheaders = { 'Authorization': \"REPLACE_KEY_VALUE\" }\n\nconn.request(\"DELETE\", \"/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.cron.cool/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"DELETE\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: REPLACE_KEY_VALUE\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.cron.cool/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D');\n$request->setMethod(HTTP_METH_DELETE);\n\n$request->setHeaders([\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.cron.cool/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D');\n$request->setRequestMethod('DELETE');\n$request->setHeaders([\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}}},"tags":[]}