UpdatePolarClawCronJob
Updates the configuration of a PolarClaw scheduled task, allowing for partial field updates.
Try it now
Test
RAM authorization
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 |
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 |
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 |
| Message |
string |
No |
The prompt for the Agent conversation. This parameter is required if |
Generate the daily report and send it to the team. |
| Text |
string |
No |
The text for the system event. This parameter is required if |
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: |
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: |
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 |
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 |
{"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. |
|
| 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 |
| Restart |
boolean |
No |
Specifies whether to restart the gateway after the update. Default value: |
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 |
| Expr |
string |
The cron expression. Required if |
0 9 * * * |
| Tz |
string |
The IANA time zone, such as |
Asia/Shanghai |
| EveryMs |
integer |
The interval in milliseconds. Required if |
100000 |
| AnchorMs |
integer |
The base timestamp for interval alignment, in milliseconds. |
1777370572518 |
| At |
string |
The ISO 8601 timestamp. Required if |
2026-04-10T09:00:00+08:00 |
| SessionTarget |
string |
The session target. Valid values: |
main |
| WakeMode |
string |
The wake mode. Valid values: |
now |
| Payload |
object |
The execution payload configuration. |
|
| Kind |
string |
The payload type. Valid values: |
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: |
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 |
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 |
|
|
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 |
| Status |
string |
The status of the run. Valid values: |
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.