public function setWebhook($url, $eventTypes = null)
    {
        if (null === $eventTypes) {
            $eventTypes = [Type::SUBSCRIBED, Type::CONVERSATION, Type::MESSAGE];
        }
        if (empty($url) || !preg_match('|^https://.*|s', $url)) {
            throw new ApiException('Invalid webhook url: ' . $url);
        }

        return $this->call('set_webhook', [
            'url' => $url,
            'event_types' => $eventTypes,
        ]);
    }