Sinatra Docs
API ReferenceRecurring tasks

Create a recurring task

Creates a prompt that starts a task on a schedule.

Any workspace member can create one, and owns what they create: every run starts a task as them, the way a start from this API does, with no repository named. A member can have up to 10 recurring tasks that aren't paused in a workspace. name defaults to the prompt's first line and notifyByEmail to true. Billing and the GitHub connection are checked now and again at every run; a full queue doesn't stop a create.

POST/v1/workspaces/{workspaceId}/recurring-tasks
AuthorizationBearer <token>

A personal access token, which starts with sntr_. Create one on the dashboard's CLI & API page (https://app.sinatra.dev/tokens). It acts as you in every workspace you belong to, with your role in each, and expires after at most 365 days. The CLI's browser sign-in sends an OAuth access token here instead.

In: header

Path Parameters

workspaceIdstring

The workspace's id, from GET /v1/me.

name?string

A short name, up to 200 characters. Defaults to the prompt's first line, cut to 200 characters.

promptstring

What each run asks, as you'd ask a teammate. Each run starts a task whose first message is this prompt under two lines naming the recurring task and the run's time; that message must fit in 100,000 characters.

cadenceobject

When runs start. times holds 1 to 4 different 24-hour HH:MM times, local to timezone. Send exactly one of weekdays, days of the week from 0 (Sunday) to 6 (Saturday), or dayOfMonth, a day from 1 to 28. Every weekday at 9:00 is { "times": ["09:00"], "weekdays": [1, 2, 3, 4, 5] }; the first of each month is { "times": ["09:00"], "dayOfMonth": 1 }.

timezonestring

An IANA time zone, such as America/Chicago. The cadence times are local to it.

notifyByEmail?boolean

Whether the owner gets an email when each run's agent finishes or needs a reply. Defaults to true.

Response Body

curl -X POST "https://api.sinatra.dev/v1/workspaces/string/recurring-tasks" \  -H "Content-Type: application/json" \  -d '{    "prompt": "string",    "cadence": {      "times": [        "string"      ]    },    "timezone": "string"  }'
{
  "task": {
    "id": "string",
    "workspaceId": "string",
    "ownerUserId": "string",
    "name": "string",
    "prompt": "string",
    "cadence": {
      "times": [
        "string"
      ],
      "weekdays": [
        0
      ],
      "dayOfMonth": 1
    },
    "timezone": "string",
    "notifyByEmail": true,
    "nextRunAt": "2019-08-24T14:15:22Z",
    "pausedAt": "2019-08-24T14:15:22Z",
    "pausedReason": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  }
}
{
  "error": "string",
  "reason": "string",
  "requestId": "string",
  "refusal": "string",
  "billingUrl": "string",
  "settingsUrl": "string",
  "plan": "string",
  "running": 0,
  "queued": 0,
  "taskId": "string",
  "messageId": "string"
}
{
  "error": "string",
  "reason": "string",
  "requestId": "string",
  "refusal": "string",
  "billingUrl": "string",
  "settingsUrl": "string",
  "plan": "string",
  "running": 0,
  "queued": 0,
  "taskId": "string",
  "messageId": "string"
}
{
  "error": "string",
  "reason": "string",
  "requestId": "string",
  "refusal": "string",
  "billingUrl": "string",
  "settingsUrl": "string",
  "plan": "string",
  "running": 0,
  "queued": 0,
  "taskId": "string",
  "messageId": "string"
}
{
  "error": "string",
  "reason": "string",
  "requestId": "string",
  "refusal": "string",
  "billingUrl": "string",
  "settingsUrl": "string",
  "plan": "string",
  "running": 0,
  "queued": 0,
  "taskId": "string",
  "messageId": "string"
}
{
  "error": "string",
  "reason": "string",
  "requestId": "string",
  "refusal": "string",
  "billingUrl": "string",
  "settingsUrl": "string",
  "plan": "string",
  "running": 0,
  "queued": 0,
  "taskId": "string",
  "messageId": "string"
}
{
  "error": "string",
  "reason": "string",
  "requestId": "string",
  "refusal": "string",
  "billingUrl": "string",
  "settingsUrl": "string",
  "plan": "string",
  "running": 0,
  "queued": 0,
  "taskId": "string",
  "messageId": "string"
}
{
  "error": "string",
  "reason": "string",
  "requestId": "string",
  "refusal": "string",
  "billingUrl": "string",
  "settingsUrl": "string",
  "plan": "string",
  "running": 0,
  "queued": 0,
  "taskId": "string",
  "messageId": "string"
}
{
  "error": "string",
  "reason": "string",
  "requestId": "string",
  "refusal": "string",
  "billingUrl": "string",
  "settingsUrl": "string",
  "plan": "string",
  "running": 0,
  "queued": 0,
  "taskId": "string",
  "messageId": "string"
}
{
  "error": "string",
  "reason": "string",
  "requestId": "string",
  "refusal": "string",
  "billingUrl": "string",
  "settingsUrl": "string",
  "plan": "string",
  "running": 0,
  "queued": 0,
  "taskId": "string",
  "messageId": "string"
}