//native
type Telnyx = {
apiKey: string
}
/**
* Delete Brand
* Delete Brand. This endpoint is used to delete a brand. Note the brand cannot be deleted if it contains one or more active campaigns, the campaigns need to be inactive and at least 3 months old due to billing purposes.
*/
export async function main(auth: Telnyx, brandId: string) {
const url = new URL(`https://api.telnyx.com/v2/brand/${brandId}`)
const response = await fetch(url, {
method: 'DELETE',
headers: {
Authorization: 'Bearer ' + auth.apiKey
},
body: undefined
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
Submitted by hugo697 428 days ago