def list_groups(api, instance='', fields='', **params):
    """List all the groups of an instance. If no instance is provided , fetch the customer groups ( = platform feeds in lumapps)

    Args:
        api: the ApiClient instance to use for requests
        instance: the instance id
        fields: the fields to be returned
        ``**params``: optional  dictionary of search parameters as defined in https://api.lumapps.com/docs/feed/list

    Yields:
        a Lumapps Feed resource
    """
    if not params:
        params = dict()
    if instance != '':
        params['instance'] = instance
    if fields != '':
        params['fields'] = fields
    if not params.get('body', None):
        params['body'] = {}
    return api.iter_call('feed', 'search', **params)
