API

Scheduled tasks

Create scheduled tasks, which start a recurring mission from a stored prompt and a schedule.

GET
/scheduled-tasks

Query Parameters

projectId?string

Only the scheduled tasks of this project. A project that the caller cannot reach gives an empty list.

Length1 <= length

Response Body

application/json

application/json

curl -X GET "https://example.com/scheduled-tasks"
{  "data": [    {      "createdByUserId": "string",      "id": "string",      "orgId": "string",      "projectId": "string",      "name": "string",      "prompt": "string",      "templateKey": "string",      "triggers": [        {          "kind": "schedule",          "schedule": {            "interval": "daily",            "time": "string",            "timezone": "string",            "weekday": "monday",            "dayOfMonth": 1          }        }      ],      "labels": [        "string"      ],      "skipIfPreviousOpen": true,      "enabled": true,      "nextRunAt": 0,      "lastRunAt": 0,      "createdAt": 0,      "updatedAt": 0    }  ],  "nextCursor": "string"}
POST
/scheduled-tasks

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/scheduled-tasks" \  -H "Content-Type: application/json" \  -d '{    "projectId": "string",    "name": "string",    "prompt": "string",    "triggers": [      {        "kind": "schedule",        "schedule": {          "interval": "daily",          "time": "string",          "timezone": "string"        }      }    ]  }'
{  "createdByUserId": "string",  "id": "string",  "orgId": "string",  "projectId": "string",  "name": "string",  "prompt": "string",  "templateKey": "string",  "triggers": [    {      "kind": "schedule",      "schedule": {        "interval": "daily",        "time": "string",        "timezone": "string",        "weekday": "monday",        "dayOfMonth": 1      }    }  ],  "labels": [    "string"  ],  "skipIfPreviousOpen": true,  "enabled": true,  "nextRunAt": 0,  "lastRunAt": 0,  "createdAt": 0,  "updatedAt": 0}
GET
/scheduled-tasks/templates

Response Body

application/json

curl -X GET "https://example.com/scheduled-tasks/templates"
{  "data": [    {      "key": "string",      "name": "string",      "blurb": "string",      "prompt": "string",      "suggestedSchedule": {        "interval": "daily",        "time": "string",        "timezone": "string",        "weekday": "monday",        "dayOfMonth": 1      }    }  ]}
GET
/scheduled-tasks/{scheduledTaskId}

Path Parameters

scheduledTaskId*string
Length1 <= length

Response Body

application/json

application/json

curl -X GET "https://example.com/scheduled-tasks/string"
{  "createdByUserId": "string",  "id": "string",  "orgId": "string",  "projectId": "string",  "name": "string",  "prompt": "string",  "templateKey": "string",  "triggers": [    {      "kind": "schedule",      "schedule": {        "interval": "daily",        "time": "string",        "timezone": "string",        "weekday": "monday",        "dayOfMonth": 1      }    }  ],  "labels": [    "string"  ],  "skipIfPreviousOpen": true,  "enabled": true,  "nextRunAt": 0,  "lastRunAt": 0,  "createdAt": 0,  "updatedAt": 0}
PATCH
/scheduled-tasks/{scheduledTaskId}

Path Parameters

scheduledTaskId*string
Length1 <= length

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/scheduled-tasks/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "createdByUserId": "string",  "id": "string",  "orgId": "string",  "projectId": "string",  "name": "string",  "prompt": "string",  "templateKey": "string",  "triggers": [    {      "kind": "schedule",      "schedule": {        "interval": "daily",        "time": "string",        "timezone": "string",        "weekday": "monday",        "dayOfMonth": 1      }    }  ],  "labels": [    "string"  ],  "skipIfPreviousOpen": true,  "enabled": true,  "nextRunAt": 0,  "lastRunAt": 0,  "createdAt": 0,  "updatedAt": 0}
DELETE
/scheduled-tasks/{scheduledTaskId}

Path Parameters

scheduledTaskId*string
Length1 <= length

Response Body

application/json

application/json

application/json

curl -X DELETE "https://example.com/scheduled-tasks/string"
{  "ok": true,  "id": "string"}
GET
/scheduled-tasks/{scheduledTaskId}/runs

Path Parameters

scheduledTaskId*string
Length1 <= length

Query Parameters

limit?integer

Runs on one page, 1 to 200 (default 50).

Range1 <= value <= 200
Default50
cursor?string

nextCursor from the previous page. Leave it out for the newest runs.

Length1 <= length

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/scheduled-tasks/string/runs"
{  "data": [    {      "billingActorUserId": "string",      "id": "string",      "scheduledTaskId": "string",      "projectId": "string",      "scheduledFor": 0,      "kind": "scheduled",      "status": "dispatching",      "issueId": "string",      "issueUrl": "string",      "reason": "string",      "lastError": "string",      "createdAt": 0,      "updatedAt": 0,      "missionProgress": "string",      "missionActivity": "string",      "missionCostUsd": 0,      "missionCostIncomplete": true,      "missionTitle": "string"    }  ],  "nextCursor": "string"}
POST
/scheduled-tasks/{scheduledTaskId}/run

Path Parameters

scheduledTaskId*string
Length1 <= length

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/scheduled-tasks/string/run"
{  "ok": true,  "runId": "string",  "issueId": "string",  "status": "dispatching"}

How is this page?