Schedules & documents
Schedules
Run a bot on its own, once or on a repeating schedule.
http
POST /bots/{botId}/schedules
x-lex-client: my-app
Content-Type: application/json
{
"name": "Monday sales digest",
"taskInput": "Summarise last week's deals from Gmail and post the top 5.",
"scheduleType": "cron",
"scheduleValue": "0 8 * * 1",
"timezone": "Asia/Jakarta",
"approvalPolicy": "require",
"mode": "patih"
}scheduleType | scheduleValue |
|---|---|
once | A date and time, e.g. 2026-11-01T09:00 (in timezone) or with an offset |
interval | Seconds between runs, at least 300 |
cron | A cron expression that fires at most every 5 minutes |
Other options: timeoutSeconds (30–3600, default 300), maxRetries (0–5), misfirePolicy (run_once or skip for runs missed while paused or down) and approvalPolicy. Nobody is watching a scheduled run, so with deny any action that would need approval is skipped instead of waiting.
GET /schedules, GET /schedules/calendar | All schedules, or upcoming runs for a calendar |
PATCH /schedules/{id}, DELETE /schedules/{id} | Change or remove |
POST /schedules/{id}/pause, /resume, /run-now, /duplicate | Control it |
GET /scheduled-runs, GET /scheduled-runs/{id} | What ran, with the agent run behind each |
POST /scheduled-runs/{id}/retry | Run a failed one again |
Each scheduled run posts its result into the bot's chat.
Documents
Bots can write documents (reports, drafts, notes), and people can edit them.
GET /documents, POST /documents | List and create |
GET/PATCH/DELETE /documents/{id} | Read, edit, delete |
GET /documents/{id}/versions | Every saved version (by a person, a bot or a restore) |
POST /documents/{id}/versions/{version}/restore | Go back to a version |
POST /documents/{id}/duplicate | Copy |
GET /documents/{id}/export?format=markdown | Download as Markdown |
GET/POST /document-folders | Folders |
Documents a bot writes in a chat keep a link to the bot and the run that made them.
