Create cron
curl --request POST \
--url https://api.example.com/cronsimport requests
url = "https://api.example.com/crons"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/crons', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/crons",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/crons"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/crons")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/crons")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"cron": "<string>",
"url": "<string>",
"name": "<string>",
"method": "<string>",
"headers": {},
"body": {}
}Crons
Create cron
Create a new recurring scheduled webhook
POST
/
crons
Create cron
curl --request POST \
--url https://api.example.com/cronsimport requests
url = "https://api.example.com/crons"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/crons', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/crons",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/crons"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/crons")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/crons")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"cron": "<string>",
"url": "<string>",
"name": "<string>",
"method": "<string>",
"headers": {},
"body": {}
}Request body
string
required
Cron expression defining the schedule (e.g.,
*/5 * * * *). Must be a valid 5-field cron expression.string
required
Webhook URL to call on each execution.
string
Optional display name for the cron.
string
default:"POST"
HTTP method:
GET, POST, or DELETE.object
default:"{}"
Custom HTTP headers to include in the webhook request.
object
default:"{}"
JSON body to send with the webhook request (used with POST).
Response
Returns the created cron object with a201 status code.
curl -X POST https://app.cronapi.dev/api/v1/crons \
-H "Authorization: Bearer your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Daily report",
"cron": "0 9 * * *",
"url": "https://example.com/report",
"method": "POST",
"headers": {"X-Custom": "value"},
"body": {"notify": true}
}'
const response = await fetch("https://app.cronapi.dev/api/v1/crons", {
method: "POST",
headers: {
"Authorization": `Bearer your_api_key_here`,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Daily report",
cron: "0 9 * * *",
url: "https://example.com/report",
method: "POST",
headers: { "X-Custom": "value" },
body: { type: "daily" },
}),
});
const cron = await response.json();
import requests
response = requests.post(
"https://app.cronapi.dev/api/v1/crons",
headers={"Authorization": "Bearer your_api_key_here"},
json={
"name": "Daily report",
"cron": "0 9 * * *",
"url": "https://example.com/report",
"method": "POST",
"headers": {"X-Custom": "value"},
"body": {"notify": true},
},
)
cron = response.json()
201
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"user_id": "d4e5f6a7-b890-1234-cdef-567890abcdef",
"name": "Daily report",
"cron": "0 9 * * *",
"url": "https://example.com/report",
"method": "POST",
"headers": {"X-Custom": "value"},
"body": {"notify": true},
"paused": false,
"last_run_at": null,
"next_run_at": "2026-04-16T09:00:00.000Z",
"created_at": "2026-04-15T14:31:00.000Z"
}
400
{
"error": "Invalid cron expression: unexpected character at position 0"
}
⌘I