Crons
POST
/v1/sandbox/cronsPOST
/v1/sandbox/cronsYour instance endpoint, shown on the instance page in the dashboard. Each instance has its own host; there is no shared API host.
Request Body
| Property | Type | Required | Description |
|---|---|---|---|
tenantId | string | No | |
sandboxId | string | No | |
sessionId | string | No | |
name | string | No | |
schedule | string | No | |
command | string | No | |
workDir | string | No | |
timeoutSeconds | integer | No | |
autoRecreate | boolean | No | |
sandboxConfig | object | No |
Responses
200 Create 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 POST "http://localhost:8089/v1/sandbox/crons" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"tenantId":"string","sandboxId":"string","sessionId":"string","name":"string","schedule":"string","command":"string","workDir":"string","timeoutSeconds":0,"autoRecreate":true}'const response = await fetch("http://localhost:8089/v1/sandbox/crons", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
"tenantId": "string",
"sandboxId": "string",
"sessionId": "string",
"name": "string",
"schedule": "string",
"command": "string",
"workDir": "string",
"timeoutSeconds": 0,
"autoRecreate": true
}),
});
const data = await response.json();import requests
response = requests.post(
"http://localhost:8089/v1/sandbox/crons",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"tenantId": "string",
"sandboxId": "string",
"sessionId": "string",
"name": "string",
"schedule": "string",
"command": "string",
"workDir": "string",
"timeoutSeconds": 0,
"autoRecreate": true
},
)
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"
}
]
}
