client.groups.list

A method of the Groups endpoint.

list(*, query: str = None, permission: str = None, include_members: bool = None, organization_id: int = None, user_ids: List[int] = None, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None) ListResponse | PaginatedResponse

List Groups

API URL: GET /groups

import civis
client = civis.APIClient()
response = client.groups.list(...)
Parameters:
querystr, optional

If specified, it will filter the groups returned.

permissionstr, optional

A permissions string, one of “read”, “write”, or “manage”. Lists only groups for which the current user has that permission.

include_membersbool, optional

Show members of the group.

organization_idint, optional

The organization by which to filter groups.

user_idsList[int], optional

A list of user IDs to filter groups by.Groups will be returned if any of the users is a member

limitint, optional

Number of results to return. Defaults to 50. Maximum allowed is 1000.

page_numint, optional

Page number of the results to return. Defaults to the first page, 1.

orderstr, optional

The field on which to order the result set. Defaults to name. Must be one of: name, created_at.

order_dirstr, optional

Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.

iteratorbool, optional

If True, return a generator (specifically, a civis.PaginatedResponse object) to iterate over all responses. Use it when more results than the maximum allowed by ‘limit’ are needed. When True, ‘page_num’ is ignored. If False, return a civis.ListResponse object (= a list of civis.Response objects), whose size is determined by ‘limit’. Defaults to False.

Returns:
civis.ListResponse | civis.PaginatedResponse
  • idint

    The ID of this group.

  • namestr

    This group’s name.

  • created_atstr (time)

    The date and time when this group was created.

  • updated_atstr (time)

    The date and time when this group was last updated.

  • descriptionstr

    The description of the group.

  • slugstr

    The slug for this group.

  • organization_idint

    The ID of the organization this group belongs to.

  • organization_namestr

    The name of the organization this group belongs to.

  • member_countint

    The number of active members in this group.

  • total_member_countint

    The total number of members in this group.

  • last_updated_by_idint

    The ID of the user who last updated this group.

  • created_by_idint

    The ID of the user who created this group.

  • membersList[civis.Response]

    The members of this group.

    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.