Skip to main content

POST /v1/bots/:id/execute

The Execute API runs a bot with a single prompt and returns a response. Unlike the Chat API, Execute is stateless — no session ID, no conversation history loaded. Each call is independent. Use Execute for:
  • Scheduled automation (daily reports, cron jobs)
  • Background processing (classify this email, summarize this document)
  • One-shot tasks that don’t need memory

Request

Headers

Request body

Response

Response fields

TypeScript example

Scheduled execution example

Run a bot on a schedule from your backend:
If your bot has a schedule block in HiveLang, Bothive handles the cron automatically — you don’t need to set up your own cron job. Use the Execute API only when you need to trigger a run from your own backend on-demand.

Execute vs Chat — when to use each

Fetching the trace

After any Execute call, use the run_id to fetch the full trace:

Next reads

Chat API

Deploy API

Observability