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

# update_group

> Rename a group, declare its whole membership in one call, or both. Missing rows are removed, so send the full set to keep.

Rename a group, set who is in it, or both in one call.

Pass at least one of `name`, `key` or `attributions` — a call with none of
them has nothing to update.

`attributions` is the group's **whole** membership, not an addition to it:
whoever the list leaves out is taken out of the group. Read the group with
[`get_group`](/mcp_documentation/tools/get_group) first and send back every
member to keep, or the ones missing from your list are removed. Omitting the
argument leaves the membership untouched, so a rename alone is safe; passing
an empty list empties the group. Declaring a membership that already matches
changes nothing, so the same call can be sent twice. Removing a membership
needs the delete permission on groups, as it does in the web app.

Only what actually changed comes back in `attribution_changes`, each row
saying whether it was created, moved, or removed.

A membership change here recalculates the statements of the users it affects,
on the live environment, wherever the group is attributed to a plan — their
statements move to `NEED_REFRESH` and are recalculated in the background. A
call that changes nothing triggers no refresh. Renaming propagates too: the
group reads under its new name on every statement and in every report that
breaks down by its dimension.

Available only where the Qobra write tools beta is enabled. Every write to
the live environment is recorded in the audit trail as the `Qobra MCP` agent;
writes to a sandbox are not audited.

## Parameters

<Accordion title="Body" defaultOpen>
  <ParamField body="group_id" type="string" required>
    Id of the group to update — the id list\_groups returns, or the one
    create\_group just returned.
  </ParamField>

  <ParamField body="name" type="string">
    New display name for the group. Omit to leave the current name as it
    is.
  </ParamField>

  <ParamField body="key" type="string">
    New stable key for the group — the identifier an integration matches
    it on, distinct from the display name. Omit to leave the current key
    as it is.
  </ParamField>

  <ParamField body="attributions" type="object[]">
    Who is in the group, as the complete list — every user, each with the
    months they belong for. This replaces the group's membership rather
    than adding to it: anyone missing from the list is taken out of the
    group. Omit the argument to leave the membership untouched; pass an
    empty list to empty the group. Send one row per continuous stretch,
    with no month covered twice for the same user.

    <Expandable title="object properties">
      <ParamField body="user_id" type="string" required>
        Id of the user in the group — the id a user reference carries.
      </ParamField>

      <ParamField body="start_period" type="string" required>
        YYYY-MM; the first month this membership covers.
      </ParamField>

      <ParamField body="end_period" type="string">
        YYYY-MM; the last month it covers, included. Omit it for a
        membership that stays open with no end.
      </ParamField>
    </Expandable>
  </ParamField>
</Accordion>

## Response

<Accordion title="Body" defaultOpen>
  <ResponseField name="group" type="object">
    The group as it now stands after the update.

    <Expandable title="object properties">
      <ResponseField name="id" type="string" />

      <ResponseField name="resource_url" type="string">
        Deep link to open this group in the Qobra web app.
      </ResponseField>

      <ResponseField name="name" type="string" />

      <ResponseField name="key" type="string">
        The group's stable key — the identifier used to match it when
        synced from an integration, distinct from its display name.
      </ResponseField>

      <ResponseField name="dimension" type="object">
        The dimension the group belongs to (the kind of grouping, e.g.
        'Country' or 'Team'). Null if the dimension is unknown.

        <Expandable title="object properties">
          <ResponseField name="id" type="string" />

          <ResponseField name="name" type="string" />
        </Expandable>
      </ResponseField>

      <ResponseField name="archived" type="boolean" />

      <ResponseField name="member_count" type="integer">
        Number of users currently in the group (attributions active as of
        today). Past and future members are excluded.
      </ResponseField>
    </Expandable>
  </ResponseField>

  <ResponseField name="attribution_changes" type="object[]">
    Every membership the call actually changed — created, moved, or
    removed because the declared list no longer held it. Empty when the
    call only renamed the group, and empty when the declared membership
    already matched what the group had, which is how a repeated call
    reads as the no-op it was.

    <Expandable title="object properties">
      <ResponseField name="action" type="string">
        `created` for a membership this call added; `moved` for one that
        already existed and had its dates changed, the row showing the
        new ones; `removed` for one the declared set no longer holds.
      </ResponseField>

      <ResponseField name="member" type="object">
        The membership as it now stands — its last state before removal
        for a "removed" row, since the user is no longer in the group.

        <Expandable title="object properties">
          <ResponseField name="user" type="object">
            <Expandable title="object properties">
              <ResponseField name="id" type="string" />

              <ResponseField name="email" type="string" />

              <ResponseField name="name" type="string" />
            </Expandable>
          </ResponseField>

          <ResponseField name="arrival_date" type="string" />

          <ResponseField name="departure_date" type="string" />
        </Expandable>
      </ResponseField>
    </Expandable>
  </ResponseField>
</Accordion>
