## Update

`client.Zones.Groups.Update(ctx, groupID, params) (*Group, error)`

**patch** `/zones/{zoneId}/groups/{groupId}`

Updates a group's name and/or identifier (partial update). A group's source is immutable. The name of a group synced from an external directory cannot be changed while external sync is enabled for the zone; its identifier can.

### Parameters

- `groupID string`

- `params ZoneGroupUpdateParams`

  - `ZoneID param.Field[string]`

    Path param: Zone ID

  - `GroupUpdate param.Field[GroupUpdate]`

    Body param: Schema for updating a group.

### Returns

- `type Group struct{…}`

  A zone-scoped group of users, assignable to roles and usable in policies. Roles assigned to a group are inherited by its members. `external` is false for groups managed in Keycard and true for groups synced from an external directory.

  - `ID string`

    Unique identifier of the group

  - `CreatedAt Time`

    Entity creation timestamp

  - `External bool`

    Whether the group is synced from an external directory. When true the group is directory-owned and its membership is read-only; when false it is managed in Keycard. Read-only: set by external sync, never by the caller.

  - `Identifier string`

    User-specified identifier, unique within the zone. Automatically assigned for groups from an external directory.

  - `Name string`

    Human-readable group name

  - `OrganizationID string`

    Organization this group belongs to

  - `UpdatedAt Time`

    Entity update timestamp

  - `ZoneID string`

    Zone this group belongs to

  - `MemberCount int64`

    Number of users in the group. Included only when requested via `expand[]=member_count` (group get or list).

  - `Roles []string`

    Identifiers of the roles assigned to the group; members inherit them. Deduped across scopes. Included only when requested via `expand[]=roles` (group get or list).

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/keycardai/keycard-go"
  "github.com/keycardai/keycard-go/option"
)

func main() {
  client := keycard.NewClient(
    option.WithAPIKey("My API Key"),
  )
  group, err := client.Zones.Groups.Update(
    context.TODO(),
    "groupId",
    keycard.ZoneGroupUpdateParams{
      ZoneID: "zoneId",
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", group.ID)
}
```
