Skip to Content
SeyloDocs
API referenceCron jobs

Create a cron job

POST
/api/v1/cron.create

Adds a scheduled command to a service. It runs in a one-off container from the service's image, with its env and volumes.

Needs services.cron on the service (a grant on its project covers it). Available to MCP clients and the assistant.

Authorization

cookieseylo_session<token>

Request Body

application/json
  1. body
serviceId*string

Panel-issued id.

Match^[a-z0-9]{16}$
name*string
Length1 <= length <= 60
schedule*string

Five-field cron expression or @hourly, @daily, @weekly, @monthly, @yearly.

Match^(@(hourly|daily|weekly|monthly|yearly)|(\S+\s+){4}\S+)$
Length1 <= length <= 120
timeZone?string
Match^[A-Za-z_]+(/[A-Za-z0-9_+-]+)*$
Length1 <= length <= 64
command*string

Run as sh -c .

Length1 <= length <= 4096
timeoutSeconds?integer
Range1 <= value <= 86400
concurrency?||

When a run is still going at the next tick: skip the new one, run both, or stop the old one.

enabled?boolean

Response Body

Success.

application/json
  1. response
id*string

Panel-issued id.

Match^[a-z0-9]{16}$
serviceId*string

Panel-issued id.

Match^[a-z0-9]{16}$
name*string
Length1 <= length <= 60
schedule*string

Five-field cron expression or @hourly, @daily, @weekly, @monthly, @yearly.

Match^(@(hourly|daily|weekly|monthly|yearly)|(\S+\s+){4}\S+)$
Length1 <= length <= 120
timeZone*string
Match^[A-Za-z_]+(/[A-Za-z0-9_+-]+)*$
Length1 <= length <= 64
command*string

Run as sh -c .

Length1 <= length <= 4096
timeoutSeconds*integer
Range1 <= value
concurrency*||

When a run is still going at the next tick: skip the new one, run both, or stop the old one.

enabled*boolean
nextRunAt*|null
lastRun*|null
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
Example Request
curl -X POST 'https://example.com/api/v1/cron.create' \  -H 'Content-Type: application/json' \  -d '{  "serviceId": "string",  "name": "string",  "schedule": "string",  "command": "string"}'
Example Response
{  "id": "string",  "serviceId": "string",  "name": "string",  "schedule": "string",  "timeZone": "string",  "command": "string",  "timeoutSeconds": 1,  "concurrency": "forbid",  "enabled": true,  "nextRunAt": "2019-08-24T14:15:22Z",  "lastRun": {    "id": "string",    "cronJobId": "string",    "serviceId": "string",    "nodeId": "string",    "result": "running",    "manual": true,    "exitCode": 0,    "startedAt": "2019-08-24T14:15:22Z",    "finishedAt": "2019-08-24T14:15:22Z",    "durationMs": 0  },  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z"}