type Convertkit = {
apiSecret: string
}
export async function main(resource: Convertkit, broadcastId: string) {
const endpoint = `https://api.convertkit.com/v3/broadcasts/${broadcastId}`
const body = {
api_secret: resource.apiSecret
}
const response = await fetch(endpoint, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(body)
})
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`)
}
return {success: true}
}
Submitted by hugo697 81 days ago