Skip to main content

Webhook

Feature Overview

Webhooks allow you to receive HTTP notifications in real time whenever certain events occur in your chatbot system. This is useful for integrating with other systems, tracking usage, or implementing custom business logic.

Use Cases

  • Logging user usage and imposing usage limits.
  • Recording chat history in your own system.

Events

Currently, we support the following events:

  • chat – Triggered when a user sends a message to the chatbot.

How to Use

  1. Configure the Webhook
    Set up your webhook when creating a bot.

  2. Parse the Response
    Payload Format
    When an event occurs, we will send a POST request containing JSON data to your configured Webhook URL.

    • Request Format

      {
      "bot_id": "string",
      "chat_id": "string",
      "role_id": "string",
      "role_variables": "string",
      "question": "string",
      "response": {
      "id": "string",
      "content": "string",
      "created_at": "string"
      }
      }
    • Request Headers

      Content-Type: application/json
      User-Agent: AskTable-Webhook

Best Practices

  • Your Webhook handler should return a 2xx status code to acknowledge successful reception.
  • Validate the Webhook source by checking the request headers.
  • Handle duplicate event messages (implement idempotency).

Additional Information

Rate Limits and Retry Strategy

  • In case of a delivery failure, we will retry using an exponential backoff algorithm.
  • Each event will be retried up to 5 times, with waiting intervals of 5s, 10s, 20s, and 40s.