Product · Agent SDK & API

Your AI agent,
anywhere you build.

Full REST API and embed SDK. Plug Blaigent's production-grade AI agent into your own app, mobile product, or internal tool — in minutes, not months.

One API. Every channel.

Whether you're embedding a chat widget, automating WhatsApp responses, or building a voice IVR — the same agent logic and memory runs everywhere.

REST API

Send messages, manage conversations, retrieve memory, and control agent config — all via a clean JSON API. Works from any backend language.

Embed widget

Drop a <script> tag into any page and your agent appears as a fully customised chat widget — branded, responsive, and zero-maintenance.

Webhooks

Subscribe to conversation events — new message, handoff requested, order lookup — and trigger your own backend workflows in real time.

Persistent memory

The agent carries context across sessions. Query or write to customer memory via API so nothing gets repeated across any channel.

Knowledge API

Upload documents, FAQs, or product data programmatically. The agent indexes and retrieves relevant context at query time.

Action hooks

Wire the agent to your own backend actions — booking, payment, CRM update — using structured action schemas. No prompt engineering.

Talking to your agent in 3 lines.

Authenticate with your API key, then POST to the chat endpoint. The agent handles intent detection, memory, policy checks, and response generation automatically.

bash
# Send a message to your agent
curl -X POST https://www.blaigent.com/api/v1/agents/customer-service/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Where is my order?",
    "customer_id": "cust_12345",
    "channel": "web",
    "organization_id": "YOUR_ORG_ID"
  }'

# Response
{
  "response": "Hi! Let me look that up for you...",
  "intent": "order_tracking",
  "confidence": 0.97,
  "session_id": "sess_abc123"
}
python
import requests

API_KEY = "YOUR_API_KEY"
ORG_ID  = "YOUR_ORG_ID"
BASE    = "https://www.blaigent.com/api/v1"

response = requests.post(
    f"{BASE}/agents/customer-service/chat",
    headers={"Authorization": f"Bearer {API_KEY}"},
    json={
        "message":       "I need a refund",
        "customer_id":   "cust_12345",
        "channel":       "web",
        "organization_id": ORG_ID,
    }
)

data = response.json()
print(data["response"])   # Agent reply
print(data["intent"])    # Detected intent
javascript
const response = await fetch(
  "https://www.blaigent.com/api/v1/agents/customer-service/chat",
  {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${API_KEY}`,
      "Content-Type":  "application/json",
    },
    body: JSON.stringify({
      message:         "Can I book an appointment?",
      customer_id:     "cust_12345",
      channel:         "web",
      organization_id: ORG_ID,
    }),
  }
);

const data = await response.json();
console.log(data.response);  // Agent reply
html
<!-- Add before </body> — that's all it takes -->
<script
  src="https://www.blaigent.com/static/widget.js"
  data-org="YOUR_ORG_ID"
  data-position="bottom-right"
  data-accent="#6366f1"
  defer
></script>

The widget inherits your brand colors, agent name, and avatar from the dashboard — no extra configuration required.

Core endpoints.

All endpoints return JSON. Authenticate every request with Authorization: Bearer YOUR_API_KEY

Method Path Description
POST /api/v1/agents/customer-service/chat Send a message and receive an agent response
GET /api/v1/platform/conversations List all conversations for your organization
GET /api/v1/platform/conversations/{id}/messages Retrieve full message thread for a conversation
GET /api/v1/platform/analytics/summary Aggregate stats: conversations, resolution rate, CSAT
PATCH /api/v1/dashboard/agent-config Update agent name, tone, goal, and guardrails
POST /api/v1/dashboard/knowledge Upload a file or URL to the knowledge base
DELETE /api/v1/dashboard/knowledge/{id} Remove a document from the knowledge base
GET /api/v1/platform/inbox Fetch open conversations for human handoff

React to anything your agent does.

Register a webhook URL in your dashboard and Blaigent will POST a signed event payload every time something happens in a conversation.

  • New message received from a customer
  • Agent triggers a handoff to human
  • Action executed (booking, refund, order lookup)
  • Conversation closed or resolved
  • CSAT rating submitted by customer
  • Knowledge base updated
json — event payload
{
  "event": "message.received",
  "timestamp": "2026-03-11T14:22:00Z",
  "organization_id": "org_xyz",
  "data": {
    "conversation_id": "conv_abc",
    "customer_id": "cust_12345",
    "channel": "whatsapp",
    "message": "Where is my order?",
    "intent": "order_tracking",
    "agent_response": "I'm looking that up..."
  },
  "signature": "sha256=abc..."
}

Deploy once. Reach everywhere.

The same API key and organization config drives agents across every channel. Memory and history are shared — customers never repeat themselves.

Web widget

Embed on any website or SPA. Fully customisable.

WhatsApp

Via Twilio or Meta Cloud API. Rich media supported.

Email

Inbound email via Mailgun. Agent replies inline.

Voice / IVR

Twilio Voice. STT → agent → TTS pipeline.

SMS

Twilio SMS. Same agent, condensed responses.

Instagram DM

Meta Messenger API. Story replies and DMs.

Full request reference.

Field Type Required Description
message string required The customer's message text
customer_id string required Unique identifier for the customer (your own ID system)
organization_id string required Your organization ID from the dashboard
channel string optional Channel hint: web, whatsapp, sms, email, voice
session_id string optional Resume a previous conversation thread. Omit to start fresh.
language string optional ISO 639-1 language code. Auto-detected if omitted.
metadata object optional Arbitrary key-value pairs forwarded to action hooks and webhooks

Authentication

Every request requires a Bearer token in the Authorization header. Get your API key from Dashboard → Settings → API Keys. Keys are scoped to one organization and can be rotated at any time.

Rate limits

Limits vary by plan. Starter: 60 req/min. Growth: 300 req/min. Scale and Enterprise: custom. All limits are per organization. Exceeding returns 429 Too Many Requests.

Errors

All errors return a JSON body with {"detail": "..."}. HTTP status codes follow standard conventions: 400 bad input, 401 auth, 429 rate limit, 5xx server.

Versioning

The API is versioned via the URL path (/api/v1/). Breaking changes are always introduced in a new version with a migration period of at least 6 months.

Ready to build?

Create your account to get an API key. Free tier includes 250 conversations/month — no credit card required.

Get your API key →