type Resend = {
token: string;
};
/**
* Remove an existing API key
*
*/
export async function main(auth: Resend, api_key_id: string) {
const url = new URL(`https://api.resend.com/api-keys/${api_key_id}`);
const response = await fetch(url, {
method: "DELETE",
headers: {
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.text();
}
Submitted by hugo697 58 days ago
type Resend = {
token: string;
};
/**
* Remove an existing API key
*
*/
export async function main(auth: Resend, api_key_id: string) {
const url = new URL(`https://api.resend.com/api-keys/${api_key_id}`);
const response = await fetch(url, {
method: "DELETE",
headers: {
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.text();
}
Submitted by hugo697 620 days ago
export type Resend = {
token: string;
};
/**
* Remove an existing API key
*
*/
export async function main(auth: Resend, api_key_id: string) {
const url = new URL(`https://api.resend.com/api-keys/${api_key_id}`);
const response = await fetch(url, {
method: "DELETE",
headers: {
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
return await response.text();
}
Submitted by rubenfiszel 621 days ago