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

# Update user group

> Update an existing user group. Send only the fields you change: an absent field keeps its value, and a null permissions removes the custom list. Only an owner of the organization or an admin may change a group, its permission list included. See [User Groups](https://docs.galtea.ai/concepts/user-group).

> [!WARNING]
>
> You are reading the docs of Galtea 5.14. [Read this page in the latest version](https://docs.galtea.ai/api-reference/user-groups/update-user-group.md).


## OpenAPI

````yaml /v5.14/openapi.json patch /userGroups/{id}
openapi: 3.0.0
info:
  version: 1.0.0
  title: Product Management Service API
  description: API documentation for Product Management Service
  contact:
    name: Galtea AI
servers:
  - url: https://api.galtea.ai
security:
  - bearerAuth: []
tags: []
externalDocs:
  description: Galtea Platform Documentation
  url: https://docs.galtea.ai
paths:
  /userGroups/{id}:
    patch:
      tags:
        - user-groups
      summary: Update user group
      description: >-
        Update an existing user group. Send only the fields you change: an
        absent field keeps its value, and a null permissions removes the custom
        list. Only an owner of the organization or an admin may change a group,
        its permission list included. See [User
        Groups](https://docs.galtea.ai/concepts/user-group).
      operationId: updateUserGroup
      parameters:
        - schema:
            type: string
            description: User group ID
            example: ug_123
          required: true
          description: User group ID
          name: id
          in: path
        - $ref: '#/components/parameters/Prefer'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserGroupUpdate'
      responses:
        '200':
          description: >-
            User group updated successfully. The body is the resource as its GET
            answers it.
          headers:
            Content-Location:
              schema:
                type: string
                description: >-
                  The path of the resource in the body; absent when there is no
                  body
              required: false
              description: >-
                The path of the resource in the body; absent when there is no
                body
            Preference-Applied:
              schema:
                type: string
                enum:
                  - return=minimal
                description: 'Present when the API honored `Prefer: return=minimal`'
              required: false
              description: 'Present when the API honored `Prefer: return=minimal`'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserGroup'
        '204':
          description: >-
            No body: the client sent `Prefer: return=minimal`, or the read after
            the write failed.
          headers:
            Preference-Applied:
              schema:
                type: string
                enum:
                  - return=minimal
                description: 'Present when the API honored `Prefer: return=minimal`'
              required: false
              description: 'Present when the API honored `Prefer: return=minimal`'
        '400':
          description: >-
            The body carries an unknown field, a blank name, or a permission
            list that breaks a rule: an entry that cannot be granted, an action
            without the read of its entity, evaluation.readInference without
            inferenceResult.read, or a non-empty list without product.read. Also
            answered when another group of the organization has the same name
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The caller may not update this user group
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: The user group does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  parameters:
    Prefer:
      schema:
        $ref: '#/components/schemas/Prefer'
      required: false
      description: >-
        Send `return=minimal` to get no body back from a write and skip reading
        the resource: a create answers `201` with only `Location`, and an update
        answers `204`.
      name: Prefer
      in: header
  schemas:
    UserGroupUpdate:
      type: object
      properties:
        name:
          type: string
          example: Example Name
        description:
          type: string
          nullable: true
          example: A description
        allProducts:
          type: boolean
          description: >-
            Grants this group every product of its organization, current and
            future. Wins over explicit product links while set.
          example: false
        permissions:
          type: array
          nullable: true
          items:
            type: string
          description: >-
            The product permissions the group grants on its products, each
            written `entity.action`, sorted. Null means no custom list: the
            group grants every permission its members role allows. An empty list
            grants nothing. A user in several groups may do an action when any
            group that reaches the product lists it, and the role of the user
            still limits what a list can grant. Send null to remove the custom
            list; omit the field to keep it.
          example:
            - product.read
            - analytics.read
      additionalProperties: false
    UserGroup:
      type: object
      properties:
        id:
          type: string
          example: ug_123
        organizationId:
          type: string
          example: org_123
        name:
          type: string
          example: QA Team
        type:
          type: string
          enum:
            - EVALUATOR
          example: EVALUATOR
        description:
          type: string
          nullable: true
          example: Quality assurance team
        createdAt:
          type: string
          format: date-time
        userIds:
          type: array
          items:
            type: string
          example:
            - user_123
        metricIds:
          type: array
          items:
            type: string
          description: >-
            Metrics linked to this group. A READER or HUMAN_EVALUATOR caller
            sees only the linked metrics it can read.
          example:
            - metric_123
        productIds:
          type: array
          items:
            type: string
          description: >-
            Products linked to this group. A MEMBER, READER or HUMAN_EVALUATOR
            caller sees only the linked products it can read.
          example:
            - product_123
        allProducts:
          type: boolean
          description: >-
            Grants this group every product of its organization, current and
            future. Wins over explicit product links while set.
          example: false
        permissions:
          type: array
          nullable: true
          items:
            type: string
          description: >-
            The product permissions the group grants on its products, each
            written `entity.action`, sorted. Null means no custom list: the
            group grants every permission its members role allows. An empty list
            grants nothing. A user in several groups may do an action when any
            group that reaches the product lists it, and the role of the user
            still limits what a list can grant.
          example:
            - product.read
            - analytics.read
        deletedAt:
          type: string
          format: date-time
          nullable: true
    Error:
      type: object
      properties:
        error:
          type: string
          example: Error type
        message:
          type: string
          example: Error message description
    Prefer:
      type: string
      description: >-
        Send `return=minimal` to get no body back from a write and skip reading
        the resource: a create answers `201` with only `Location`, and an update
        answers `204`.
      example: return=minimal
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authorization. Pass your API key in the Authorization header as
        a Bearer token. Both new (`gsk_*`) and legacy (`gsk-`) API keys are
        accepted, e.g. `Authorization: Bearer gsk_...` or `Authorization: Bearer
        gsk-...`.

````

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