0

Create board

by
Published Oct 17, 2025

Creates a board with the specified name and sharing policies.Note You can only create up to 3 team boards with the free plan.Required scope boards:write Rate limiting Level 3

Script miro Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Miro = {
3
  token: string;
4
};
5
/**
6
 * Create board
7
 * Creates a board with the specified name and sharing policies.Note You can only create up to 3 team boards with the free plan.Required scope boards:write Rate limiting Level 3
8
 */
9
export async function main(
10
  auth: Miro,
11
  body: {
12
    description?: string;
13
    name?: string;
14
    policy?: {
15
      permissionsPolicy?: {
16
        collaborationToolsStartAccess?:
17
          | "all_editors"
18
          | "board_owners_and_coowners";
19
        copyAccess?: "anyone" | "team_members" | "team_editors" | "board_owner";
20
        sharingAccess?:
21
          | "team_members_with_editing_rights"
22
          | "owner_and_coowners";
23
      };
24
      sharingPolicy?: {
25
        access?: "private" | "view" | "edit" | "comment";
26
        inviteToAccountAndBoardLinkAccess?:
27
          | "viewer"
28
          | "commenter"
29
          | "editor"
30
          | "no_access";
31
        organizationAccess?: "private" | "view" | "edit" | "comment";
32
        teamAccess?: "private" | "view" | "edit" | "comment";
33
      };
34
    };
35
    teamId?: string;
36
    projectId?: string;
37
  },
38
) {
39
  const url = new URL(`https://api.miro.com//v2/boards`);
40

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