Developer Documentation

BotnFlow API

Build powerful messaging integrations with our REST API. Send messages, receive webhooks, and create custom automations.

Quick Start

Get started with the BotnFlow API in three simple steps:

1

Get API Key

Generate a key in your dashboard

2

Set Up Webhook

Configure your endpoint URL

3

Send Messages

Start sending via our API

Receive Messages (Webhook)

Configure a webhook URL to receive real-time notifications when customers send messages. All channels use a unified format.

{
  "event": "message.inbound",
  "channel": "whatsapp",
  "sender": "+14155238886",
  "timestamp": "2025-01-15T10:30:00Z",
  "payload": {
    "type": "text",
    "text": "Hello, I'd like to know more about your services."
  }
}

Send Messages (REST API)

Send messages to any channel using a simple HTTP POST request. Supports text, images, buttons, and interactive templates.

curl -X POST https://api.botnflow.com/v1/messages \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "recipient": "+14155238886",
    "channel": "whatsapp",
    "message": {
      "type": "text",
      "text": "Hi! Thanks for reaching out. How can I help you today?"
    }
  }'

Example: Webhook Handler

Here's how you might process incoming messages in your application:

// Express.js webhook handler
app.post('/webhook/botnflow', (req, res) => {
  const { event, payload, sender } = req.body;

  if (event === 'message.inbound') {
    // Process incoming message
    const intent = classifyIntent(payload.text);

    if (intent === 'pricing') {
      sendPricingInfo(sender);
    } else {
      createSupportTicket(sender, payload.text);
    }
  }

  res.status(200).send('OK');
});

API Features

RESTful Design: Simple, intuitive endpoints
Webhooks: Real-time event notifications
Rate Limiting: 1000 requests/minute
Authentication: Bearer token auth
All Channels: WhatsApp, Email, SMS, Voice
Rich Messages: Text, media, buttons, templates

Need Help?

Our developer support team is here to help you integrate successfully.