---
title: "Update workspace groups"
method: PATCH
path: "/v1/workspaces/groups"
---

# Update workspace groups

`PATCH /v1/workspaces/groups`

Create, update, or delete workspace groups, and add or remove group members.

## Request body

- object — Workspace group actions.
  - `actions` union[], required — The list of actions to perform.
    - union — A workspace group action.
      - object — Create a new group.
        - `action` 'add', required — The action type.
        - `name` string, required — The name of the group.
        - `description` string — A description of the group.
        - `role` union — A workspace role, or null for no default role.
          - 'owner' — Workspace owner.
          - 'admin' — Workspace admin.
          - 'analyst' — Workspace analyst.
          - 'member' — Workspace member.
          - 'guest' — Workspace guest
      - object — Update an existing group.
        - `action` 'update', required — The action type.
        - `group_key` string, required — The unique identifier for the group
        - `name` string — The new name of the group.
        - `description` string — The new description of the group.
        - `role` union — A workspace role, or null for no default role.
          - 'owner' — Workspace owner.
          - 'admin' — Workspace admin.
          - 'analyst' — Workspace analyst.
          - 'member' — Workspace member.
          - 'guest' — Workspace guest
      - object — Delete a group.
        - `action` 'remove', required — The action type.
        - `group_key` string, required — The unique identifier for the group
      - object — Add a member to a group.
        - `action` 'add_member', required — The action type.
        - `group_key` string, required — The unique identifier for the group
        - `member` string, required — The email address or unique identifier for the user
      - object — Remove a member from a group.
        - `action` 'remove_member', required — The action type.
        - `group_key` string, required — The unique identifier for the group
        - `member` string, required — The email address or unique identifier for the user

## Response `200`

Successful response

- object — Base response envelope for all successful API responses.
  - `success` true, required
  - `request_id` string, required
  - `result` object, required — The updated list of workspace groups.
    - `groups` object[], required — All workspace groups after the changes are applied.
      - `key` string, required — The unique identifier for the group
      - `name` string, required — The name of the group.
      - `description` string, required — A description of the group.
      - `role` union, required — The default workspace role granted to all members of this group. Null if no default role is set.
        - 'owner' — Workspace owner.
        - 'admin' — Workspace admin.
        - 'analyst' — Workspace analyst.
        - 'member' — Workspace member.
        - 'guest' — Workspace guest
      - `created_at` string, date-time, required — An ISO 8601 date-time string.
      - `member_keys` string[], required — The identifiers of the members of this group.

## Other responses

- `4XX` — Client error. Possible status codes include: 400 (invalid request), 401 (missing or invalid API key), 403 (insufficient permissions), 404 (resource not found), 429 (rate limit exceeded).
- `5XX` — Internal server error.

---

[API](https://skmtc.dev/count/apis/count-public-api.md) · [All operations](https://skmtc.dev/count/apis/count-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/count/count-public-api/revisions/8bfa1b92c91d/schema)
