Skip to content

Cron Jobs

Schedule recurring HTTP jobs on a cron expression — create, pause, trigger and inspect runs, with retries and retention.

1. Overview

Base path: https://api.infrai.cc/v1/cron
Auth header: Authorization: Bearer $INFRAI_API_KEY
bash
# Call any /v1/cron capability over raw HTTP — no SDK to install.
# curl:
curl https://api.infrai.cc/v1/cron/... \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json"

2. Methods (10)

2.1cron.create

POST /v1/cron/create

Create a scheduled cron job that POSTs to a URL on a schedule.

Parameters

NameTypeRequiredDescription
namestring
Required
Human-readable job name.
schedulestring
Required
Cron expression, e.g. 0 9 * * *.
run_atstringOptionalAbsolute ISO-8601 UTC time for a ONE-SHOT job that fires exactly once (alternative to a recurring schedule).
format: date-time
urlstring
Required
URL that receives the scheduled POST.
payloadunknownOptionalOptional JSON payload sent with each run.
timezonestringOptionalIANA timezone for the schedule.
default: "UTC"
retriesnumberOptionalRetry attempts on failure.
idempotency_keystringOptionalOptional dedup key; identical retries return the same result.

Returns

CronRecord { cron_id, name, schedule, url, enabled, next_run_at? }
NameTypeDescription
job_idstringUnique identifier for this async job
pattern: ^cron_[A-Za-z0-9]{20,}$
namestring | nullHuman-readable name for this resource
account_idstringAccount identifier that owns this resource
cron_exprstringStandard 5/6-field cron expression.
task_type"http_url" | "function_ref"Type of task (http, serverless)
task_urlstring | nullURL to call when the cron job triggers
format: uri
task_function_namestring | nullServerless function name to invoke
timezonestringIANA timezone for the cron schedule
default: "UTC"
retryintegerRetry configuration for failed executions
0–10default: 3
timeout_secondsintegerStandard/Pro hard max 900s (15 min). Enterprise contract may override per-tier.
1–900default: 300
overlap_policy"allow" | "skip" | "queue"Policy for handling overlapping runs (skip, queue, cancel)
default: "skip"
max_runsinteger | nullMaximum number of runs to retain
≥ 1
payloadobject | nullPayload data for the message or request body
headersobject | nullCustom HTTP headers to include in requests or responses
on_failure_webhookstring | nullWebhook URL to call on execution failure
format: uri
enabledbooleanWhether this feature or configuration is enabled
default: true
status"active" | "disabled" | "exhausted" | "deleted"Current status of this resource
next_run_atstring | nullISO 8601 timestamp of the next scheduled run
format: date-time
last_run_atstring | nullISO 8601 timestamp of the last cron run
format: date-time
last_run_status"succeeded" | "failed" | "skipped" | nullStatus of the last cron run

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X POST https://api.infrai.cc/v1/cron/create \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"task": "https://example.com/callback"}'

2.2cron.list

GET /v1/cron/list

List cron jobs.

Returns

{ items: CronRecord[] }
NameTypeDescription
itemsobject[]List of cron job records
next_cursorstring | nullCursor for next page; null if last page

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X GET https://api.infrai.cc/v1/cron/list \
  -H "Authorization: Bearer $INFRAI_API_KEY"

2.3cron.get

GET /v1/cron/get/{id}

获取单个定时任务的配置与下次运行时间

Parameters

NameTypeRequiredDescription
cron_idstring
Required
定时任务 ID

Returns

