0

Updates a group with new items

by
Published Oct 17, 2025

This endpoint updates an existing group by replacing it entirely with a new group. When the update is made, the original group is completely replaced, and a new group ID is assigned. Required scope boards:write Rate limiting Level 2

Script miro Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Miro = {
3
  token: string;
4
};
5
/**
6
 * Updates a group with new items
7
 * This endpoint updates an existing group by replacing it entirely with a new group.  When the update is made, the original group is completely replaced, and a new group ID is assigned. Required scope boards:write Rate limiting Level 2
8
 */
9
export async function main(
10
  auth: Miro,
11
  board_id: string,
12
  group_id: string,
13
  body: { data?: { items?: string[] } },
14
) {
15
  const url = new URL(
16
    `https://api.miro.com//v2/boards/${board_id}/groups/${group_id}`,
17
  );
18

19
  const response = await fetch(url, {
20
    method: "PUT",
21
    headers: {
22
      "Content-Type": "application/json",
23
      Authorization: "Bearer " + auth.token,
24
    },
25
    body: JSON.stringify(body),
26
  });
27
  if (!response.ok) {
28
    const text = await response.text();
29
    throw new Error(`${response.status} ${text}`);
30
  }
31
  return await response.json();
32
}
33