# Group ## Example Group Object ``` { "id": 1, "name": "owners", "admin_ids": [ ], "notes": "", "user_ids": [ ], "usernames": [ ] } ``` * `id` (int64): Group ID * `name` (string): Group name * `admin_ids` (array): List of user IDs who are group administrators (separated by commas) * `notes` (string): Notes about this group * `user_ids` (array): List of user IDs who belong to this group (separated by commas) * `usernames` (array): List of usernames who belong to this group (separated by commas) --- ## List Groups ``` Files::Group.list( page: 1, per_page: 1 ) ``` ### Parameters * `page` (int64): Current page number. * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). * `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves. * `cursor` (string): Send cursor to resume an existing list from the point at which you left off. Get a cursor from an existing list via the X-Files-Cursor-Next header. * `sort_by` (object): If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `active`, `site_id` or `name`. * `filter` (object): If set, return records where the specifiied field is equal to the supplied value. Valid fields are `name`. * `filter_gt` (object): If set, return records where the specifiied field is greater than the supplied value. Valid fields are `name`. * `filter_gteq` (object): If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `name`. * `filter_like` (object): If set, return records where the specifiied field is equal to the supplied value. Valid fields are `name`. * `filter_lt` (object): If set, return records where the specifiied field is less than the supplied value. Valid fields are `name`. * `filter_lteq` (object): If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `name`. * `ids` (string): Comma-separated list of group ids to include in results. --- ## Show Group ``` Files::Group.find(id) ``` ### Parameters * `id` (int64): Required - Group ID. --- ## Create Group ``` Files::Group.create( name: "owners" ) ``` ### Parameters * `name` (string): Group name. * `notes` (string): Group notes. * `user_ids` (string): A list of user ids. If sent as a string, should be comma-delimited. * `admin_ids` (string): A list of group admin user ids. If sent as a string, should be comma-delimited. --- ## Update Group ``` Files::Group.update(id, name: "owners" ) ``` ### Parameters * `id` (int64): Required - Group ID. * `name` (string): Group name. * `notes` (string): Group notes. * `user_ids` (string): A list of user ids. If sent as a string, should be comma-delimited. * `admin_ids` (string): A list of group admin user ids. If sent as a string, should be comma-delimited. --- ## Delete Group ``` Files::Group.delete(id) ``` ### Parameters * `id` (int64): Required - Group ID. --- ## Update Group ``` group = Files::Group.list_for(path).first group.update( name: "owners" ) ``` ### Parameters * `id` (int64): Required - Group ID. * `name` (string): Group name. * `notes` (string): Group notes. * `user_ids` (string): A list of user ids. If sent as a string, should be comma-delimited. * `admin_ids` (string): A list of group admin user ids. If sent as a string, should be comma-delimited. --- ## Delete Group ``` group = Files::Group.list_for(path).first group.delete ``` ### Parameters * `id` (int64): Required - Group ID.