//native
/**
* List Workflows
* List the account's workflows (legacy v3 API: contact-based workflows). Requires the automation scope and a Professional or Enterprise subscription.
*/
export async function main(auth: RT.Hubspot) {
const url = new URL(`https://api.hubapi.com/automation/v3/workflows`)
const response = await fetch(url, {
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