# User group

`PATCH /workspaces/:workspace/groups/:group_id`

Edits the properties of an existing group

**Required Scopes:** `WORKSPACE`

## URL Parameters

```typescript
interface URLParameters {
  /** The human-readable ID of the workspace */
  workspace: string; // Example: "my-company"
  /** The ID of the group */
  group_id: number; // Example: 123
}
```

## Body Parameters

```typescript
interface BodyParameters {
  /** The name of the group */
  name?: string;
  /** The description of the group */
  description?: string;
  /** Whether to automatically assign group members to new projects */
  auto_assign_to_new_projects?: boolean;
  /** Whether group members are allowed to add new projects */
  allow_add_new_projects?: boolean;
  /** Whether group members are allowed to buy new domains on behalf of the workspace owner */
  allow_add_new_domains_on_owner_behalf?: boolean;
  /** The ID of the permission set to automatically assign to new project members */
  auto_assign_permission_set_id?: number;
}
```

## Response Body

```typescript
interface ResponseBody {
  /** API endpoint to GET this object */
  url?: string;
  /** Web URL to view this object in Buddy.works */
  html_url?: string;
  /** The ID of the group */
  id?: number;
  /** The name of the group */
  name?: string;
  /** The description of the group */
  description?: string;
  /** Whether to automatically assign group members to new projects */
  auto_assign_to_new_projects?: boolean;
  /** Whether group members are allowed to add new projects */
  allow_add_new_projects?: boolean;
  /** Whether group members are allowed to buy new domains on behalf of the workspace owner */
  allow_add_new_domains_on_owner_behalf?: boolean;
  /** The ID of the permission set to automatically assign to new project members */
  auto_assign_permission_set_id?: number;
}
```

## Request Example

```bash
curl -X PATCH "https://api.buddy.works/workspaces/:workspace/groups/:group_id" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "senior-developers",
  "description": "Senior development team members",
  "auto_assign_to_new_projects": false,
  "allow_add_new_projects": true,
  "allow_add_new_domains_on_owner_behalf": true,
  "auto_assign_permission_set_id": 2
}'
```

## Response Example

**Status:** `200 OK`

```json
{
  "url": "https://api.buddy.works/workspaces/my-workspace/groups/123",
  "html_url": "https://app.buddy.works/my-workspace/-/group/123",
  "id": 123,
  "name": "developers",
  "description": "Development team members",
  "auto_assign_to_new_projects": true,
  "allow_add_new_projects": false,
  "allow_add_new_domains_on_owner_behalf": false,
  "auto_assign_permission_set_id": 1
}
```

---
Original source: https://buddy.works/docs/api/platform/groups/edit/user-group