Everstack
API ReferenceSandboxUpdate Cron

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

NameInTypeRequiredDescription
idpathstringYes

Request Body

PropertyTypeRequiredDescription
tenantIdstringNo
namestringNo
schedulestringNo
commandstringNo
enabledbooleanNo
timeoutSecondsintegerNo

Responses

200 Update a sandbox cron schedule

PropertyTypeDescription
cronobject

default An unexpected error response.

PropertyTypeDescription
codeinteger
messagestring
detailsobject[]

Request

curl -X PATCH "https://{instance}.{region}.everstack.ai/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("https://{instance}.{region}.everstack.ai/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(
    "https://{instance}.{region}.everstack.ai/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"
    }
  ]
}