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

# Update Domain Group

> Update an existing domain group. Only the fields provided in the request body are changed.

When `entities` is supplied, the same validation rules apply as when creating: at least 2 entities, the primary entity must be a member, entities must not overlap with other groups in the workspace, and the workspace entity limit must not be exceeded.



## OpenAPI

````yaml patch /domain-groups
openapi: 3.1.0
info:
  title: Geogen API
  description: >-
    API for accessing LLM visibility data, managing entities, and tracking AI
    mentions.
  version: 1.0.0
servers:
  - url: https://api.geogen.io/v1
    description: Production server
security:
  - bearerAuth: []
paths:
  /domain-groups:
    patch:
      tags:
        - Domain Groups
      summary: Update Domain Group
      description: >-
        Update an existing domain group. Only the fields provided in the request
        body are changed.


        When `entities` is supplied, the same validation rules apply as when
        creating: at least 2 entities, the primary entity must be a member,
        entities must not overlap with other groups in the workspace, and the
        workspace entity limit must not be exceeded.
      operationId: updateDomainGroup
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - groupId
              properties:
                groupId:
                  type: string
                  description: The ID of the domain group to update.
                name:
                  type: string
                  description: New display name for the group.
                primaryEntity:
                  type: string
                  description: >-
                    New primary entity reference (entityId or entity UUID). Must
                    be present in `entities`.
                entities:
                  type: array
                  minItems: 2
                  items:
                    type: string
                  description: Replacement set of 2+ entity references.
            examples:
              rename_group:
                summary: Rename a group
                value:
                  groupId: jh71abc...
                  name: Acme Worldwide
              add_an_entity:
                summary: Add an entity to the group
                value:
                  groupId: jh71abc...
                  entities:
                    - j5712abc34def56ghij7890klmn
                    - j97def56ghij7890klmn5712abc
                    - 550e8400-e29b-41d4-a716-446655440000
      responses:
        '200':
          description: Domain group updated successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    $ref: '#/components/schemas/DomainGroup'
                  message:
                    type: string
        '400':
          description: Bad request — validation failed (see message).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Domain group not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  retryAfter:
                    type: number
components:
  schemas:
    DomainGroup:
      type: object
      description: >-
        A group of entities that represent the same brand. Analytics for grouped
        entities are merged across all pages and responses.
      properties:
        id:
          type: string
          description: Domain group ID.
        name:
          type: string
          description: Display name for the group.
        primaryEntityUuid:
          type: string
          description: UUID of the entity whose name and favicon represent the group.
        entityTrackingId:
          type: string
          nullable: true
          description: >-
            Optional entity-tracking scope. When set, the group only applies to
            analytics generated under this specific tracking.
        entities:
          type: array
          description: >-
            Entities included in the group. The entity with `isPrimary=true`
            represents the group.
          items:
            $ref: '#/components/schemas/DomainGroupEntity'
        createdAt:
          type: number
          description: Creation timestamp (ms).
        updatedAt:
          type: number
          description: Last update timestamp (ms).
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
    DomainGroupEntity:
      type: object
      description: A single entity inside a domain group, enriched with display data.
      properties:
        entityId:
          type: string
          nullable: true
          description: >-
            Tracking ID for the entity in this workspace (null when the entity
            is not tracked here, e.g. a competitor).
        entityUuid:
          type: string
          description: Stable, system-wide entity UUID.
        name:
          type: string
          nullable: true
          description: Entity display name.
        target:
          type: string
          nullable: true
          description: Entity domain or term.
        faviconUrl:
          type: string
          nullable: true
          description: Favicon URL for the entity, if known.
        isPrimary:
          type: boolean
          description: >-
            Whether this entity is the group's primary entity (its name/favicon
            represent the group).
        inWorkspace:
          type: boolean
          description: Whether this entity is tracked in the current workspace.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'API key authentication. Format: Bearer wsk_your_api_key'

````