//native
/**
* Revoke Origin CA Certificate
* Revoke an Origin CA certificate by its id.
*/
export async function main(auth: RT.Cloudflare, certificate_id: string) {
const response = await fetch(
`https://api.cloudflare.com/client/v4/certificates/${certificate_id}`,
{
method: "DELETE",
headers: {
Authorization: `Bearer ${auth.token}`,
Accept: "application/json",
},
}
)
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`)
}
return await response.json()
}
Submitted by hugo989 4 hours ago