UpdatePolarClawCronJob

Updated at:
Copy as MD

Updates the configuration of a PolarClaw scheduled task, allowing for partial field updates.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

ApplicationId

string

Yes

The application ID.

pa-xxx

JobId

string

Yes

The ID of the scheduled task to update.

0ee00f56-f467-4d41-858c-ca4ede2c770e

Name

string

No

The new name for the task.

afternoon-report

Schedule

object

No

The scheduling configuration.

{"Kind":"cron","Expr":"0 12 * * *","Tz":"America/New_York"}

Kind

string

No

The schedule type.

cron

Expr

string

No

The cron expression.

0 9 * * *

Tz

string

No

The time zone.

Asia/Shanghai

StaggerMs

integer

No

The deterministic jitter window, in milliseconds.

0

EveryMs

integer

No

The interval in milliseconds. This parameter is required if Schedule.Kind is every.

100000

AnchorMs

integer

No

The anchor timestamp for interval alignment, in milliseconds.

1777370572518

At

string

No

An ISO 8601 timestamp. This parameter is required if Schedule.Kind is at. For example: 2026-04-10T09:00:00+08:00.

2026-04-10T09:00:00+08:00

SessionTarget

string

No

The new session target.

isolated

WakeMode

string

No

The new wake mode.

now

Payload

object

No

The new payload configuration.

{"Kind":"agentTurn","Message":"Updated: Generate afternoon report."}

Kind

string

No

The payload type. Valid values are agentTurn (for an Agent conversation) or systemEvent (for a system event).

agentTurn

Message

string

No

The prompt for the Agent conversation. This parameter is required if Payload.Kind is agentTurn.

Generate the daily report and send it to the team.

Text

string

No

The text for the system event. This parameter is required if Payload.Kind is systemEvent.

Send a reminder to the user.

Model

string

No

The model override.

anthropic/sonnet-4.6

Fallbacks

array

No

A list of fallback models.

string

No

A fallback model.

modelA

Thinking

string

No

The thinking level. Valid values: off, minimal, low, medium, high, and xhigh.

medium

TimeoutSeconds

integer

No

The execution timeout in seconds.

10

LightContext

boolean

No

Specifies whether to use a lightweight context.

false

Deliver

boolean

No

Specifies whether to deliver the output to a channel.

false

Channel

string

No

The ID of the delivery channel.

telegram

To

string

No

The delivery target.

team

BestEffortDeliver

boolean

No

Specifies whether to ignore delivery failures.

AgentId

string

No

The ID of the Agent that runs the task.

work

SessionKey

string

No

The session routing key.

agent:main:feishu:direct:***

Description

string

No

The new description for the task.

Daily report generation

Enabled

boolean

No

Specifies whether the task is enabled.

false

DeleteAfterRun

boolean

No

Specifies whether to delete the task after its first execution.

true

Delivery

object

No

The result delivery configuration.

{"Mode":"announce","Channel":"telegram"}

Mode

string

No

The delivery mode. Valid values: none, announce, and webhook.

announce

Channel

string

No

The delivery channel.

telegram

AccountId

string

No

The account ID for the channel.

accountId123

To

string

No

The delivery target. This parameter is required and must be a URL if Delivery.Mode is webhook.

https://example.com/webhook

BestEffort

boolean

No

Specifies whether to ignore delivery failures.

false

FailureAlert

object

No

The configuration for failure alerts. Set this to false to disable alerts.

{"After":3,"Channel":"telegram"}

After

integer

No

The number of consecutive failures after which to send an alert.

3

Channel

string

No

The alert channel.

email

AccountId

string

No

The account ID for the channel.

accountId123

To

string

No

The alert target.

user@example.com

CooldownMs

integer

No

The minimum interval between two alerts, in milliseconds.

5000

Mode

string

No

The alert mode. Valid values: announce and webhook.

announce

Restart

boolean

No

Specifies whether to restart the gateway after the update. Default value: true.

true

Response elements

Element

Type

Description

Example

object

The response schema.

RequestId

string

The request ID.

2281C6C9-CBAB-1AFD-8400-670750CF6025_2212

Message

string

The success message.

successful

Code

integer

The HTTP status code.

200

ApplicationId

string

The application ID.

pa-**************

Ok

boolean

Indicates whether the operation was successful.

true

Job

object

Details of the updated job.

Id

string

The job ID (UUID).

0ee00f56-f467-4d41-858c-ca4ede2c770e

Name

string

The job name.

daily-report

Enabled

boolean

Indicates whether the job is enabled.

false

DeleteAfterRun

boolean

Indicates whether the job is deleted after its first run.

false

CreatedAtMs

integer

The creation timestamp, in milliseconds.

1777368967284

UpdatedAtMs

integer

The last update timestamp, in milliseconds.

1777370572517

Schedule

object

The schedule configuration.

Kind

string

The schedule type. Valid values: cron (cron expression), every (fixed interval), or at (one-time).

cron

Expr

string

The cron expression. Required if Kind is cron.

0 9 * * *

Tz

string

The IANA time zone, such as Asia/Shanghai.

Asia/Shanghai

EveryMs

integer

The interval in milliseconds. Required if Kind is every.

100000

AnchorMs

integer

The base timestamp for interval alignment, in milliseconds.

1777370572518

At

string

The ISO 8601 timestamp. Required if Kind is at.

2026-04-10T09:00:00+08:00

SessionTarget

string

The session target. Valid values: main, isolated, or current.

