Update Cron
PATCH
/v1/sandbox/crons/{id}PATCH
/v1/sandbox/crons/{id}Your instance endpoint, shown on the instance page in the dashboard. Each instance has its own host; there is no shared API host.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes |
Request Body
| Property | Type | Required | Description |
|---|---|---|---|
tenantId | string | No | |
name | string | No | |
schedule | string | No | |
command | string | No | |
enabled | boolean | No | |
timeoutSeconds | integer | No |
Responses
200 Update a sandbox cron schedule
| Property | Type | Description |
|---|---|---|
cron | object |
default An unexpected error response.
| Property | Type | Description |
|---|---|---|
code | integer | |
message | string | |
details | object[] |
Request
curl -X PATCH "http://localhost:8089/v1/sandbox/crons/{id}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"tenantId":"string","name":"string","schedule":"string","command":"string","enabled":true,"timeoutSeconds":0}'const response = await fetch("http://localhost:8089/v1/sandbox/crons/{id}", {
method: "PATCH",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
"tenantId": "string",
"name": "string",
"schedule": "string",
"command": "string",
"enabled": true,
"timeoutSeconds": 0
}),
});
const data = await response.json();import requests
response = requests.patch(
"http://localhost:8089/v1/sandbox/crons/{id}",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"tenantId": "string",
"name": "string",
"schedule": "string",
"command": "string",
"enabled": true,
"timeoutSeconds": 0
},
)
data = response.json()Response
{
"cron": {
"id": "string",
"tenantId": "string",
"sandboxId": "string",
"sessionId": "string",
"name": "string",
"schedule": "string",
"command": "string",
"workDir": "string",
"timeoutSeconds": 0,
"enabled": true,
"lastRunAt": "2024-01-01T00:00:00Z",
"nextRunAt": "2024-01-01T00:00:00Z",
"runCount": 0,
"errorCount": 0,
"lastError": "string",
"autoRecreate": true,
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
}{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
