hooks

Create Hook

Creates a new webhook that listens for specific events. Supports optional association with a chat.

post/hooks

Request body

namestring required

A human-readable name for the hook.

eventsstring[] required

List of event types the hook should subscribe to.

chatIdstring

The ID of a chat to scope the hook to.

urlstring uri required

The target URL to receive the webhook payloads.

Response

Success

idstring required

A unique identifier for the webhook.

object'hook' required

Fixed value identifying this object as a webhook.

namestring required

A user-defined name to label the webhook.

eventsstring[] required

List of event types this webhook is subscribed to.

chatIdstring

Optional ID of the chat that this webhook is scoped to.

urlstring required

Target URL that receives event payloads for this webhook.

Changes