//native
type Brevo = {
apiKey: string;
};
/**
* Delete a group
* This endpoint allows you to delete a group of sub-organizations. When a group is deleted, the sub-organizations are no longer part of this group. The users associated with the group are no longer associated with the group once deleted.
*/
export async function main(auth: Brevo, id: string) {
const url = new URL(`https://api.brevo.com/v3/corporate/group/${id}`);
const response = await fetch(url, {
method: "DELETE",
headers: {
"api-key": auth.apiKey,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.text();
}
Submitted by hugo697 428 days ago