//native
type Miro = {
token: string;
};
/**
* Update team settings
* Updates team settings of an existing team.Required scope organizations:teams:write Rate limiting Level 2 Enterprise only This API is available only for Enterprise plan users. You can only use this endpoint if you have the role of a Company Admin. You can request temporary access to Enterprise APIs using this form.
*/
export async function main(
auth: Miro,
org_id: string,
team_id: string,
body: {
teamAccountDiscoverySettings?: {
accountDiscovery?: "hidden" | "request" | "join";
};
teamCollaborationSettings?: { coOwnerRole?: "enabled" | "disabled" };
teamCopyAccessLevelSettings?: {
copyAccessLevel?:
| "anyone"
| "team_members"
| "team_editors"
| "board_owner";
copyAccessLevelLimitation?: "anyone" | "team_members";
};
teamInvitationSettings?: {
inviteExternalUsers?: "allowed" | "not_allowed";
whoCanInvite?: "only_org_admins" | "admins" | "all_members";
};
teamSharingPolicySettings?: {
allowListedDomains?: string[];
createAssetAccessLevel?: "admins" | "all_members" | "company_admins";
defaultBoardAccess?: "private" | "view" | "comment" | "edit";
defaultBoardSharingAccess?:
| "team_members_with_editing_rights"
| "owner_and_coowners";
defaultOrganizationAccess?: "private" | "view" | "comment" | "edit";
defaultProjectAccess?: "private" | "view";
moveBoardToAccount?: "allowed" | "not_allowed";
restrictAllowedDomains?:
| "enabled"
| "disabled"
| "enabled_with_external_user_access";
sharingOnAccount?: "allowed" | "not_allowed";
sharingOnOrganization?:
| "allowed"
| "not_allowed"
| "allowed_with_editing";
sharingViaPublicLink?: "allowed" | "not_allowed" | "allowed_with_editing";
};
},
) {
const url = new URL(
`https://api.miro.com//v2/orgs/${org_id}/teams/${team_id}/settings`,
);
const response = await fetch(url, {
method: "PATCH",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer " + auth.token,
},
body: JSON.stringify(body),
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 235 days ago