Events

Subscribe Event Logs

Subscribe to live event logs

post
/v1/event/log/subscribe

Description

Subscribe to receive real-time event logs as they are generated. This endpoint returns a streaming response that continuously delivers events as they occur in your account. The connection remains open until the client closes it or an error occurs.

This is useful for:

  • Real-time monitoring dashboards
  • Live debugging and troubleshooting
  • Building reactive integrations
  • Streaming event data to external systems

For historical event data, use the /event/log/list endpoint instead.

Authorization

ChatBotKit API Secret * Required

HTTP Authorization Scheme: bearer

Request Body * Required

Request Body Schema: application/json

historyLengthinteger

Number of recent historical events to replay before subscribing to live updates. When provided, the subscriber will first receive up to this many recent events that were logged before the subscription started. This is useful for catching up on events that may have occurred during connection setup.

import { ChatBotKit } from '@chatbotkit/sdk'

const cbk = new ChatBotKit({

secret: process.env.CHATBOTKIT_API_KEY!

})

const response = await cbk.event.log.subscribe(

{
"historyLength":"integer"
}
)