/ Platform API
Platform API
    Chat Platform API v3
    Chat Platform API
    Chat Platform API
    Version 3

    Choose events to subscribe

    Copy link

    Chooses for which events your webhook server receives payloads. By subscribing to specific events based on your needs, you can control the number of HTTP requests sent to your webhook server.


    HTTP request

    Copy link
    PUT https://api-{application_id}.sendbird.com/v3/applications/settings/webhook
    

    Request body

    Copy link

    The following table lists the properties of an HTTP request that this action supports.

    Optional
    Property nameTypeDescription

    enabled

    boolean

    Determines whether webhooks are turned on in your Sendbird application. (Default: false)

    url

    string

    Specifies the URL of your webhook server to receive payloads for events.

    include_members

    boolean

    Determines whether to include information about group channel members in payloads. (Default: false)

    enabled_events[]

    array of strings

    Specifies an array of events for your webhook server to subscribe to. If only set to an asterisk (*), the server subscribes to all supported events. If set to an empty array, the server unsubscribes from all events and webhooks are turned off.

    subscribe allsubscribe selectedunsubscribe all
    # Request body example
    {
        "enabled": true,
        "url": "https://example.com/notification",
        "include_members": true,
        "enabled_events": ["*"]
    }
    

    Response

    Copy link

    If successful, this action returns information about the webhook configuration in the response body.

    subscribe allsubscribe selectedunsubscribe all
    # Status: 200 OK
    {
        "webhook": {
            "enabled": true,
            "url": "https://example.com/notification",
            "include_members": false,
            "enabled_events": [
                "open_channel:create",
                "open_channel:remove"",
                ...
                "group_channel:create",
                "group_channel:changed",
                ...
                "user:block",
                ...
                "image_moderation:block"
            ]
        }
    }
    

    In the case of an error, an error object is returned. A detailed list of error codes is available here.