0

Update board

by
Published Oct 17, 2025

Updates a specific board.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
 * Update board
7
 * Updates a specific board.Required scope boards:write Rate limiting Level 2
8
 */
9
export async function main(
10
  auth: Miro,
11
  board_id: string,
12
  body: {
13
    description?: string;
14
    name?: string;
15
    policy?: {
16
      permissionsPolicy?: {
17
        collaborationToolsStartAccess?:
18
          | "all_editors"
19
          | "board_owners_and_coowners";
20
        copyAccess?: "anyone" | "team_members" | "team_editors" | "board_owner";
21
        sharingAccess?:
22
          | "team_members_with_editing_rights"
23
          | "owner_and_coowners";
24
      };
25
      sharingPolicy?: {
26
        access?: "private" | "view" | "edit" | "comment";
27
        inviteToAccountAndBoardLinkAccess?:
28
          | "viewer"
29
          | "commenter"
30
          | "editor"
31
          | "no_access";
32
        organizationAccess?: "private" | "view" | "edit" | "comment";
33
        teamAccess?: "private" | "view" | "edit" | "comment";
34
      };
35
    };
36
    teamId?: string;
37
    projectId?: string;
38
  },
39
) {
40
  const url = new URL(`https://api.miro.com//v2/boards/${board_id}`);
41

42
  const response = await fetch(url, {
43
    method: "PATCH",
44
    headers: {
45
      "Content-Type": "application/json",
46
      Authorization: "Bearer " + auth.token,
47
    },
48
    body: JSON.stringify(body),
49
  });
50
  if (!response.ok) {
51
    const text = await response.text();
52
    throw new Error(`${response.status} ${text}`);
53
  }
54
  return await response.json();
55
}
56