CronRecord { cron_id, name, cron_expr, task, timezone, enabled, next_run_at? }
NameTypeDescription
job_idstringUnique identifier for this async job
pattern: ^cron_[A-Za-z0-9]{20,}$
namestring | nullHuman-readable name for this resource
account_idstringAccount identifier that owns this resource
cron_exprstringStandard 5/6-field cron expression.
task_type"http_url" | "function_ref"Type of task (http, serverless)
task_urlstring | nullURL to call when the cron job triggers
format: uri
task_function_namestring | nullServerless function name to invoke
timezonestringIANA timezone for the cron schedule
default: "UTC"
retryintegerRetry configuration for failed executions
0–10default: 3
timeout_secondsintegerStandard/Pro hard max 900s (15 min). Enterprise contract may override per-tier.
1–900default: 300
overlap_policy"allow" | "skip" | "queue"Policy for handling overlapping runs (skip, queue, cancel)
default: "skip"
max_runsinteger | nullMaximum number of runs to retain
≥ 1
payloadobject | nullPayload data for the message or request body
headersobject | nullCustom HTTP headers to include in requests or responses
on_failure_webhookstring | nullWebhook URL to call on execution failure
format: uri
enabledbooleanWhether this feature or configuration is enabled
default: true
status"active" | "disabled" | "exhausted" | "deleted"Current status of this resource
next_run_atstring | nullISO 8601 timestamp of the next scheduled run
format: date-time
last_run_atstring | nullISO 8601 timestamp of the last cron run
format: date-time
last_run_status"succeeded" | "failed" | "skipped" | nullStatus of the last cron run

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X GET https://api.infrai.cc/v1/cron/get/ID \
  -H "Authorization: Bearer $INFRAI_API_KEY"

2.4cron.update

PATCH /v1/cron/update/{id}

更新定时任务的表达式、目标与策略

Parameters

NameTypeRequiredDescription
cron_idstring
Required
定时任务 ID
cron_exprstringOptional标准 5/6 段 cron 表达式
taskstringOptional触发时投递的目标 URL
format: uri
namestringOptional任务名称
timezonestringOptionalIANA 时区名(如 Asia/Shanghai)
retrynumberOptional失败重试次数(0-10)
0–10
timeout_secondsnumberOptional单次触发超时秒数(1-900)
1–900
overlap_policy"allow" | "skip" | "queue" | nullOptional重叠策略:allow 允许 / skip 跳过 / queue 排队
max_runsnumberOptional最大运行次数,达到后自动停止
≥ 1
payloadobjectOptional随触发发送的 JSON 负载
headersobjectOptional随触发发送的自定义请求头
on_failure_webhookstringOptional失败时回调的 Webhook 地址
format: uri
idempotency_keystringOptional幂等键,避免重复执行

Returns

CronRecord { cron_id, name, cron_expr, task, timezone, enabled, next_run_at? }
NameTypeDescription
job_idstringUnique identifier for this async job
pattern: ^cron_[A-Za-z0-9]{20,}$
namestring | nullHuman-readable name for this resource
account_idstringAccount identifier that owns this resource
cron_exprstringStandard 5/6-field cron expression.
task_type"http_url" | "function_ref"Type of task (http, serverless)
task_urlstring | nullURL to call when the cron job triggers
format: uri
task_function_namestring | nullServerless function name to invoke
timezonestringIANA timezone for the cron schedule
default: "UTC"
retryintegerRetry configuration for failed executions
0–10default: 3
timeout_secondsintegerStandard/Pro hard max 900s (15 min). Enterprise contract may override per-tier.
1–900default: 300
overlap_policy"allow" | "skip" | "queue"Policy for handling overlapping runs (skip, queue, cancel)
default: "skip"
max_runsinteger | nullMaximum number of runs to retain
≥ 1
payloadobject | nullPayload data for the message or request body
headersobject | nullCustom HTTP headers to include in requests or responses
on_failure_webhookstring | nullWebhook URL to call on execution failure
format: uri
enabledbooleanWhether this feature or configuration is enabled
default: true
status"active" | "disabled" | "exhausted" | "deleted"Current status of this resource
next_run_atstring | nullISO 8601 timestamp of the next scheduled run
format: date-time
last_run_atstring | nullISO 8601 timestamp of the last cron run
format: date-time
last_run_status"succeeded" | "failed" | "skipped" | nullStatus of the last cron run

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X PATCH https://api.infrai.cc/v1/cron/update/ID \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

2.5cron.delete

DELETE /v1/cron/delete/{id}

删除一个定时任务

Parameters

NameTypeRequiredDescription
cron_idstring
Required
定时任务 ID
idempotency_keystringOptional幂等键,避免重复执行

Returns

{ cron_id, deleted }
NameTypeDescription
cron_idstringIdentifier of the (attempted) deleted cron job
deletedbooleanWhether the cron job was deleted
status"not_found" | nullSet to 'not_found' when the job did not exist (deleted=false)

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X DELETE https://api.infrai.cc/v1/cron/delete/ID \
  -H "Authorization: Bearer $INFRAI_API_KEY"

