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

    Add an IP to a whitelist

    Copy link

    Adds IP addresses and ranges to your Sendbird application settings. Both currently added and any previously added IPs are granted API access. You can configure the IP whitelist under Settings > Security > Allowed IPs on the Sendbird Dashboard.

    If you specify which IP addresses or ranges to include in the whitelist, any unlisted foreign IP addresses will be denied access. If you don’t specify any IP address or range to include in the whitelist, all IP addresses will be granted API access. You can configure the IP whitelist under Settings > Security > Allowed IPs on the Sendbird Dashboard.


    HTTP request

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

    Request body

    Copy link

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

    Required
    Property nameTypeDescription

    ip_whitelist_addresses[]

    array of strings

    Specifies an array of one or more IP ranges and addresses to add to a whitelist.

    Note: You should add your server’s IP address or range to the IP whitelist when turning on this IP restriction feature. If you don’t, all types of Chat API requests from your server will receive errors from Sendbird server because your server’s IP address or range isn’t allowed an API access.

    {
        "ip_whitelist_addresses": [
            "192.0.0.0/24",
            "192.165.0.0/21"
        ]
    }
    

    Response

    Copy link

    If successful, this action returns a list of all the allowed IP ranges and addresses, including those that have been previously added, in the response body.

    {
        "ip_whitelist_addresses": [
            "160.8.1.0/24",
            "192.0.0.0/24",
            "192.0.2.2/32",
            "192.165.0.0/21",
            "192.168.0.0/28",
            "192.168.100.10/32"
        ]
    }
    

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