> ## Documentation Index
> Fetch the complete documentation index at: https://help.statisfy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Rename a group or set its members

> Renames a group, replaces its members, or both, and returns it with its members. Admins only (users:update), as in the app. A role or department group is kept by the app and is refused (409). Members are teammates with a Statisfy login, as /v1/objects/user/records ids them; any other id is refused (422). A name another group has or reads as is refused (409). The name and the members change together or not at all. To add or remove a few members, POST /v1/groups/{group_id}/members or DELETE /v1/groups/{group_id}/members/{user_id}.



## OpenAPI

````yaml /api/statisfy-api.openapi.json patch /v1/groups/{group_id}
openapi: 3.1.0
info:
  description: >-
    The agent-first Statisfy API. Authenticate with an API key (`Authorization:
    Bearer stfy_live_…`), then call `GET /v1/meta/capabilities` to discover
    every operation and its schemas.
  title: Statisfy API
  version: 1.0.0
servers:
  - url: https://api.statisfy.com
    description: Production
security: []
paths:
  /v1/groups/{group_id}:
    patch:
      tags:
        - groups
      summary: Rename a group or set its members
      description: >-
        Renames a group, replaces its members, or both, and returns it with its
        members. Admins only (users:update), as in the app. A role or department
        group is kept by the app and is refused (409). Members are teammates
        with a Statisfy login, as /v1/objects/user/records ids them; any other
        id is refused (422). A name another group has or reads as is refused
        (409). The name and the members change together or not at all. To add or
        remove a few members, POST /v1/groups/{group_id}/members or DELETE
        /v1/groups/{group_id}/members/{user_id}.
      operationId: groups_update
      parameters:
        - description: The group's id, from GET /v1/groups
          in: path
          name: group_id
          required: true
          schema:
            maxLength: 64
            minLength: 1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                member_ids:
                  anyOf:
                    - items:
                        maxLength: 128
                        minLength: 1
                        type: string
                      maxItems: 1000
                      type: array
                    - type: 'null'
                  default: null
                  description: >-
                    Its users from now on, replacing the ones it has (an empty
                    list removes them all), as /v1/objects/user/records ids
                    them. Leave it out to keep the members.
                  title: Member Ids
                name:
                  anyOf:
                    - maxLength: 255
                      minLength: 1
                      type: string
                    - type: 'null'
                  default: null
                  description: >-
                    A new name. Refused (409) when another group already has it
                    or reads as it.
                  title: Name
              type: object
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupWithMembers'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    GroupWithMembers:
      properties:
        created_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: When the group was made
          title: Created At
        id:
          description: The group's id
          title: Id
          type: string
        member_count:
          description: The users in the group
          title: Member Count
          type: integer
        members:
          description: The users in the group, in the order they were added
          items:
            $ref: '#/components/schemas/GroupMember'
          title: Members
          type: array
        name:
          description: The group's name, as Settings > Team > Groups shows it
          title: Name
          type: string
        type:
          description: >-
            custom: a group someone made. role or department: the group the app
            keeps for every user with that role or department on their Team page
            record, named after it
          enum:
            - custom
            - role
            - department
          title: Type
          type: string
        updated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: >-
            When the group's name last changed; adding or removing a member
            leaves it as it was
          title: Updated At
      required:
        - id
        - name
        - type
        - member_count
        - created_at
        - updated_at
        - members
      title: GroupWithMembers
      type: object
    GroupMember:
      properties:
        added_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: When the user was added to the group
          title: Added At
        email:
          anyOf:
            - type: string
            - type: 'null'
          description: The user's email
          title: Email
        name:
          anyOf:
            - type: string
            - type: 'null'
          description: The user's name
          title: Name
        user_id:
          description: The user, as /v1/objects/user/records ids it
          title: User Id
          type: string
      required:
        - user_id
        - name
        - email
        - added_at
      title: GroupMember
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http
      description: >-
        An API key, sent as `Authorization: Bearer stfy_live_…`. See
        [Authentication](/rest-api/authentication) for how to get one and which
        scopes it needs.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.