2.6cron.pause

POST /v1/cron/pause/{id}

暂停定时任务

Parameters

NameTypeRequiredDescription
cron_idstring
Required
定时任务 ID
idempotency_keystringOptional幂等键,避免重复执行

Returns

CronRecord { cron_id, enabled }
NameTypeDescription
job_idstringUnique identifier for this async job
pattern: ^cron_[A-Za-z0-9]{20,}$
namestring | nullHuman-readable name for this resource
account_idstringAccount identifier that owns this resource
cron_exprstringStandard 5/6-field cron expression.
task_type"http_url" | "function_ref"Type of task (http, serverless)
task_urlstring | nullURL to call when the cron job triggers
format: uri
task_function_namestring | nullServerless function name to invoke
timezonestringIANA timezone for the cron schedule
default: "UTC"
retryintegerRetry configuration for failed executions
0–10default: 3
timeout_secondsintegerStandard/Pro hard max 900s (15 min). Enterprise contract may override per-tier.
1–900default: 300
overlap_policy"allow" | "skip" | "queue"Policy for handling overlapping runs (skip, queue, cancel)
default: "skip"
max_runsinteger | nullMaximum number of runs to retain
≥ 1
payloadobject | nullPayload data for the message or request body
headersobject | nullCustom HTTP headers to include in requests or responses
on_failure_webhookstring | nullWebhook URL to call on execution failure
format: uri
enabledbooleanWhether this feature or configuration is enabled
default: true
status"active" | "disabled" | "exhausted" | "deleted"Current status of this resource
next_run_atstring | nullISO 8601 timestamp of the next scheduled run
format: date-time
last_run_atstring | nullISO 8601 timestamp of the last cron run
format: date-time
last_run_status"succeeded" | "failed" | "skipped" | nullStatus of the last cron run

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X POST https://api.infrai.cc/v1/cron/pause/ID \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"cron_id": "sample"}'

2.7cron.resume

POST /v1/cron/resume/{id}

恢复已暂停的定时任务

Parameters

NameTypeRequiredDescription
cron_idstring
Required
定时任务 ID
idempotency_keystringOptional幂等键,避免重复执行

Returns

CronRecord { cron_id, enabled, next_run_at? }
NameTypeDescription
job_idstringUnique identifier for this async job
pattern: ^cron_[A-Za-z0-9]{20,}$
namestring | nullHuman-readable name for this resource
account_idstringAccount identifier that owns this resource
cron_exprstringStandard 5/6-field cron expression.
task_type"http_url" | "function_ref"Type of task (http, serverless)
task_urlstring | nullURL to call when the cron job triggers
format: uri
task_function_namestring | nullServerless function name to invoke
timezonestringIANA timezone for the cron schedule
default: "UTC"
retryintegerRetry configuration for failed executions
0–10default: 3
timeout_secondsintegerStandard/Pro hard max 900s (15 min). Enterprise contract may override per-tier.
1–900default: 300
overlap_policy"allow" | "skip" | "queue"Policy for handling overlapping runs (skip, queue, cancel)
default: "skip"
max_runsinteger | nullMaximum number of runs to retain
≥ 1
payloadobject | nullPayload data for the message or request body
headersobject | nullCustom HTTP headers to include in requests or responses
on_failure_webhookstring | nullWebhook URL to call on execution failure
format: uri
enabledbooleanWhether this feature or configuration is enabled
default: true
status"active" | "disabled" | "exhausted" | "deleted"Current status of this resource
next_run_atstring | nullISO 8601 timestamp of the next scheduled run
format: date-time
last_run_atstring | nullISO 8601 timestamp of the last cron run
format: date-time
last_run_status"succeeded" | "failed" | "skipped" | nullStatus of the last cron run

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X POST https://api.infrai.cc/v1/cron/resume/ID \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"cron_id": "sample"}'

2.8cron.trigger

POST /v1/cron/trigger/{id}

立即手动触发一次定时任务运行

Parameters

NameTypeRequiredDescription
cron_idstring
Required
定时任务 ID
idempotency_keystringOptional幂等键,避免重复执行

Returns

