Public APIs

Authorization

All of WotNot's APIs use a Bearer token based authentication.

Your account token can be found at Settings > Account Settings.

Create a knowledge base

POST /v1/ai/knowledge-base

Using this API, you can create a knowledge base in the account.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

{
  "name": "KNOWLEDGE_BASE_NAME"
}

Response

{
    "ok": true,
    "id": KNOWLEDGE_BASE_ID,
    "message": "Knowledge base has been created.",
    "code": "CREATE_KNOWLEDGE_BASE_SUCCESS_MESSAGE"
}

Adding a data source to a knowledge base

POST /api/v1/ai/knowledge-base/<knowledge_base_id>/upload/sources

Using this API, you can add a data source to an existing knowledge base.

Headers

Name
Value

Content-Type

multipart/form-data

Authorization

Bearer <token>

Body

The API accepts files and text as multipart form data for upload. Each form field should be a unique key and contain either a file or text content.

Response

{
  "q1": [
    {
      "id": 330783,
      "type": "text",
      "name": "sample.txt",
      "status": "in-progress",
      "errors": null
    },
    {
      "id": 330784,
      "type": "text",
      "name": "sample2.txt",
      "status": "in-progress",
      "errors": null
    },
    {
      "id": 330785,
      "type": "file",
      "name": "File.pdf",
      "status": "in-progress",
      "errors": null
    }
  ],
  "d2": [
    {
      "id": 330786,
      "type": "file",
      "name": "File2.pdf",
      "status": "in-progress",
      "errors": null
    }
  ],
  "knowledge_base_id": 876,
  "ok": true
}

Get training status of a data source

GET /api/v1/ai/status/sources

Using this API, you can fetch the status of one or more data sources in a knowledge base to know it its training is - in progress / completed / failed.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description

source_ids

query params

Comma-separated list of data source IDs to be passed as query params.

Response

{
    "sources": [
        {
            "id": 330778,
            "name": "sample.txt",
            "status": "in-progress",
            "knowledge_base_id": 876
        }
    ],
    "ok": true
}

Fetch knowledge base details

GET /v1/ai/knowledge-base/<knowledge_base_id>

Using this API, you can fetch knowledge base and it's relevant data sources details.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

{
  "limit": 100,
  "offset": 1
}

Response

{
  "ok": true,
  "id": KNOWLEDGE_BASE_ID,
  "name": "KNOWLEDGE_BASE_NAME",
  "total_tokens": TOTAL_TOKENS_USED_IN_KNOWLEDGE_BASE,
  "total_data_sources": TOTAL_NUMBER_OF_DATA_SOURCES,
  "data_source": [
    {
      "id": DATA_SOURCE_ID,
      "name": "DATA_SOURCE_NAME",
      "source": "DATA_SOURCE_URL_OR_CONTENT",
      "token": TOTAL_TOKENS_USED_IN_DATA_SOURCE,
      "domain_id": DOMAIN_ID,
      "refresh_frequency": null,
      "last_trained_at": "2024-12-27 09:10:11.870000",
      "status": "trained",
      "failed_reason": null,
      "type": "url",
      "created_at": "2024-12-27 09:10:02.411000",
      "created_by": USER_ID,
      "user_name": "USER_NAME"
    }
  ],
  "domains": [],
  "pagination": {
    "limit": 100,
    "offset": 1,
    "total": TOTAL_NUMBER_OF_DATA_SOURCES
  },
  "last_trained_at": "2024-12-27 09:13:26.905000"
}

Creating a conversation

POST /v1/conversations

Using this endpoint, you can start/create a new conversation.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Contains the message payload. Payload differs based on channel.

{
   "channel": "WHATSAPP",
   "from": "1123123123",
   "to": {
       "phone": "11231231230",
       "name": "John Doe",
       "email": "[email protected]"
   },
   "message": {
       "type": "template",
       "data": {
           "template": "test_template",
           "parameters": {
               "header": [
                   "John"
               ],
               "body": [
                   "Doe",
                   "Doe2"
               ],
               "buttons": {
                   "copy_code": "123456",
                   "otp": "123456",
                   "url": "any"
               }
           },
           "variables":{
               "name": "John Doe"
           }
       }
   },
   "assignee": "[email protected]"
}

Response

{
  "ok": true,
  "conversation": {
    "id": "12wfegrgt4t",
    "message_id": "sdvgret4353b",
    "created_at": "",
    "assignee": {
      "id": 123,
      "to": "[email protected]"
    }
  },
  "contact": {
    "id": "11111111",
    "name": "John Doe",
    "phone": "1234567890",
    "email": "[email protected]"
  }
}