main

WakeMode

string

The wake mode. Valid values: now or next-heartbeat.

now

Payload

object

The execution payload configuration.

Kind

string

The payload type. Valid values: agentTurn (Agent conversation) or systemEvent (system event).

agentTurn

Message

string

The Agent conversation prompt.

Generate the daily report.

Text

string

The system event text.

Generate the daily report.

Model

string

The model override.

anthropic/sonnet-4.6

TimeoutSeconds

integer

The optional execution timeout in seconds.

10

LightContext

boolean

Indicates whether to use a lightweight context.

false

Deliver

boolean

Indicates whether to deliver the output to a channel.

false

Channel

string

The optional delivery channel ID.

telegram

To

string

The optional delivery target.

team

BestEffortDeliver

boolean

Indicates whether to ignore delivery failures.

false

AgentId

string

The optional ID of the Agent that runs the job.

work

SessionKey

string

The optional session routing key.

abc123

Description

string

The optional job description.

Daily report generation

Delivery

object

The optional result delivery configuration.

Mode

string

The delivery mode. Valid values: none, announce, or webhook.

announce

Channel

string

The delivery channel.

telegram

AccountId

string

The optional channel account ID.

default

To

string

The delivery target. Required and must be a URL if Mode is webhook.

https://example.com/webhook

BestEffort

boolean

Indicates whether to ignore delivery failures.

State

object

The running state of the job.

NextRunAtMs

integer

The timestamp for the next run, in milliseconds.

1777424400000

LastRunAtMs

integer

The optional timestamp of the last run, in milliseconds.

1777370544931

LastRunStatus

string

The optional status of the last run.

ok

ConsecutiveErrors

integer

The number of consecutive failures.

0

Runs

array<object>

The run history. Returned only if IncludeRuns is true.

array<object>

Details of a single job run.

Ts

integer

The run timestamp, in milliseconds.

1777370572518

JobId

string

The associated job ID.

0ee00f56-f467-4d41-858c-ca4ede2c770e

Action

string

The action performed. Valid values: finished, error, or skipped.

finished

Status

string

The status of the run. Valid values: ok, error, or skipped.

ok

Summary

string

The run summary text.

Report generated successfully.

Delivered

boolean

Indicates whether the result was delivered.

true

DeliveryStatus

string

The delivery status.

delivered

SessionId

string

The associated session ID.

abc123

RunAtMs

integer

The actual execution timestamp, in milliseconds.

1777370544931

DurationMs

integer

The execution duration, in milliseconds.

27586

NextRunAtMs

integer

The timestamp of the next scheduled run, in milliseconds.

1777424400000

Model

string

The model used for the run.

anthropic/sonnet-4.6

Provider

string

The model provider.

anthropic

Usage

object

Optional token usage details.

InputTokens

integer

The number of input tokens.

30250

OutputTokens

integer

The number of output tokens.

30250

TotalTokens

integer

The total number of tokens.

60500

JobName

string

The job name.

daily-report

Examples

Success response

JSON format

{
  "RequestId": "2281C6C9-CBAB-1AFD-8400-670750CF6025_2212",
  "Message": "successful",
  "Code": 200,
  "ApplicationId": "pa-**************",
  "Ok": true,
  "Job": {
    "Id": "0ee00f56-f467-4d41-858c-ca4ede2c770e",
    "Name": "daily-report",
    "Enabled": false,
    "DeleteAfterRun": false,
    "CreatedAtMs": 1777368967284,
    "UpdatedAtMs": 1777370572517,
    "Schedule": {
      "Kind": "cron",
      "Expr": "0 9 * * *",
      "Tz": "Asia/Shanghai",
      "EveryMs": 100000,
      "AnchorMs": 1777370572518,
      "At": "2026-04-10T09:00:00+08:00"
    },
    "SessionTarget": "main",
    "WakeMode": "now",
    "Payload": {
      "Kind": "agentTurn",
      "Message": "Generate the daily report.",
      "Text": "Generate the daily report.",
      "Model": "anthropic/sonnet-4.6",
      "TimeoutSeconds": 10,
      "LightContext": false,
      "Deliver": false,
      "Channel": "telegram",
      "To": "team",
      "BestEffortDeliver": false
    },
    "AgentId": "work",
    "SessionKey": "abc123",
    "Description": "Daily report generation",
    "Delivery": {
      "Mode": "announce",
      "Channel": "telegram",
      "AccountId": "default",
      "To": "https://example.com/webhook",
      "BestEffort": false
    },
    "State": {
      "NextRunAtMs": 1777424400000,
      "LastRunAtMs": 1777370544931,
      "LastRunStatus": "ok",
      "ConsecutiveErrors": 0
    },
    "Runs": [
      {
        "Ts": 1777370572518,
        "JobId": "0ee00f56-f467-4d41-858c-ca4ede2c770e",
        "Action": "finished",
        "Status": "ok",
        "Summary": "Report generated successfully.",
        "Delivered": true,
        "DeliveryStatus": "delivered",
        "SessionId": "abc123",
        "RunAtMs": 1777370544931,
        "DurationMs": 27586,
        "NextRunAtMs": 1777424400000,
        "Model": "anthropic/sonnet-4.6",
        "Provider": "anthropic",
        "Usage": {
          "InputTokens": 30250,
          "OutputTokens": 30250,
          "TotalTokens": 60500
        },
        "JobName": "daily-report"
      }
    ]
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.