CronRun { run_id, cron_id, state, started_at }
NameTypeDescription
run_idstringUnique identifier for this cron run
pattern: ^cronrun_[A-Za-z0-9]{20,}$
job_idstringUnique identifier for this async job
pattern: ^cron_[A-Za-z0-9]{20,}$
account_idstringAccount identifier that owns this resource
pattern: ^acct_(anon|email)_[A-Za-z0-9_]…
scheduled_atstringTime computed from the cron expression.
format: date-time
fired_atstringActual trigger time (may drift a few ms).
format: date-time
started_atstring | nullISO 8601 timestamp when execution started
format: date-time
completed_atstring | nullISO 8601 timestamp when execution completed
format: date-time
duration_msinteger | nullDuration of the operation in milliseconds
≥ 0
status"queued" | "running" | "succeeded" | "failed" | "timeout" | "skipped"Current status of this resource
skipped_reason"overlap_skip" | "max_runs_reached" | "disabled" | nullReason the run was skipped
retry_countintegerNumber of retries for this run
≥ 0
is_manual_triggerbooleanWhether this run was triggered manually
http_statusinteger | nullHTTP status code of the webhook delivery attempt
100–599
outputstring | nullFirst 4 KB of response body.
errorstring | nullError message if the operation failed
error_codestring | nullError code from the failed execution
on_failure_webhook_delivery_idstring | nullWebhook delivery ID for the failure notification
pattern: ^dlv_[A-Za-z0-9]{20,}$

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X POST https://api.infrai.cc/v1/cron/trigger/ID \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"cron_id": "sample"}'

2.9cron.runs.get

GET /v1/cron/runs/get/{id}/{run_id}

获取定时任务某次运行的详情

Parameters

NameTypeRequiredDescription
cron_idstring
Required
定时任务 ID
run_idstring
Required
运行(CronRun)ID

Returns

CronRun { run_id, cron_id, state, started_at, finished_at?, response_status?, error? }
NameTypeDescription
run_idstringUnique identifier for this cron run
pattern: ^cronrun_[A-Za-z0-9]{20,}$
job_idstringUnique identifier for this async job
pattern: ^cron_[A-Za-z0-9]{20,}$
account_idstringAccount identifier that owns this resource
pattern: ^acct_(anon|email)_[A-Za-z0-9_]…
scheduled_atstringTime computed from the cron expression.
format: date-time
fired_atstringActual trigger time (may drift a few ms).
format: date-time
started_atstring | nullISO 8601 timestamp when execution started
format: date-time
completed_atstring | nullISO 8601 timestamp when execution completed
format: date-time
duration_msinteger | nullDuration of the operation in milliseconds
≥ 0
status"queued" | "running" | "succeeded" | "failed" | "timeout" | "skipped"Current status of this resource
skipped_reason"overlap_skip" | "max_runs_reached" | "disabled" | nullReason the run was skipped
retry_countintegerNumber of retries for this run
≥ 0
is_manual_triggerbooleanWhether this run was triggered manually
http_statusinteger | nullHTTP status code of the webhook delivery attempt
100–599
outputstring | nullFirst 4 KB of response body.
errorstring | nullError message if the operation failed
error_codestring | nullError code from the failed execution
on_failure_webhook_delivery_idstring | nullWebhook delivery ID for the failure notification
pattern: ^dlv_[A-Za-z0-9]{20,}$

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X GET https://api.infrai.cc/v1/cron/runs/get/ID/RUN_ID \
  -H "Authorization: Bearer $INFRAI_API_KEY"

2.10cron.runs.list

GET /v1/cron/runs/list/{id}

列出某定时任务的运行历史(执行记录),支持分页。

Parameters

NameTypeRequiredDescription
cron_idstring
Required
要列出运行记录的定时任务 ID。
cursorstringOptional分页游标。
limitnumberOptional返回运行记录的最大条数。

Returns

