//native
type Clickup = {
token: string;
};
/**
* Delete Group
* This endpoint is used to remove a [User Group](https://docs.clickup.com/en/articles/4010016-teams-how-to-create-user-groups) from your Workspace.\
\
In our API documentation, `team_id` refers to the id of a Workspace, and `group_id` refers to the id of a user group.
*/
export async function main(auth: Clickup, group_id: string) {
const url = new URL(`https://api.clickup.com/api/v2/group/${group_id}`);
const response = await fetch(url, {
method: "DELETE",
headers: {
Authorization: auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 235 days ago