← Public packages
@charlesmatte/granola
Search and read Granola meeting notes, summaries and transcripts from any agent; manage webhooks and legal holds safely.
src/webhooks/list.ts
21 lines · 1.1 KB · TypeScriptimport { parseWithAccount } from '../lib/api.ts'
import { listWebhookEndpoints } from '../lib/webhooks.ts'
/**
* List the webhook endpoints this key can manage (`GET /v1/webhook-endpoints`): URL, events,
* scopes, folder filter, enabled flag, creator. A personal key sees endpoints its owner created;
* an Enterprise workspace admin sees all. Signing secrets are never returned (shown once at create).
*
* @param input.account - Account name (secret `granola-<account>`). Required. @param input.secretName - Secret override.
* @returns `{ account, count, webhookEndpoints: [{ id, url, events, scopes, folder_ids, enabled, created_by, created_at }] }`
*
* @example
* import listWebhooks from 'kody:@charlesmatte/granola/webhooks/list'
*
* const { webhookEndpoints } = await listWebhooks({ account: 'work' })
*/
export default async function listGranolaWebhooks(input: unknown) {
const p = parseWithAccount<Record<string, never>>(input, {}, 'webhooks/list')
const endpoints = await listWebhookEndpoints(p.acct)
return { account: p.acct.account, count: endpoints.length, webhookEndpoints: endpoints }
}