{ items: CronRun[], next_cursor? }
NameTypeDescription
itemsobject[]Array of result items in this page
items[].run_idstringUnique identifier for this cron run
pattern: ^cronrun_[A-Za-z0-9]{20,}$
items[].job_idstringUnique identifier for this async job
pattern: ^cron_[A-Za-z0-9]{20,}$
items[].account_idstringAccount identifier that owns this resource
pattern: ^acct_(anon|email)_[A-Za-z0-9_]…
items[].scheduled_atstringTime computed from the cron expression.
format: date-time
items[].fired_atstringActual trigger time (may drift a few ms).
format: date-time
items[].started_atstring | nullISO 8601 timestamp when execution started
format: date-time
items[].completed_atstring | nullISO 8601 timestamp when execution completed
format: date-time
items[].duration_msinteger | nullDuration of the operation in milliseconds
≥ 0
items[].status"queued" | "running" | "succeeded" | "failed" | "timeout" | "skipped"Current status of this resource
items[].skipped_reason"overlap_skip" | "max_runs_reached" | "disabled" | nullReason the run was skipped
items[].retry_countintegerNumber of retries for this run
≥ 0
items[].is_manual_triggerbooleanWhether this run was triggered manually
items[].http_statusinteger | nullHTTP status code of the webhook delivery attempt
100–599
items[].outputstring | nullFirst 4 KB of response body.
items[].errorstring | nullError message if the operation failed
items[].error_codestring | nullError code from the failed execution
items[].on_failure_webhook_delivery_idstring | nullWebhook delivery ID for the failure notification
pattern: ^dlv_[A-Za-z0-9]{20,}$
next_cursorstring | nullOpaque cursor to fetch the next page; null/absent if this is the last page

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X GET https://api.infrai.cc/v1/cron/runs/list/ID \
  -H "Authorization: Bearer $INFRAI_API_KEY"

3. All capabilities

Every routed capability in this module — the complete public REST contract. The methods above are the guided walkthrough; this index is the full reference.

cron.createPOST /v1/cron/create

Create a scheduled job: recurring via cron_expr, or a one-shot via run_at (fires once); idempotent write.

Parameters (14)
NameTypeRequiredDescription
cron_exprstringOptionalStandard 5/6-field cron expression (recurring schedule). Mutually exclusive with run_at.
run_atstringOptionalAbsolute UTC time for a ONE-SHOT job that fires exactly once (max_runs=1). Mutually exclusive with cron_expr.
format: date-time
taskstringRequiredDelivery target URL the cron fires against (http_url task type).
format: uri
namestring | nullOptionalHuman-readable name for this resource
timezonestringOptionalIANA tz name.
default: "UTC"
retryintegerOptionalRetry configuration for failed executions
0–10default: 3
timeout_secondsintegerOptionalMaximum execution time in seconds
1–900default: 300
overlap_policy"allow" | "skip" | "queue"OptionalPolicy for handling overlapping runs (skip, queue, cancel)
default: "skip"
max_runsinteger | nullOptionalMaximum number of runs to retain
≥ 1
payloadobject | nullOptionalPayload data for the message or request body
headersobject | nullOptionalCustom HTTP headers to include in requests or responses
on_failure_webhookstring | nullOptionalWebhook URL to call on execution failure
format: uri
secretstring | nullOptionalHMAC signing secret for the fired request; never returned (only secret_fingerprint).
idempotency_keystring | nullOptionalClient-provided idempotency key; prevents duplicate execution on retry
cron.deleteDELETE /v1/cron/delete/{id}

Delete a cron job and stop all of its future scheduled runs; idempotent.

Parameters (1)
NameTypeRequiredDescription
idstringRequiredPath parameter.
cron.getGET /v1/cron/get/{id}

Get a single cron job's configuration and next run time.

Parameters (1)
NameTypeRequiredDescription
idstringRequiredPath parameter.
cron.listGET /v1/cron/list

List the account's cron jobs with pagination.

No request parameters.

cron.pausePOST /v1/cron/pause/{id}

Pause a cron job, halting subsequent triggers.

Parameters (3)
NameTypeRequiredDescription
idstringRequiredPath parameter.
cron_idstringRequiredId of the cron job to act on.
idempotency_keystring | nullOptionalClient-provided idempotency key; prevents duplicate execution on retry
cron.resumePOST /v1/cron/resume/{id}

Resume a paused cron job.

Parameters (3)
NameTypeRequiredDescription
idstringRequiredPath parameter.
cron_idstringRequiredId of the cron job to act on.
idempotency_keystring | nullOptionalClient-provided idempotency key; prevents duplicate execution on retry
cron.runs.getGET /v1/cron/runs/get/{id}/{run_id}

Retrieve details of a single cron job execution (CronRun).

