Overview
The Heartbeat API lets you programmatically create, manage, and monitor autonomous agent schedules. Agents with heartbeat enabled run on a timer, execute prompts, use connected tools, and can notify users — all without human interaction.Before using the Heartbeat API, the bot must have heartbeat enabled. Set
heartbeat: true via the Bot Management API update endpoint.Configure a Heartbeat
Create or update a heartbeat configuration for a bot.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | Yes | Project UUID |
bot_id | string | Yes | Bot UUID |
prompt | string | Yes | The instruction the agent executes each run |
interval_minutes | number | No | How often the agent runs in minutes (default: 30) |
enabled | boolean | No | Whether the heartbeat is active (default: false) |
active_hours_start | string | No | Start of active window in HH:MM format |
active_hours_end | string | No | End of active window in HH:MM format |
active_days | string | No | Comma-separated days 1-7 (1=Monday) |
timezone | string | No | Timezone for active hours (default: UTC) |
credit_budget | number | No | Max credits per billing period (null = unlimited) |
max_consecutive_errors | number | No | Auto-pause after this many consecutive failures (default: 5) |
member_id | string | No | Subscriber member ID (for subscriber-specific heartbeats) |
Example
Response
List Heartbeats
Get all heartbeat configurations for a bot.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | Yes | Project UUID |
bot_id | string | Yes | Bot UUID |
member_id | string | No | Filter by subscriber member ID |
Response
Get a Heartbeat
Get a single heartbeat configuration by its UUID.Enable a Heartbeat
Activate a heartbeat so it starts running on its schedule.Disable a Heartbeat
Pause a heartbeat without deleting its configuration.Trigger a Heartbeat
Manually trigger a single heartbeat execution for testing. The heartbeat does not need to be enabled.Response
Delete a Heartbeat
Permanently delete a heartbeat configuration and remove its scheduled job.Get Execution Logs
Retrieve the execution history for a bot’s heartbeats.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | Yes | Project UUID |
bot_id | string | Yes | Bot UUID |
heartbeat_id | string | No | Filter by specific heartbeat UUID |
member_id | string | No | Filter by subscriber |
status | string | No | Filter by status: success, error, skipped |
page | number | No | Page number (default: 1) |
per_page | number | No | Results per page (default: 20) |
Response
Get Execution Stats
Get aggregated statistics for a bot’s heartbeat executions.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | Yes | Project UUID |
bot_id | string | Yes | Bot UUID |
days | number | No | Number of days to aggregate (default: 30) |
Response
Error Codes
| Code | Description |
|---|---|
| 400 | Invalid parameters (e.g., interval below plan minimum) |
| 403 | Heartbeat not enabled for this bot, or plan doesn’t support heartbeat |
| 404 | Heartbeat not found |