SmsPort Docs / WhatsApp

Bot Builder / API

API Map

Real endpoint structure for visual bot lifecycle: catalog, draft graph, publish, simulator, and executions.

Base URL

http
https://api.smsport.in/api

Save Graph Required Shape

text
Required top-level fields:
- startNodeId
- nodes[]
- edges[]
- triggers[]
- variables[]

Optional:
- schemaVersion

Core Endpoints

http
GET    /api/bot-builder/catalog
GET    /api/bot-builder/templates
GET    /api/bot-builder
POST   /api/bot-builder
GET    /api/bot-builder/:botId
PATCH  /api/bot-builder/:botId
DELETE /api/bot-builder/:botId
PUT    /api/bot-builder/:botId/draft/graph
POST   /api/bot-builder/:botId/publish
POST   /api/bot-builder/:botId/unpublish
POST   /api/bot-builder/:botId/test/simulator
GET    /api/bot-builder/:botId/executions

Runtime Ops Endpoints

http
POST   /api/bot-builder/:botId/test/simulator
GET    /api/bot-builder/:botId/test-scenarios
POST   /api/bot-builder/:botId/test-scenarios
PATCH  /api/bot-builder/:botId/test-scenarios/:scenarioId
DELETE /api/bot-builder/:botId/test-scenarios/:scenarioId
POST   /api/bot-builder/:botId/test-scenarios/:scenarioId/run
GET    /api/bot-builder/:botId/executions
GET    /api/bot-builder/:botId/executions/:executionId
POST   /api/bot-builder/:botId/executions/:executionId/actions

Example: Save Draft Graph

bash
curl -X PUT "https://api.smsport.in/api/bot-builder/<BOT_ID>/draft/graph" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "schemaVersion": 1,
    "startNodeId": "node_welcome",
    "nodes": [
      {
        "id": "node_welcome",
        "type": "send_text",
        "groupKey": "send_message",
        "position": { "x": 160, "y": 120 },
        "config": { "message": "Welcome" }
      },
      {
        "id": "node_end",
        "type": "end",
        "groupKey": "logic_utilities",
        "position": { "x": 460, "y": 120 },
        "config": {}
      }
    ],
    "edges": [
      {
        "id": "edge_welcome_end",
        "sourceNodeId": "node_welcome",
        "targetNodeId": "node_end",
        "sourceHandle": null,
        "label": null,
        "conditionValue": null,
        "sortOrder": 0
      }
    ],
    "triggers": [
      {
        "id": "trigger_any_message",
        "type": "any_message",
        "matchValue": null,
        "isEnabled": true,
        "sortOrder": 0
      }
    ],
    "variables": []
  }'

Example: Run Simulator

bash
curl -X POST "https://api.smsport.in/api/bot-builder/<BOT_ID>/test/simulator" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "versionTarget": "draft",
    "events": [
      { "eventType": "customer_text", "text": "Hi there" }
    ]
  }'

Common Validation Errors

  • Using data instead of config inside nodes.
  • Missing groupKey or position in node objects.
  • Using simulator payload as scenario.inputs instead of events[].
  • Using execution action resume (not supported).
  • Missing top-level triggers or variables arrays in graph save payload.

Related:

Node reference|Visual builder standard|Simulator docs|Test scenarios docs|Executions docs|Global API reference