Parameters (2)
NameTypeRequiredDescription
run_idstringRequiredPath parameter.
idstringRequiredPath parameter.
cron.runs.listGET /v1/cron/runs/list/{id}

List a cron job's run history (executions) with pagination.

Parameters (1)
NameTypeRequiredDescription
idstringRequiredPath parameter.
cron.triggerPOST /v1/cron/trigger/{id}

Manually trigger an immediate run of a scheduled cron job.

Parameters (3)
NameTypeRequiredDescription
idstringRequiredPath parameter.
cron_idstringRequiredId of the cron job to act on.
idempotency_keystring | nullOptionalClient-provided idempotency key; prevents duplicate execution on retry
cron.updatePATCH /v1/cron/update/{id}

Update a cron job's schedule expression, target, overlap policy, and other fields.

Parameters (13)
NameTypeRequiredDescription
idstringRequiredPath parameter.
cron_exprstring | nullOptionalCron expression for the schedule
taskstring | nullOptionalTask URL or function to invoke on trigger
format: uri
namestring | nullOptionalHuman-readable name for this resource
timezonestring | nullOptionalIANA tz name.
retryinteger | nullOptionalRetry configuration for failed executions
0–10
timeout_secondsinteger | nullOptionalMaximum execution time in seconds
1–900
overlap_policy"allow" | "skip" | "queue" | nullOptionalPolicy for handling overlapping runs (skip, queue, cancel)
max_runsinteger | nullOptionalMaximum number of runs to retain
≥ 1
payloadobject | nullOptionalPayload data for the message or request body
headersobject | nullOptionalCustom HTTP headers to include in requests or responses
on_failure_webhookstring | nullOptionalWebhook URL to call on execution failure
format: uri
idempotency_keystring | nullOptionalClient-provided idempotency key; prevents duplicate execution on retry

4. End-to-end example

A production-style walkthrough of this module: configure once, then run the flow. It exercises most of the module's APIs.

A copy-paste-runnable single-file Python program (stdlib only, no SDK): set your INFRAI_API_KEY, run it, and walk this module's core flow with REAL billed calls — later steps reuse real fields returned by earlier ones. The 12-line helper is the entire integration.

python
#!/usr/bin/env python3
"""Infrai · cron — runnable real-app example (single file, zero deps).

Copy this file, set your key, run it: every step is a REAL call to
api.infrai.cc, billed at the real (tiny) per-call price, printing the
live JSON response. Get a key at https://infrai.cc/login (Google/
GitHub sign-in grants $2 free credit); add funds at
https://infrai.cc/billing. No SDK — the 12-line helper below is the
entire integration."""
import json
import os
from urllib import error, request

KEY = os.environ.get("INFRAI_API_KEY") or "ifr_..."  # <- your key
BASE = "https://api.infrai.cc"


# Same raw HTTPS POST/GET as every per-method example on this page —
# wrapped once for reuse. There is nothing else to it: no SDK.
def infrai(method, path, body=None):
    req = request.Request(
        BASE + path, method=method,
        data=json.dumps(body).encode() if body is not None else None,
        headers={"Authorization": f"Bearer {KEY}",
                 "Content-Type": "application/json"})
    try:
        with request.urlopen(req, timeout=60) as r:
            return json.loads(r.read())
    except error.HTTPError as e:
        return json.loads(e.read())


def show(label, resp):
    print(f"\n== {label} ==")
    print(json.dumps(resp, indent=2, ensure_ascii=False))
    return resp


# 1) cron.create — POST /v1/cron/create · Create a scheduled job: recurring via cron_expr, or a one-shot via run_at (fires once); idempotent write.
r1 = show("cron.create", infrai("POST", "/v1/cron/create", {"cron_expr":"0 9 * * 1","task":"https://api.acme.com/weekly"}))

# 2) cron.runs.list — GET /v1/cron/runs/list/{id} · List a cron job's run history (executions) with pagination.
id_2 = (r1.get("data") or {}).get("cron_id") or ""
r2 = show("cron.runs.list", infrai("GET", f"/v1/cron/runs/list/{id_2}"))

# 3) cron.list — GET /v1/cron/list · List the account's cron jobs with pagination.
r3 = show("cron.list", infrai("GET", "/v1/cron/list"))