Send agent response to a conversation

POST /api/v1/conversation/<conversation_id>/messages

For every response sent by the agent on the third-party system, this API is to be invoked so it can relay this response to the user.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

{
  "message": {
    "data": {
      "body": "Hi"
    },
    "type": "text"
  },
  "user": {
    "by": "[email protected]"
  }
}

Response

{
  "ok": true,
  "message_id": "6HRBshHEcV8P103039226478taGDJQxC"
}

Closing a conversation

POST /api/v1/conversation/<conversation_id>/events

Use this endpoint to close an open conversation.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

{
  "event": "status",
  "status": "CLOSE",
  "user": {
    "by": "[email protected]"
  }
}

Response

{
  "ok": true
}

Changing assignee in a conversation

POST /api/v1/conversation/<conversation_id>/events

Use this endpoint to change the assignee in an open conversation.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

// Change from assignee to assignee
{
  "event": "assignee",
  "user": {
    "by": "[email protected]",
    "to": "[email protected]"
  }
}

// Change from assignee to team
{
  "event": "assignee",
  "team": {
    "by": "[email protected]",
    "to": "Sales"
  }
}

Response

{
  "ok": true
}

Update variable of a conversation

POST /v1/accounts/<account_id>/conversations/<conversation_id>/variables

Use this endpoint to update the variables in the conversation.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

{
  "variables": [
    {
      "name": "name",
      "type": "conversation",
      "value": "John Doe"
    },
    {
      "name": "phone",
      "type": "contact",
      "value": "9999999999"
    },
    {
      "name": "company",
      "type": "conversation",
      "value": "Example"
    },
    {
      "name": "email",
      "type": "contact",
      "value": "[email protected]"
    }
  ]
}

Response

{
  "ok": true
}

Set webhook URL for Events feature

POST /v1/accounts/<account_id>/webhook

Use this endpoint to set webhook for receiving conversation related events from the account.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

{
  "webhook_url": "",
  "subscribed_events": [
    {
      "key": "conversation_create",
      "is_subscribed": true
    },
    {
      "key": "message",
      "is_subscribed": true
    },
    {
      "key": "status",
      "is_subscribed": true
    },
    {
      "key": "assignee_change",
      "is_subscribed": true
    },
    {
      "key": "sla_breached",
      "is_subscribed": true
    },
    {
      "key": "variables",
      "is_subscribed": true
    },
    {
      "key": "conversation_labels",
      "is_subscribed": true
    },
    {
      "key": "note",
      "is_subscribed": true
    }
  ],
  "is_enabled": true,
  "token": "Test"
}

Response

{
  "ok": true
}

Create a bot

POST /v1/bot

Using this API, you can create a bot in account.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

{
  "name": "BOT_NAME",
  "template_id": REFERENCE_BOT_ID,
  "channel": "API"
}

Response

{
    "ok": true,
    "id": BOT_ID
}

Fetch bot flow

GET /v1/bots/<bot_id>/flow

Using this API, you can fetch bot's flow data.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Response

{
    "ok": true,
    "data": "BOT_FLOW_JSON",
    "is_deployed": true,
    "last_deployed_at": "2025-05-05 10:37:43.128000"
}

Deploy bot flow

POST /v1/bots/<bot_id>/deploy

Using this API, you can deploy the bot flow after modifying it's JSON data.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

{
  "flow_diagram": "BOT_FLOW_JSON"
}

Response

{
    "ok": true,
    "data": "BOT_FLOW_JSON",
    "is_deployed": true,
    "last_deployed_at": "2025-05-05 10:37:43.128000"
}

Fetch Bots List

GET /v1/accounts/<account_id>/bots

Use this endpoint to fetch list of bots available in the account.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Response

{
  "ok": true,
  "bots": [
    {
      "bot_title": "Appointment Booking",
      "channels": [
        {
          "name": "WEB"
        }
      ],
      "is_active": false,
      "bot_key": "7SgQLb4qUbp61059137828254t5QVE0H",
      "last_deployed_at": "2025-01-22 13:26:40.554000",
      "is_inactive_by_system": false,
      "priority": 1,
      "preferred_bot_language": {
        "label": "English",
        "code": "EN"
      },
      "type": "inbound",
      "outbound_type": null,
      "bot_owner": {
        "id": 14764,
        "name": "John Doe"
        "email": "[email protected]"
      }
      "created_at": "2024-02-09 10:59:13.783000",
      "preview_key": "6H7PD4WwTmsU105913782825Zk3KCj3t",
      "bot_id": 9633
    }
  ]
}

Last updated

Was this helpful?