//native
type Pandadoc = {
apiKey: string
}
export async function main(auth: Pandadoc, id: string) {
const url = new URL(`https://api.pandadoc.com/public/v1/webhook-subscriptions/${id}/shared-key`)
const response = await fetch(url, {
method: 'PATCH',
headers: {
Authorization: `API-Key ${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 581 days ago