Schedules
Endpoints for managing scheduled chat execution.
GET /api/chats/{id}/schedule
Retrieve the scheduled job configuration for a chat.
Authentication: Required (session)
Pre-blocks: chat.lookup
Response:
{
"id": "job-123",
"chatId": "chat-456",
"interval": "daily",
"startOn": "2024-01-20T09:00:00Z",
"endOn": "2024-12-31T23:59:59Z",
"alert": true,
"enabled": true,
"lastRun": "2024-01-19T09:00:00Z",
"nextRun": "2024-01-20T09:00:00Z"
}
PUT /api/chats/{id}/schedule
Create or update a scheduled job for a chat.
Authentication: Required (session)
Pre-blocks: chat.lookup
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
interval | string | Yes | Schedule interval: hourly, daily, weekly, monthly |
startOn | date | Yes | When to start the schedule |
endOn | date | No | When to end the schedule (null for indefinite) |
alert | boolean | No | Send alerts on completion (default: false) |
enabled | boolean | No | Whether the schedule is active (default: true) |
Example Request:
{
"interval": "daily",
"startOn": "2024-01-20T09:00:00Z",
"endOn": "2024-12-31T23:59:59Z",
"alert": true,
"enabled": true
}
Response:
Returns the created or updated schedule object.
DELETE /api/chats/{id}/schedule
Remove the scheduled job from a chat.
Authentication: Required (session)
Pre-blocks: chat.lookup
Response:
204 No Content
Use Cases
Scheduled chats are useful for:
- Daily report generation
- Periodic data analysis
- Automated monitoring alerts
- Recurring summarization tasks