API Reference

Execute API

Programmatically run bots and tools via the Execute API.

Endpoint

POST /api/v1/execute

Authentication

Include your API key in the Authorization header.

Header
Authorization: Bearer bh_sk_xxxxxxxxxxxxxxxxxxxxx

Request Body

request.json
{
  "botId": "your-bot-id",
  "input": {
    "message": "Explain quantum computing"
  },
  "sessionId": "optional-session-id"
}

Response

response.json
{
  "success": true,
  "output": "Your bot response",
  "transcript": [],
  "variables": {},
  "runId": "run_abc123",
  "sessionId": "optional-session-id"
}

Choosing a bot

Pass the ID of a bot you own, have installed, or can access through a workspace. The endpoint runs that bot's HiveLang code with the supplied input and its configured capabilities.

Example: cURL

Terminal
curl -X POST https://bothive.cloud/api/v1/execute \
  -H "Authorization: Bearer bh_sk_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{"botId": "your-bot-id", "input": {"message": "Hello"}}'

How helpful was this page?

Not helpfulExcellent