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

Scheduled tasks

application/json
  1. response
data*array<>
nextCursor*string|null
Example Request
curl -X GET 'https://api.letsship.ai/v1/scheduled-tasks'
Example Response
{  "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"}

Create a scheduled task

POST
/scheduled-tasks

Request Body

application/json
  1. body
projectId*string
Length1 <= length
name*string
Length1 <= length <= 120
prompt*string
Length1 <= length <= 20000
triggers*array<>
Items1 <= items <= 1
labels?array<>
Itemsitems <= 10
templateKey?string
Length1 <= length <= 120
skipIfPreviousOpen?boolean
enabled?boolean

Response Body

Created

application/json
  1. response
createdByUserId?string|null
id*string
orgId*string
projectId*string
name*string
prompt*string
templateKey*string|null
triggers*array<>
labels*array<>
Itemsitems <= 10
skipIfPreviousOpen*boolean
enabled*boolean
nextRunAt*integer|null
lastRunAt*integer|null
createdAt*integer
updatedAt*integer
Example Request
curl -X POST 'https://api.letsship.ai/v1/scheduled-tasks' \  -H 'Content-Type: application/json' \  -d '{  "projectId": "string",  "name": "string",  "prompt": "string",  "triggers": [    {      "kind": "schedule",      "schedule": {        "interval": "daily",        "time": "string",        "timezone": "string"      }    }  ]}'
Example Response
{  "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

Templates

application/json
  1. response
data*array<>
Example Request
curl -X GET 'https://api.letsship.ai/v1/scheduled-tasks/templates'
Example Response200
{  "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

Scheduled task

application/json
  1. response
createdByUserId?string|null
id*string
orgId*string
projectId*string
name*string
prompt*string
templateKey*string|null
triggers*array<>
labels*array<>
Itemsitems <= 10
skipIfPreviousOpen*boolean
enabled*boolean
nextRunAt*integer|null
lastRunAt*integer|null
createdAt*integer
updatedAt*integer
Example Request
curl -X GET 'https://api.letsship.ai/v1/scheduled-tasks/string'
Example Response
{  "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}

Update a scheduled task

PATCH
/scheduled-tasks/{scheduledTaskId}

Path Parameters

scheduledTaskId*string
Length1 <= length

Request Body

application/json
  1. body
name?string
Length1 <= length <= 120
prompt?string
Length1 <= length <= 20000
triggers?array<>
Items1 <= items <= 1
labels?array<>
Itemsitems <= 10
skipIfPreviousOpen?boolean
enabled?boolean

Response Body

Updated

application/json
  1. response
createdByUserId?string|null
id*string
orgId*string
projectId*string
name*string
prompt*string
templateKey*string|null
triggers*array<>
labels*array<>
Itemsitems <= 10
skipIfPreviousOpen*boolean
enabled*boolean
nextRunAt*integer|null
lastRunAt*integer|null
createdAt*integer
updatedAt*integer
Example Request
curl -X PATCH 'https://api.letsship.ai/v1/scheduled-tasks/string' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "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

Deleted

application/json
  1. response
ok*boolean
id*string
Example Request
curl -X DELETE 'https://api.letsship.ai/v1/scheduled-tasks/string'
Example Response
{  "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

Runs

application/json
  1. response
data*array<>
nextCursor*string|null
Example Request
curl -X GET 'https://api.letsship.ai/v1/scheduled-tasks/string/runs'
Example Response
{  "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

Dispatched

application/json
  1. response
ok*boolean
runId*string
issueId*string|null
status*ScheduledTaskRunStatus
Value in"dispatching""dispatched""skipped""failed"
Example Request
curl -X POST 'https://api.letsship.ai/v1/scheduled-tasks/string/run'
Example Response
{  "ok": true,  "runId": "string",  "issueId": "string",  "status": "dispatching"}

How is this page?