Integrations·12 min read

Connect Your Own API

Give a bot live access to your backend — your SaaS, your database, your business logic — without handing Bothive any credentials.

Connect Your Own API

Want a bot that answers from your data — orders, accounts, your matching algorithm? Connect your API. Bothive never touches your database; your bot calls your endpoints, and your backend runs the query and enforces your auth.

The model

text
user asks the bot → bot calls your endpoint (e.g. POST /match) → your backend queries your DB → returns result → bot explains it

The security boundary stays where it belongs: your data and rules stay yours.

1. Open Connect API

In the dashboard, go to Integrations → Connect API (/dashboard/integrations/connect-api). You'll describe your API once; Bothive turns it into tools your bots can call.

2. Describe your endpoints

Fill in the guided form:

  • Base URL — e.g. https://api.yourcompany.com.
  • Auth — how to authenticate (e.g. a bearer token). Your token is encrypted at rest and sent only to your endpoints.
  • Endpoints — each becomes a capability, e.g. POST /matchintegration.yourapi.match.

Have an OpenAPI / Swagger spec? Upload it to auto-fill the endpoints.

Design bot-friendly capabilities

Name each action for what the bot should accomplish, not for the raw route name. A bot understands createTicket better than postTickets.

EndpointCapability nameBot should use it when
It needs account context before answering
A human follow-up is needed
A workflow closes or escalates a ticket
The user asks for pricing based on inputs

3. Use it in a bot

Once saved, your integration shows up as tools named integration.<slug>.<capability>. Declare them in a bot's capabilities and call them like any tool:

hivelang
bot Matchmaker { instructions { Help users find their best match using our API. } capabilities { integration.yourapi.match } on user.message { call integration.yourapi.match with { query: input } as result respond with "Here's your best match: " + result } }

They also appear automatically as App nodes in the Orchestrator, so workflows can call your API too.

Test with safe inputs

Before giving the integration to production users:

  1. Run each capability from the integration tester.
  2. Confirm failed auth returns a clear error, not a generic 500.
  3. Try missing or invalid inputs.
  4. For write actions, test in a sandbox account first.
  5. Open Live Logs and confirm the trace redacts tokens and sensitive fields.

Example endpoint contract

Your endpoint should return simple JSON. Keep the response shape stable so bots and workflows can rely on it.

http
POST /tickets Authorization: Bearer YOUR_API_TOKEN Content-Type: application/json
json
{ "subject": "Refund request", "customerEmail": "ada@example.com", "priority": "normal" }
json
{ "ticketId": "tic_123", "status": "created", "url": "https://app.example.com/tickets/tic_123" }

Why it's secure

  • Bothive never connects to your database — only to the endpoints you list.
  • Your token is encrypted and per-user.
  • Outbound calls are SSRF-guarded (no internal/metadata IPs).
  • Your backend still owns authorization. If a user should not see a record, your API should reject the request.

Common errors

ErrorUsually meansFix
The saved token is missing or expiredReconnect the integration
Your API rejected the user's permissionCheck the account/workspace mapping
The route or record was not foundConfirm base URL and path params
Required input is missingAdd clearer parameter descriptions
TimeoutEndpoint took too longReturn less data or add pagination

Next steps

Quick tip

Use the test pane to iterate quickly. Every change you make is live — no need to save first.

Important

API keys are shown only once. Store them securely and never commit them to version control.

Best practice

Test your bot with edge cases before deployment. Try empty inputs, long messages, and special characters.

Pro tip

Chain multiple specialized bots in a workflow for better results than one general-purpose bot.

Connect Your Own API