//native
/**
* Delete an API key
* Delete an API key from your ReadMe project.
*/
export async function main(auth: RT.Readme, api_key_id: string, subdomain: string) {
const url = new URL(`https://api.readme.com/v2/projects/${subdomain}/apikeys/${api_key_id}`)
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.text()
}
Submitted by hugo697 235 days ago