0

Get Web Hooks

by
Published Oct 17, 2025

Fetches web hooks. A web hook allows you to pass data into Kustomer by posting to a designated endpoint. The webhook contains a URL to post data to and a workflow event to process the incoming data. This endpoint will return a maximum of 10 pages with 99 entries.

Script kustomer Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Kustomer = {
3
  apiKey: string;
4
};
5
/**
6
 * Get Web Hooks
7
 * Fetches web hooks.
8

9
A web hook allows you to pass data into Kustomer by posting to a designated endpoint.
10

11
The webhook contains a URL to post data to and a workflow event to process the incoming data.
12

13
This endpoint will return a maximum of 10 pages with 99 entries.
14
 */
15
export async function main(auth: Kustomer) {
16
  const url = new URL(`https://api.kustomerapp.com/v1/hooks/web`);
17

18
  const response = await fetch(url, {
19
    method: "GET",
20
    headers: {
21
      Authorization: "Bearer " + auth.apiKey,
22
    },
23
    body: undefined,
24
  });
25
  if (!response.ok) {
26
    const text = await response.text();
27
    throw new Error(`${response.status} ${text}`);
28
  }
29
  return await response.json();
30
}
31