public function getConversations(
        $userId = false,
        $limit = 20,
        $offset = 0,
        $closed = null,
        $assigned = null,
        $tags = []
    ) {
        $params = [
            'count' => $limit,
            'after' => $offset
        ];

        if ($userId) {
            $data = $this->call('users/' . $this->appId . '/conversations', $params, 'get');
        } else {
            if ($closed !== null) {
                $params['closed'] = (bool)$closed;
            }
            if ($assigned !== null) {
                $params['assigned'] = (int)$assigned;
            }
            if ($tags) {
                $params['tags'] = implode(',', $tags);
            }

            $data = $this->call('apps/' . $this->appId . '/conversations', $params, 'get');
        }

        $array = [];
        if ($data) {
            foreach ($data as $msg) {
                $array[] = Conversation::fromResponse($msg);
            }
        }

        return $array;
    }