Skip to main content
POST
/
api
/
cron-jobs
Create cron job
curl --request POST \
  --url https://sontairo.com/api/cron-jobs \
  --header 'Content-Type: application/json' \
  --data '
{
  "workspaceId": "<string>",
  "name": "<string>",
  "schedule": "<string>",
  "prompt": "<string>",
  "projectId": "<string>",
  "agentId": "<string>",
  "description": "<string>",
  "timezone": "UTC"
}
'
{
  "data": {
    "id": "<string>",
    "workspaceId": "<string>",
    "projectId": "<string>",
    "name": "<string>",
    "description": "<string>",
    "schedule": "<string>",
    "prompt": "<string>",
    "timezone": "<string>",
    "isActive": true,
    "agentId": "<string>",
    "agent": {
      "id": "<string>",
      "name": "<string>"
    },
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  }
}

Body

application/json
workspaceId
string
required
name
string
required
Required string length: 1 - 100
schedule
string
required

Cron expression (e.g. 0 9 * * *)

Required string length: 1 - 100
prompt
string
required

Task instruction for each run

Required string length: 1 - 10000
projectId
string | null
agentId
string

Agent to run

description
string
Maximum string length: 500
timezone
string
default:UTC
Maximum string length: 50

Response

201 - application/json

Cron job created

data
object