Create a cron trigger
curl --request POST \
--url https://app.hookie.ai/admin/api/projects/{project_id}/cron-triggers \
--header 'Content-Type: application/json' \
--cookie hookie_session= \
--data '
{
"name": "<string>",
"schedule": "<string>",
"payload": "<string>",
"dataset": "<string>"
}
'const options = {
method: 'POST',
headers: {cookie: 'hookie_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
schedule: '<string>',
payload: '<string>',
dataset: '<string>'
})
};
fetch('https://app.hookie.ai/admin/api/projects/{project_id}/cron-triggers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.hookie.ai/admin/api/projects/{project_id}/cron-triggers"
payload = {
"name": "<string>",
"schedule": "<string>",
"payload": "<string>",
"dataset": "<string>"
}
headers = {
"cookie": "hookie_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"next_run_at": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}Cron triggers
Create a cron trigger
POST
/
admin
/
api
/
projects
/
{project_id}
/
cron-triggers
Create a cron trigger
curl --request POST \
--url https://app.hookie.ai/admin/api/projects/{project_id}/cron-triggers \
--header 'Content-Type: application/json' \
--cookie hookie_session= \
--data '
{
"name": "<string>",
"schedule": "<string>",
"payload": "<string>",
"dataset": "<string>"
}
'const options = {
method: 'POST',
headers: {cookie: 'hookie_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
schedule: '<string>',
payload: '<string>',
dataset: '<string>'
})
};
fetch('https://app.hookie.ai/admin/api/projects/{project_id}/cron-triggers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.hookie.ai/admin/api/projects/{project_id}/cron-triggers"
payload = {
"name": "<string>",
"schedule": "<string>",
"payload": "<string>",
"dataset": "<string>"
}
headers = {
"cookie": "hookie_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"next_run_at": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}Authorizations
sessionbearerAuth
The console's sealed session cookie, set by WorkOS AuthKit. Mutating requests also require the X-Requested-With CSRF header.
Path Parameters
Body
application/json
Trimmed before validation.
Required string length:
1 - 805-field cron expression (minute hour day-of-month month day-of-week), UTC. Parsed at create time; a bad expression is rejected.
JSON template fired on each run. A string is stored verbatim; any other value is JSON.stringify'd; omitted becomes '{}'. Must still parse as JSON after {{now}}/{{iso}}/{{ts}} substitution.
Optional identity dataset. When absent the fired payload is routed through the project's mapping rules instead.