@trigger.dev/sdk 4.8.4 → 4.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/dist/commonjs/v3/ai.d.ts +29 -5
  2. package/dist/commonjs/v3/ai.js +160 -114
  3. package/dist/commonjs/v3/ai.js.map +1 -1
  4. package/dist/commonjs/v3/auth.d.ts +4 -4
  5. package/dist/commonjs/v3/auth.js +21 -75
  6. package/dist/commonjs/v3/auth.js.map +1 -1
  7. package/dist/commonjs/v3/chat-client.d.ts +1 -1
  8. package/dist/commonjs/v3/chat.d.ts +1 -1
  9. package/dist/commonjs/v3/prompt.js +6 -8
  10. package/dist/commonjs/v3/prompt.js.map +1 -1
  11. package/dist/commonjs/v3/runs.d.ts +5 -1
  12. package/dist/commonjs/v3/runs.js.map +1 -1
  13. package/dist/commonjs/v3/sessions.js +10 -7
  14. package/dist/commonjs/v3/sessions.js.map +1 -1
  15. package/dist/commonjs/v3/shared.d.ts +2 -2
  16. package/dist/commonjs/v3/shared.js +16 -15
  17. package/dist/commonjs/v3/shared.js.map +1 -1
  18. package/dist/commonjs/v3/steeringContext.d.ts +35 -10
  19. package/dist/commonjs/v3/steeringContext.js +35 -12
  20. package/dist/commonjs/v3/steeringContext.js.map +1 -1
  21. package/dist/commonjs/v3/streams.js +10 -8
  22. package/dist/commonjs/v3/streams.js.map +1 -1
  23. package/dist/commonjs/v3/tasks.d.ts +2 -2
  24. package/dist/commonjs/v3/tasks.js.map +1 -1
  25. package/dist/commonjs/v3/test/mock-chat-agent.js +24 -13
  26. package/dist/commonjs/v3/test/mock-chat-agent.js.map +1 -1
  27. package/dist/commonjs/v3/webhooks.d.ts +8 -2
  28. package/dist/commonjs/v3/webhooks.js +20 -11
  29. package/dist/commonjs/v3/webhooks.js.map +1 -1
  30. package/dist/commonjs/version.js +1 -1
  31. package/dist/esm/v3/ai.d.ts +29 -5
  32. package/dist/esm/v3/ai.js +162 -117
  33. package/dist/esm/v3/ai.js.map +1 -1
  34. package/dist/esm/v3/auth.d.ts +4 -4
  35. package/dist/esm/v3/auth.js +22 -76
  36. package/dist/esm/v3/auth.js.map +1 -1
  37. package/dist/esm/v3/chat-client.d.ts +1 -1
  38. package/dist/esm/v3/chat.d.ts +1 -1
  39. package/dist/esm/v3/prompt.js +6 -8
  40. package/dist/esm/v3/prompt.js.map +1 -1
  41. package/dist/esm/v3/runs.d.ts +5 -1
  42. package/dist/esm/v3/runs.js.map +1 -1
  43. package/dist/esm/v3/sessions.js +10 -7
  44. package/dist/esm/v3/sessions.js.map +1 -1
  45. package/dist/esm/v3/shared.d.ts +2 -2
  46. package/dist/esm/v3/shared.js +16 -15
  47. package/dist/esm/v3/shared.js.map +1 -1
  48. package/dist/esm/v3/steeringContext.d.ts +35 -10
  49. package/dist/esm/v3/steeringContext.js +34 -12
  50. package/dist/esm/v3/steeringContext.js.map +1 -1
  51. package/dist/esm/v3/streams.js +10 -8
  52. package/dist/esm/v3/streams.js.map +1 -1
  53. package/dist/esm/v3/tasks.d.ts +2 -2
  54. package/dist/esm/v3/tasks.js.map +1 -1
  55. package/dist/esm/v3/test/mock-chat-agent.js +25 -14
  56. package/dist/esm/v3/test/mock-chat-agent.js.map +1 -1
  57. package/dist/esm/v3/webhooks.d.ts +8 -2
  58. package/dist/esm/v3/webhooks.js +20 -11
  59. package/dist/esm/v3/webhooks.js.map +1 -1
  60. package/dist/esm/version.js +1 -1
  61. package/docs/ai/observability.mdx +25 -19
  62. package/docs/ai/prompts.mdx +25 -19
  63. package/docs/ai-chat/actions.mdx +1 -1
  64. package/docs/ai-chat/anatomy.mdx +1 -1
  65. package/docs/ai-chat/backend.mdx +24 -24
  66. package/docs/ai-chat/background-injection.mdx +5 -5
  67. package/docs/ai-chat/chat-local.mdx +2 -2
  68. package/docs/ai-chat/compaction.mdx +38 -15
  69. package/docs/ai-chat/custom-agents.mdx +4 -4
  70. package/docs/ai-chat/error-handling.mdx +4 -4
  71. package/docs/ai-chat/fast-starts.mdx +8 -7
  72. package/docs/ai-chat/frontend.mdx +6 -2
  73. package/docs/ai-chat/lifecycle-hooks.mdx +11 -11
  74. package/docs/ai-chat/migrating-from-a-route-handler.mdx +4 -4
  75. package/docs/ai-chat/migrating-from-hydrate-messages.mdx +1 -1
  76. package/docs/ai-chat/overview.mdx +1 -1
  77. package/docs/ai-chat/patterns/branching-conversations.mdx +1 -1
  78. package/docs/ai-chat/patterns/database-persistence.mdx +2 -2
  79. package/docs/ai-chat/patterns/human-in-the-loop.mdx +1 -1
  80. package/docs/ai-chat/patterns/native-compaction.mdx +29 -9
  81. package/docs/ai-chat/patterns/persistence-and-replay.mdx +1 -1
  82. package/docs/ai-chat/patterns/redacting-telemetry.mdx +2 -2
  83. package/docs/ai-chat/patterns/skills.mdx +2 -2
  84. package/docs/ai-chat/patterns/sub-agents.mdx +1 -1
  85. package/docs/ai-chat/patterns/tool-result-auditing.mdx +1 -1
  86. package/docs/ai-chat/patterns/trusted-edge-signals.mdx +2 -2
  87. package/docs/ai-chat/patterns/version-upgrades.mdx +2 -2
  88. package/docs/ai-chat/pending-messages.mdx +5 -5
  89. package/docs/ai-chat/prompt-caching.mdx +7 -7
  90. package/docs/ai-chat/quick-start.mdx +2 -2
  91. package/docs/ai-chat/testing.mdx +9 -9
  92. package/docs/ai-chat/tools.mdx +9 -5
  93. package/docs/ai-chat/transcript-storage.mdx +2 -2
  94. package/docs/ai-chat/types.mdx +10 -3
  95. package/docs/apikeys.mdx +2 -1
  96. package/docs/cli-login-commands.mdx +12 -0
  97. package/docs/concurrency.mdx +40 -0
  98. package/docs/database-connections.mdx +1 -1
  99. package/docs/deploy-environment-variables.mdx +84 -2
  100. package/docs/deployment/trusted-publishing.mdx +4 -0
  101. package/docs/errors-retrying.mdx +25 -18
  102. package/docs/github-actions.mdx +1 -1
  103. package/docs/github-integration.mdx +21 -0
  104. package/docs/how-it-works.mdx +4 -2
  105. package/docs/introduction.mdx +1 -1
  106. package/docs/mcp-introduction.mdx +7 -1
  107. package/docs/mcp-remote.mdx +90 -0
  108. package/docs/oidc/azure.mdx +81 -0
  109. package/docs/oidc/databricks.mdx +99 -0
  110. package/docs/oidc/doppler.mdx +60 -0
  111. package/docs/oidc/gcp.mdx +109 -0
  112. package/docs/oidc/hugging-face.mdx +90 -0
  113. package/docs/oidc/openrouter.mdx +91 -0
  114. package/docs/oidc/snowflake.mdx +91 -0
  115. package/docs/oidc/vault.mdx +71 -0
  116. package/docs/oidc.mdx +2 -0
  117. package/docs/runs/metadata.mdx +1 -1
  118. package/docs/self-hosting/docker.mdx +2 -0
  119. package/docs/self-hosting/env/webapp.mdx +4 -1
  120. package/docs/self-hosting/kubernetes.mdx +2 -0
  121. package/docs/tasks/schemaTask.mdx +26 -13
  122. package/docs/tasks/streams.mdx +2 -2
  123. package/docs/troubleshooting.mdx +7 -0
  124. package/docs/webhooks/channels.mdx +6 -6
  125. package/docs/webhooks/connect.mdx +9 -75
  126. package/docs/webhooks/custom-providers.mdx +87 -0
  127. package/docs/webhooks/deliveries.mdx +7 -7
  128. package/docs/webhooks/filters.mdx +2 -2
  129. package/docs/webhooks/how-it-works.mdx +58 -0
  130. package/docs/webhooks/human-in-the-loop.mdx +3 -3
  131. package/docs/webhooks/linear.mdx +5 -3
  132. package/docs/webhooks/overview.mdx +20 -71
  133. package/docs/webhooks/own-handler.mdx +62 -0
  134. package/docs/webhooks/pricing-and-limits.mdx +13 -0
  135. package/docs/webhooks/providers/attio.mdx +38 -0
  136. package/docs/webhooks/providers/autumn.mdx +40 -0
  137. package/docs/webhooks/providers/cal-com.mdx +41 -0
  138. package/docs/webhooks/providers/calendly.mdx +41 -0
  139. package/docs/webhooks/providers/clerk.mdx +40 -0
  140. package/docs/webhooks/providers/discord.mdx +45 -0
  141. package/docs/webhooks/providers/docusign.mdx +41 -0
  142. package/docs/webhooks/providers/elevenlabs.mdx +41 -0
  143. package/docs/webhooks/providers/firecrawl.mdx +54 -0
  144. package/docs/webhooks/providers/github.mdx +46 -0
  145. package/docs/webhooks/providers/gitlab.mdx +41 -0
  146. package/docs/webhooks/providers/granola.mdx +44 -0
  147. package/docs/webhooks/providers/hookdeck.mdx +98 -0
  148. package/docs/webhooks/providers/infisical.mdx +41 -0
  149. package/docs/webhooks/providers/jira.mdx +41 -0
  150. package/docs/webhooks/providers/langfuse.mdx +40 -0
  151. package/docs/webhooks/providers/linear.mdx +45 -0
  152. package/docs/webhooks/providers/loops.mdx +40 -0
  153. package/docs/webhooks/providers/metronome.mdx +42 -0
  154. package/docs/webhooks/providers/mux.mdx +40 -0
  155. package/docs/webhooks/providers/openai.mdx +40 -0
  156. package/docs/webhooks/providers/pagerduty.mdx +40 -0
  157. package/docs/webhooks/providers/plain.mdx +41 -0
  158. package/docs/webhooks/providers/planetscale.mdx +40 -0
  159. package/docs/webhooks/providers/recall-ai.mdx +54 -0
  160. package/docs/webhooks/providers/replicate.mdx +41 -0
  161. package/docs/webhooks/providers/resend.mdx +44 -0
  162. package/docs/webhooks/providers/retell.mdx +41 -0
  163. package/docs/webhooks/providers/sentry.mdx +41 -0
  164. package/docs/webhooks/providers/shopify.mdx +49 -0
  165. package/docs/webhooks/providers/slack.mdx +48 -0
  166. package/docs/webhooks/providers/square.mdx +40 -0
  167. package/docs/webhooks/providers/stripe.mdx +86 -0
  168. package/docs/webhooks/providers/supabase.mdx +41 -0
  169. package/docs/webhooks/providers/tailscale.mdx +43 -0
  170. package/docs/webhooks/providers/typeform.mdx +42 -0
  171. package/docs/webhooks/providers/vapi.mdx +47 -0
  172. package/docs/webhooks/providers/vercel.mdx +40 -0
  173. package/docs/webhooks/providers/whatsapp.mdx +45 -0
  174. package/docs/webhooks/providers/workos.mdx +41 -0
  175. package/docs/webhooks/providers/zendesk.mdx +41 -0
  176. package/docs/webhooks/providers.mdx +53 -0
  177. package/docs/webhooks/quick-start.mdx +131 -0
  178. package/docs/webhooks/session-routing.mdx +6 -6
  179. package/docs/webhooks/signing-secrets.mdx +80 -0
  180. package/docs/webhooks/slack.mdx +11 -2
  181. package/docs/webhooks/verification.mdx +139 -0
  182. package/docs/webhooks/waiters.mdx +2 -2
  183. package/docs/webhooks/webhook-tasks.mdx +46 -0
  184. package/package.json +4 -5
  185. package/docs/migrating-from-v3.mdx +0 -332
  186. package/docs/webhooks/public-beta.mdx +0 -70
  187. package/docs/webhooks/sources.mdx +0 -252
@@ -0,0 +1,43 @@
1
+ ---
2
+ title: "Tailscale webhooks"
3
+ sidebarTitle: "Tailscale"
4
+ description: "Receive and verify Tailscale webhooks with Trigger.dev. Check the HMAC-SHA256 signature in tailscale-webhook-signature and run a task for each Tailscale event."
5
+ ---
6
+
7
+ **`webhooks.tailscale()` verifies the HMAC-SHA256 signature Tailscale sends in `tailscale-webhook-signature` on every request.**
8
+
9
+ ```ts /trigger/tailscale.ts
10
+ import { webhook, webhooks } from "@trigger.dev/sdk";
11
+
12
+ export const tailscale = webhooks.endpoint.define({
13
+ id: "tailscale",
14
+ source: webhooks.tailscale(),
15
+ });
16
+
17
+ export const tailscaleEvents = webhook({
18
+ id: "tailscale-events",
19
+ endpoint: tailscale,
20
+ filter: "event any ( type == 'nodeCreated' )",
21
+ onEvent: async ({ event }) => {
22
+ console.log(event);
23
+ },
24
+ });
25
+ ```
26
+
27
+ | Setting | Value |
28
+ | --- | --- |
29
+ | Source | `webhooks.tailscale()` |
30
+ | Verification | HMAC-SHA256 in `tailscale-webhook-signature` |
31
+ | Credential | Signing secret issued by Tailscale |
32
+ | Tailscale docs | [Tailscale webhook docs](https://tailscale.com/docs/features/webhooks) |
33
+
34
+ ## Set up Tailscale
35
+
36
+ 1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
37
+ 2. On the **Webhooks** page of the Tailscale admin console, select **Add endpoint**, enter the webhook URL, and choose the events your subscribers need. This needs the Owner, Admin, Network admin or IT admin role.
38
+ 3. Tailscale shows the webhook secret once, right after the endpoint is added. Copy it then, and choose **Set signing secret** on the Trigger.dev endpoint.
39
+ 4. Use the Tailscale endpoint's menu, **Test endpoint > Send test event**, or use the endpoint's **Test** tab, and check the endpoint's **Deliveries** tab. See [Verify the connection](/webhooks/connect#verify-the-connection) if nothing arrives.
40
+
41
+ ## Batched events
42
+
43
+ Each request body is a JSON array of events, and Tailscale can batch several into one request. Filters match an event anywhere in the array with `event any ( ... )`, and a handler should process every event in the array.
@@ -0,0 +1,42 @@
1
+ ---
2
+ title: "Typeform webhooks"
3
+ sidebarTitle: "Typeform"
4
+ description: "Receive and verify Typeform webhooks with Trigger.dev. Check the HMAC-SHA256 signature in typeform-signature and run a task for each Typeform event, filtered on event.event_type."
5
+ ---
6
+
7
+ **`webhooks.typeform()` verifies the HMAC-SHA256 signature Typeform sends in `typeform-signature` on every request.**
8
+
9
+ ```ts /trigger/typeform.ts
10
+ import { webhook, webhooks } from "@trigger.dev/sdk";
11
+
12
+ export const typeform = webhooks.endpoint.define({
13
+ id: "typeform",
14
+ source: webhooks.typeform(),
15
+ });
16
+
17
+ export const typeformEvents = webhook({
18
+ id: "typeform-events",
19
+ endpoint: typeform,
20
+ onEvent: async ({ event }) => {
21
+ console.log(event);
22
+ },
23
+ });
24
+ ```
25
+
26
+ To run a subscriber only for some events, add a [filter](/webhooks/filters) on `event.event_type`.
27
+
28
+ | Setting | Value |
29
+ | --- | --- |
30
+ | Source | `webhooks.typeform()` |
31
+ | Verification | HMAC-SHA256 in `typeform-signature` |
32
+ | Credential | Secret you generate on Trigger.dev |
33
+ | Event type | `event.event_type` |
34
+ | Typeform docs | [Typeform webhook docs](https://www.typeform.com/developers/webhooks/secure-your-webhooks/) |
35
+
36
+ ## Set up Typeform
37
+
38
+ 1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
39
+ 2. Choose **Generate secret** on the Trigger.dev endpoint and copy the value.
40
+ 3. In Typeform, open the form's **Connect > Webhooks** and add a webhook with the webhook URL. Edit it and paste the secret into **Secret**. You can also set `secret` when you create the webhook with Typeform's API.
41
+ 4. Turn the webhook **On**. Typeform creates dashboard webhooks switched off.
42
+ 5. Send a test event from Typeform, or use the endpoint's **Test** tab, and check the endpoint's **Deliveries** tab. See [Verify the connection](/webhooks/connect#verify-the-connection) if nothing arrives.
@@ -0,0 +1,47 @@
1
+ ---
2
+ title: "Vapi webhooks"
3
+ sidebarTitle: "Vapi"
4
+ description: "Receive and verify Vapi webhooks with Trigger.dev. Check the HMAC-SHA256 signature in x-vapi-signature and run a task for each Vapi event, filtered on event.message.type."
5
+ ---
6
+
7
+ **`webhooks.vapi()` verifies the HMAC-SHA256 signature Vapi sends in `x-vapi-signature` on every request.**
8
+
9
+ ```ts /trigger/vapi.ts
10
+ import { webhook, webhooks } from "@trigger.dev/sdk";
11
+
12
+ export const vapi = webhooks.endpoint.define({
13
+ id: "vapi",
14
+ source: webhooks.vapi(),
15
+ });
16
+
17
+ export const vapiEvents = webhook({
18
+ id: "vapi-events",
19
+ endpoint: vapi,
20
+ onEvent: async ({ event }) => {
21
+ console.log(event);
22
+ },
23
+ });
24
+ ```
25
+
26
+ To run a subscriber only for some events, add a [filter](/webhooks/filters) on `event.message.type`.
27
+
28
+ | Setting | Value |
29
+ | --- | --- |
30
+ | Source | `webhooks.vapi()` |
31
+ | Verification | HMAC-SHA256 in `x-vapi-signature` |
32
+ | Credential | Secret you generate on Trigger.dev and add to a Vapi HMAC credential |
33
+ | Event type | `event.message.type` |
34
+ | Vapi docs | [Vapi webhook docs](https://docs.vapi.ai/server-url/server-authentication) |
35
+
36
+ ## Set up Vapi
37
+
38
+ 1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
39
+ 2. Choose **Generate secret** on the Trigger.dev endpoint and copy the value.
40
+ 3. In the Vapi Dashboard, open **Integrations > Server Configuration** and choose **Add Custom Credential**. Choose **HMAC** and set:
41
+ - **Secret Key**: the secret you generated
42
+ - **Algorithm**: SHA256
43
+ - **Signature Header**: `x-vapi-signature`
44
+ - **Timestamp Header**: leave empty
45
+ - **Payload Format**: the request body only, with no timestamp
46
+ 4. Set the webhook URL as the server URL on your assistant, phone number or Server Configuration, and attach the credential by its `credentialId`. Vapi only sends the credential when the server URL comes from your saved configuration, not from an API request.
47
+ 5. Send a test event from Vapi, or use the endpoint's **Test** tab, and check the endpoint's **Deliveries** tab. See [Verify the connection](/webhooks/connect#verify-the-connection) if nothing arrives.
@@ -0,0 +1,40 @@
1
+ ---
2
+ title: "Vercel webhooks"
3
+ sidebarTitle: "Vercel"
4
+ description: "Receive and verify Vercel webhooks with Trigger.dev. Check the HMAC-SHA1 signature in x-vercel-signature and run a task for each Vercel event, filtered on event.type."
5
+ ---
6
+
7
+ **`webhooks.vercel()` verifies the HMAC-SHA1 signature Vercel sends in `x-vercel-signature` on every request.**
8
+
9
+ ```ts /trigger/vercel.ts
10
+ import { webhook, webhooks } from "@trigger.dev/sdk";
11
+
12
+ export const vercel = webhooks.endpoint.define({
13
+ id: "vercel",
14
+ source: webhooks.vercel(),
15
+ });
16
+
17
+ export const vercelEvents = webhook({
18
+ id: "vercel-events",
19
+ endpoint: vercel,
20
+ filter: "event.type == 'deployment.succeeded'",
21
+ onEvent: async ({ event }) => {
22
+ console.log(event);
23
+ },
24
+ });
25
+ ```
26
+
27
+ | Setting | Value |
28
+ | --- | --- |
29
+ | Source | `webhooks.vercel()` |
30
+ | Verification | HMAC-SHA1 in `x-vercel-signature` |
31
+ | Credential | Signing secret issued by Vercel |
32
+ | Event type | `event.type` |
33
+ | Vercel docs | [Vercel webhook docs](https://vercel.com/docs/webhooks) |
34
+
35
+ ## Set up Vercel
36
+
37
+ 1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
38
+ 2. In Vercel, open your team's **Settings > Webhooks** (Pro and Enterprise plans) and create a webhook with the webhook URL and the events your subscribers need.
39
+ 3. Vercel shows the webhook's secret once, in the dialog after the webhook is created. Copy it then, and choose **Set signing secret** on the Trigger.dev endpoint. Webhooks from a Vercel integration are signed with the integration's Client Secret instead.
40
+ 4. Send a test event from Vercel, or use the endpoint's **Test** tab, and check the endpoint's **Deliveries** tab. See [Verify the connection](/webhooks/connect#verify-the-connection) if nothing arrives.
@@ -0,0 +1,45 @@
1
+ ---
2
+ title: "WhatsApp webhooks"
3
+ sidebarTitle: "WhatsApp"
4
+ description: "Receive and verify WhatsApp webhooks with Trigger.dev. Check the HMAC-SHA256 signature in x-hub-signature-256 and run a task for each WhatsApp event."
5
+ ---
6
+
7
+ **`webhooks.whatsapp()` verifies the HMAC-SHA256 signature WhatsApp sends in `x-hub-signature-256`, keyed by the App Secret on every request.**
8
+
9
+ ```ts /trigger/whatsapp.ts
10
+ import { webhook, webhooks } from "@trigger.dev/sdk";
11
+
12
+ export const whatsapp = webhooks.endpoint.define({
13
+ id: "whatsapp",
14
+ source: webhooks.whatsapp(),
15
+ });
16
+
17
+ export const whatsappEvents = webhook({
18
+ id: "whatsapp-events",
19
+ endpoint: whatsapp,
20
+ onEvent: async ({ event }) => {
21
+ console.log(event);
22
+ },
23
+ });
24
+ ```
25
+
26
+ | Setting | Value |
27
+ | --- | --- |
28
+ | Source | `webhooks.whatsapp()` |
29
+ | Verification | HMAC-SHA256 in `x-hub-signature-256`, keyed by the App Secret |
30
+ | Credential | Signing secret issued by WhatsApp |
31
+ | WhatsApp docs | [WhatsApp webhook docs](https://developers.facebook.com/docs/whatsapp/cloud-api/guides/set-up-webhooks/) |
32
+
33
+ ## Set up WhatsApp
34
+
35
+ 1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
36
+ 2. In the Meta app dashboard, set the WhatsApp webhook's callback URL to the webhook URL. Meta checks the URL with a GET request that needs a verify token; see [Verify the callback URL](#verify-the-callback-url).
37
+ 3. Copy the app's **App Secret**, then choose **Set signing secret** on the Trigger.dev endpoint. Meta signs event deliveries with it.
38
+ 4. Subscribe the webhook to the fields your subscribers need, such as `messages`.
39
+ 5. Send a test event from WhatsApp, or use the endpoint's **Test** tab, and check the endpoint's **Deliveries** tab. See [Verify the connection](/webhooks/connect#verify-the-connection) if nothing arrives.
40
+
41
+ ## Verify the callback URL
42
+
43
+ `webhooks.whatsapp()` also needs a verify token for Meta's URL check. On the endpoint, choose **Generate verify token** and paste the value into Meta's **Verify Token** field. Set Meta's App Secret as the signing secret, then validate the URL in Meta's dashboard.
44
+
45
+ The verify token answers the URL check. The signing secret verifies event deliveries. See [Verification](/webhooks/verification#endpoint-validation) for the response behavior.
@@ -0,0 +1,41 @@
1
+ ---
2
+ title: "WorkOS webhooks"
3
+ sidebarTitle: "WorkOS"
4
+ description: "Receive and verify WorkOS webhooks with Trigger.dev. Check the HMAC-SHA256 signature in workos-signature and run a task for each WorkOS event, filtered on event.event."
5
+ ---
6
+
7
+ **`webhooks.workos()` verifies the HMAC-SHA256 signature WorkOS sends in `workos-signature` on every request.**
8
+
9
+ ```ts /trigger/workos.ts
10
+ import { webhook, webhooks } from "@trigger.dev/sdk";
11
+
12
+ export const workos = webhooks.endpoint.define({
13
+ id: "workos",
14
+ source: webhooks.workos(),
15
+ });
16
+
17
+ export const workosEvents = webhook({
18
+ id: "workos-events",
19
+ endpoint: workos,
20
+ onEvent: async ({ event }) => {
21
+ console.log(event);
22
+ },
23
+ });
24
+ ```
25
+
26
+ To run a subscriber only for some events, add a [filter](/webhooks/filters) on `event.event`.
27
+
28
+ | Setting | Value |
29
+ | --- | --- |
30
+ | Source | `webhooks.workos()` |
31
+ | Verification | HMAC-SHA256 in `workos-signature` |
32
+ | Credential | Signing secret issued by WorkOS |
33
+ | Event type | `event.event` |
34
+ | WorkOS docs | [WorkOS webhook docs](https://workos.com/docs/events/data-syncing/webhooks) |
35
+
36
+ ## Set up WorkOS
37
+
38
+ 1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
39
+ 2. Add the webhook URL as a webhook in WorkOS and select the events your subscribers need. See WorkOS's [webhook docs](https://workos.com/docs/events/data-syncing/webhooks) for where its webhook settings are.
40
+ 3. Copy the signing secret WorkOS shows for the webhook, then choose **Set signing secret** on the Trigger.dev endpoint.
41
+ 4. Send a test event from WorkOS, or use the endpoint's **Test** tab, and check the endpoint's **Deliveries** tab. See [Verify the connection](/webhooks/connect#verify-the-connection) if nothing arrives.
@@ -0,0 +1,41 @@
1
+ ---
2
+ title: "Zendesk webhooks"
3
+ sidebarTitle: "Zendesk"
4
+ description: "Receive and verify Zendesk webhooks with Trigger.dev. Check the HMAC-SHA256 signature in x-zendesk-webhook-signature and run a task for each Zendesk event, filtered on its event type."
5
+ ---
6
+
7
+ **`webhooks.zendesk()` verifies the HMAC-SHA256 signature Zendesk sends in `x-zendesk-webhook-signature` on every request.**
8
+
9
+ ```ts /trigger/zendesk.ts
10
+ import { webhook, webhooks } from "@trigger.dev/sdk";
11
+
12
+ export const zendesk = webhooks.endpoint.define({
13
+ id: "zendesk",
14
+ source: webhooks.zendesk(),
15
+ });
16
+
17
+ export const zendeskEvents = webhook({
18
+ id: "zendesk-events",
19
+ endpoint: zendesk,
20
+ onEvent: async ({ event }) => {
21
+ console.log(event);
22
+ },
23
+ });
24
+ ```
25
+
26
+ To run a subscriber only for some events, add a [filter](/webhooks/filters) on `event.type` for Zendesk event subscriptions. For trigger and automation webhooks, you write the JSON body, so filter on a field your template sends.
27
+
28
+ | Setting | Value |
29
+ | --- | --- |
30
+ | Source | `webhooks.zendesk()` |
31
+ | Verification | HMAC-SHA256 in `x-zendesk-webhook-signature` |
32
+ | Credential | Signing secret issued by Zendesk |
33
+ | Event type | `event.type` for event subscriptions; a field from your template for triggers and automations |
34
+ | Zendesk docs | [Zendesk webhook docs](https://developer.zendesk.com/documentation/webhooks/verifying/) |
35
+
36
+ ## Set up Zendesk
37
+
38
+ 1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
39
+ 2. In Zendesk Admin Center, open **Apps and integrations > Webhooks** and create a webhook with the webhook URL. Subscribe it to Zendesk events, or connect it to a trigger or automation.
40
+ 3. Zendesk generates the signing secret. On the webhook's details, choose **Reveal secret**, copy it, and choose **Set signing secret** on the Trigger.dev endpoint.
41
+ 4. Send a test event from Zendesk, or use the endpoint's **Test** tab, and check the endpoint's **Deliveries** tab. See [Verify the connection](/webhooks/connect#verify-the-connection) if nothing arrives.
@@ -0,0 +1,53 @@
1
+ ---
2
+ title: "Webhook providers"
3
+ sidebarTitle: "All providers"
4
+ description: "Every built-in webhook provider, with its SDK function, the credential it verifies with, and a setup page for each provider."
5
+ ---
6
+
7
+ **Each built-in provider has a source function that verifies its signature scheme, so you declare the endpoint with one function call and set one credential.** Every provider below has a page with the source, where to register the URL, and how to set the credential.
8
+
9
+ | Provider | Source | Credential |
10
+ | --- | --- | --- |
11
+ | [Attio](/webhooks/providers/attio) | `webhooks.attio()` | Issued by the provider |
12
+ | [Autumn](/webhooks/providers/autumn) | `webhooks.autumn()` | Issued by the provider |
13
+ | [Cal.com](/webhooks/providers/cal-com) | `webhooks.calCom()` | You generate it |
14
+ | [Calendly](/webhooks/providers/calendly) | `webhooks.calendly()` | You choose it (OAuth apps: issued by the provider) |
15
+ | [Clerk](/webhooks/providers/clerk) | `webhooks.clerk()` | Issued by the provider |
16
+ | [Discord](/webhooks/providers/discord) | `webhooks.discord()` | Provider's public key |
17
+ | [DocuSign](/webhooks/providers/docusign) | `webhooks.docusign()` | Issued by the provider |
18
+ | [ElevenLabs](/webhooks/providers/elevenlabs) | `webhooks.elevenlabs()` | Issued by the provider |
19
+ | [Firecrawl](/webhooks/providers/firecrawl) | `webhooks.firecrawl()` | Issued by the provider |
20
+ | [GitHub](/webhooks/providers/github) | `webhooks.github()` | You generate it |
21
+ | [GitLab](/webhooks/providers/gitlab) | `webhooks.gitlab()` | You generate it |
22
+ | [Granola](/webhooks/providers/granola) | `webhooks.granola()` | Issued by the provider |
23
+ | [Hookdeck](/webhooks/providers/hookdeck) | `webhooks.hookdeck()` | Issued by the provider |
24
+ | [Infisical](/webhooks/providers/infisical) | `webhooks.infisical()` | You generate it |
25
+ | [Jira](/webhooks/providers/jira) | `webhooks.jira()` | You generate it |
26
+ | [Langfuse](/webhooks/providers/langfuse) | `webhooks.langfuse()` | Issued by the provider |
27
+ | [Linear](/webhooks/providers/linear) | `webhooks.linear()` | Issued by the provider |
28
+ | [Loops](/webhooks/providers/loops) | `webhooks.loops()` | Issued by the provider |
29
+ | [Metronome](/webhooks/providers/metronome) | `webhooks.metronome()` | Issued by the provider |
30
+ | [Mux](/webhooks/providers/mux) | `webhooks.mux()` | Issued by the provider |
31
+ | [OpenAI](/webhooks/providers/openai) | `webhooks.openai()` | Issued by the provider |
32
+ | [PagerDuty](/webhooks/providers/pagerduty) | `webhooks.pagerduty()` | Issued by the provider |
33
+ | [Plain](/webhooks/providers/plain) | `webhooks.plain()` | Issued by the provider |
34
+ | [PlanetScale](/webhooks/providers/planetscale) | `webhooks.planetscale()` | Issued by the provider |
35
+ | [Recall.ai](/webhooks/providers/recall-ai) | `webhooks.recallai()` | Issued by the provider |
36
+ | [Replicate](/webhooks/providers/replicate) | `webhooks.replicate()` | Issued by the provider |
37
+ | [Resend](/webhooks/providers/resend) | `webhooks.resend()` | Issued by the provider |
38
+ | [Retell AI](/webhooks/providers/retell) | `webhooks.retell()` | Your API key with the webhook badge |
39
+ | [Sentry](/webhooks/providers/sentry) | `webhooks.sentry()` | Issued by the provider |
40
+ | [Shopify](/webhooks/providers/shopify) | `webhooks.shopify()` | Issued by the provider |
41
+ | [Slack](/webhooks/providers/slack) | `webhookSource()` (`@trigger.dev/slack`) | Issued by the provider |
42
+ | [Square](/webhooks/providers/square) | `webhooks.square()` | Issued by the provider |
43
+ | [Stripe](/webhooks/providers/stripe) | `webhooks.stripe()` | Issued by the provider |
44
+ | [Supabase](/webhooks/providers/supabase) | `webhooks.supabase()` | You generate it |
45
+ | [Tailscale](/webhooks/providers/tailscale) | `webhooks.tailscale()` | Issued by the provider |
46
+ | [Typeform](/webhooks/providers/typeform) | `webhooks.typeform()` | You generate it |
47
+ | [Vapi](/webhooks/providers/vapi) | `webhooks.vapi()` | You generate it |
48
+ | [Vercel](/webhooks/providers/vercel) | `webhooks.vercel()` | Issued by the provider |
49
+ | [WhatsApp](/webhooks/providers/whatsapp) | `webhooks.whatsapp()` | Issued by the provider |
50
+ | [WorkOS](/webhooks/providers/workos) | `webhooks.workos()` | Issued by the provider |
51
+ | [Zendesk](/webhooks/providers/zendesk) | `webhooks.zendesk()` | Issued by the provider |
52
+
53
+ For a provider that isn't listed, define a [custom provider](/webhooks/custom-providers). For providers that sign with Svix or Standard Webhooks, `webhooks.svix()` and `webhooks.standardWebhooks()` also work; see [Verification](/webhooks/verification#svix-and-standard-webhooks).
@@ -0,0 +1,131 @@
1
+ ---
2
+ title: "Webhooks quick start"
3
+ sidebarTitle: "Quick start"
4
+ description: "Declare a hosted webhook endpoint, run it in dev, and see your first verified delivery start a task run in under 5 minutes."
5
+ ---
6
+
7
+ Install the SDK, declare an endpoint with a subscriber, and send it a test event. By the end, a verified delivery starts a run of your task.
8
+
9
+ This guide uses the [GitHub provider](/webhooks/providers/github) because you generate its signing secret on Trigger.dev, so you don't need a GitHub account to finish it. The steps are the same for every [provider](/webhooks/providers).
10
+
11
+ <Steps>
12
+
13
+ <Step title="Add Trigger.dev to your project">
14
+
15
+ Skip this step if your project already uses Trigger.dev 4.8.1 or later.
16
+
17
+ <CodeGroup>
18
+
19
+ ```bash npm
20
+ npx trigger.dev@latest init
21
+ ```
22
+
23
+ ```bash pnpm
24
+ pnpm dlx trigger.dev@latest init
25
+ ```
26
+
27
+ ```bash bun
28
+ bunx trigger.dev@latest init
29
+ ```
30
+
31
+ </CodeGroup>
32
+
33
+ To upgrade an existing project, install the SDK and CLI from `@latest`:
34
+
35
+ <CodeGroup>
36
+
37
+ ```bash npm
38
+ npm i @trigger.dev/sdk@latest
39
+ npm i -D trigger.dev@latest
40
+ ```
41
+
42
+ ```bash pnpm
43
+ pnpm add @trigger.dev/sdk@latest
44
+ pnpm add -D trigger.dev@latest
45
+ ```
46
+
47
+ ```bash bun
48
+ bun add @trigger.dev/sdk@latest
49
+ bun add -D trigger.dev@latest
50
+ ```
51
+
52
+ </CodeGroup>
53
+
54
+ </Step>
55
+
56
+ <Step title="Declare the endpoint and a subscriber">
57
+
58
+ Create a file in your `/trigger` directory. The endpoint is the hosted URL; the subscriber is the task that runs for each event.
59
+
60
+ ```ts /trigger/github.ts
61
+ import { webhook, webhooks } from "@trigger.dev/sdk";
62
+
63
+ export const github = webhooks.endpoint.define({
64
+ id: "github",
65
+ source: webhooks.github(),
66
+ });
67
+
68
+ export const githubEvents = webhook({
69
+ id: "github-events",
70
+ endpoint: github,
71
+ onEvent: async ({ event, headers }) => {
72
+ // GitHub sends the event name in a header
73
+ console.log("Received", headers.get("x-github-event"), event);
74
+ },
75
+ });
76
+ ```
77
+
78
+ </Step>
79
+
80
+ <Step title="Run the dev server">
81
+
82
+ <CodeGroup>
83
+
84
+ ```bash npm
85
+ npx trigger.dev@latest dev
86
+ ```
87
+
88
+ ```bash pnpm
89
+ pnpm dlx trigger.dev@latest dev
90
+ ```
91
+
92
+ ```bash bun
93
+ bunx trigger.dev@latest dev
94
+ ```
95
+
96
+ </CodeGroup>
97
+
98
+ The CLI registers the `github` endpoint you declared in your **Development** environment.
99
+
100
+ </Step>
101
+
102
+ <Step title="Generate the signing secret">
103
+
104
+ In the [Trigger.dev dashboard](https://cloud.trigger.dev), open your project, make sure the **Development** environment is selected, and choose **Webhooks** in the side menu. The `github` endpoint is listed with its **Signing secret** column set to **Needs secret**. Every delivery is rejected until an endpoint has its secret.
105
+
106
+ Open the `github` endpoint, choose **Generate secret** and confirm. The secret is shown once: copy it if you'll connect GitHub later. Back on the **Webhooks** page, the column now says **Ready**.
107
+
108
+ </Step>
109
+
110
+ <Step title="Send a test event">
111
+
112
+ On the `github` endpoint's page, open the **Test** tab. It starts with a sample body. Under **Headers**, add `x-github-event` with a value such as `push` so the handler logs an event name, then choose **Send event**. The test is signed with the endpoint's secret and runs the full delivery pipeline. Sending the same body again is deduplicated to the first delivery, so change the body to send another.
113
+
114
+ The delivery appears on the **Deliveries** tab. Open it and check **Targets** to see that it reached the `github-events` subscriber, then follow the link to the run to see the logged event.
115
+
116
+ </Step>
117
+
118
+ </Steps>
119
+
120
+ ## Connect the real provider
121
+
122
+ To receive real events, register the endpoint's **Webhook URL** and the same secret with the provider. Each [provider page](/webhooks/providers) lists where to add them.
123
+
124
+ <CardGroup cols={2}>
125
+ <Card title="Connect a provider" icon="plug" href="/webhooks/connect">
126
+ Register the URL and secret by hand or with an AI coding agent.
127
+ </Card>
128
+ <Card title="Filters" icon="filter" href="/webhooks/filters">
129
+ Run a subscriber only for the events it handles.
130
+ </Card>
131
+ </CardGroup>
@@ -4,7 +4,7 @@ description: "Route verified webhook deliveries to a durable per-key session ins
4
4
  sidebarTitle: "Session routing"
5
5
  ---
6
6
 
7
- A plain [`webhook()`](/webhooks/overview) runs a fresh, stateless run for every delivery. Sometimes you want the opposite: deliveries that share a key (a customer, an installation, an issue) should land on **one durable [session](/ai-chat/sessions)** and be handled in order, with state carried across them. That is what session routing does.
7
+ **Session routing sends deliveries that share a key (a customer, an installation, an issue) to one durable [session](/ai-chat/sessions), handled one at a time with state carried across them.** A plain [`webhook()`](/webhooks/overview) starts a fresh, stateless run for every delivery instead.
8
8
 
9
9
  Instead of a handler, you declare a `chat.event` on an [endpoint](/webhooks/overview) and list it on an agent. The verified delivery is routed to a find-or-created session and arrives as an [action](/ai-chat/actions).
10
10
 
@@ -36,12 +36,12 @@ The endpoint's other subscribers, such as a `webhook()` task, still get the same
36
36
  The `key` is what makes routing durable: two deliveries that resolve to the same key reach the same session; a different key gets its own. It is a template string, evaluated server-side at ingest, whose `{...}` placeholders read three namespaces:
37
37
 
38
38
  - `{event.*}`: the parsed event body.
39
- - `{webhook.*}`: endpoint metadata (`externalRef`, `tenantId`, `id`, `source`, `deliveryId`).
39
+ - `{webhook.*}`: endpoint metadata (`externalRef`, `tenantId`, `id`, `source`, `deliveryId`). Here `deliveryId` is the provider's event ID, not the `whd_` id.
40
40
  - `{header.name}`: an inbound header.
41
41
 
42
42
  These are the same namespaces [filter](/webhooks/filters) expressions use. Every placeholder names one: a bare `{customer}` is an error.
43
43
 
44
- `{a || b}` falls back to `b` when `a` is missing or empty. Compose several placeholders into one key: `"{webhook.externalRef}-{event.issue.id}"`. Each placeholder is checked against the event type at build time, so a bad field is a red squiggle on the `key` line, not a runtime surprise.
44
+ `{a || b}` falls back to `b` when `a` is missing or empty. Compose several placeholders into one key: `"{webhook.externalRef}-{event.issue.id}"`. Each placeholder is checked against the event type at build time, so a bad field is a type error at build time.
45
45
 
46
46
  ### The `type` label
47
47
 
@@ -74,7 +74,7 @@ export const orderAgent = chat.agent({
74
74
 
75
75
  `action.type` is a closed union of the `type` labels of the events you listed, and each arm narrows `action.event` to that event's payload type. The full envelope is `{ type, event, source, headers, deliveryId, externalDeliveryId, endpoint }`. `deliveryId` is the delivery's `whd_` id, as in the dashboard and the [deliveries API](/webhooks/deliveries): a [replay](/webhooks/deliveries#replay) gets a new one. `externalDeliveryId` is the provider's id for the delivery (Stripe's `evt_` id, for example), the same across replays. `endpoint` is the endpoint the delivery arrived on.
76
76
 
77
- Because it is an [action](/ai-chat/actions), the handler is not a turn by default: it can read the event, mutate session state with `chat.history`, and return nothing. To have the agent answer, return `chat.turn()`: the edit is saved, then a full turn runs on the session's history exactly as a message turn does. Webhook actions bypass your `actionSchema` (their shape is fixed and already verified by the source), so `action.type` and `action.event` are typed from the descriptor, not the schema.
77
+ Because it is an [action](/ai-chat/actions), the handler is not a turn by default: it can read the event, mutate session state with `chat.history`, and return nothing. To have the agent answer, return `chat.turn()`: the edit is saved, then a full turn runs on the session's history as a message turn does. Webhook actions bypass your `actionSchema` (their shape is fixed and already verified by the source), so `action.type` and `action.event` are typed from the descriptor, not the schema.
78
78
 
79
79
  ## Answering into a channel
80
80
 
@@ -107,7 +107,7 @@ export const orderAgent = chat.agent({
107
107
  }
108
108
  },
109
109
  run: async ({ messages, streamText }) =>
110
- streamText({ model: anthropic("claude-sonnet-4-5"), messages }),
110
+ streamText({ model: anthropic("claude-sonnet-5-5"), messages }),
111
111
  });
112
112
  ```
113
113
 
@@ -128,7 +128,7 @@ An exported `chat.event` that no agent lists routes nothing. `trigger dev` warns
128
128
 
129
129
  ## Filtering
130
130
 
131
- A [`filter`](/webhooks/filters) works here exactly as on a `webhook()` task: a delivery that doesn't match never reaches the session, and the delivery records the reason.
131
+ A [`filter`](/webhooks/filters) works here as on a `webhook()` task: a delivery that doesn't match never reaches the session, and the delivery records the reason.
132
132
 
133
133
  ```ts
134
134
  export const orderEvents = chat.event({
@@ -0,0 +1,80 @@
1
+ ---
2
+ title: "Webhook signing secrets"
3
+ sidebarTitle: "Signing secrets"
4
+ description: "Set, generate and rotate the credential an endpoint verifies deliveries with, from the dashboard, the CLI, the MCP server or the REST API."
5
+ ---
6
+
7
+ **Each endpoint verifies deliveries with one credential: a signing secret, or a public key for providers that sign with a key pair.** Every delivery is rejected until the credential is set.
8
+
9
+ ## Set the credential
10
+
11
+ | Action | Use it when |
12
+ | --- | --- |
13
+ | **Set signing secret** | The provider issues the secret, as Stripe and Svix do. |
14
+ | **Generate secret** | The provider accepts a secret you choose, as GitHub does. Trigger.dev shows it once. |
15
+ | **Set public key** | The provider signs with a key pair, as Discord does. |
16
+
17
+ Each [provider page](/webhooks/providers) says which one that provider needs.
18
+
19
+ ## Rotate a credential
20
+
21
+ Choose **Rotate signing secret** to replace a provider-supplied secret. For a secret you generate, choose **Regenerate secret**, copy the new value, and update the provider's configuration. Use **Rotate public key** when replacing an asymmetric provider's key.
22
+
23
+ Both dialogs ask how long to keep accepting the old secret: **Stop immediately**, 1 hour, 24 hours (the default) or 7 days. Until then, deliveries signed with either secret verify, so you can update the provider without failing any. Choose **Stop immediately** if the old secret leaked.
24
+
25
+ Through the MCP tools or the REST API, pass `previousSecretTtlSeconds` (at most 604800, 7 days). The response's `previousSecretExpiresAt` says when the old secret stops working. Without it, the old secret stops working straight away:
26
+
27
+ ```bash
28
+ curl -X POST "https://api.trigger.dev/api/v1/webhooks/endpoints/github/rotate-secret" \
29
+ -H "Authorization: Bearer $TRIGGER_SECRET_KEY" \
30
+ -H "Content-Type: application/json" \
31
+ -d '{"previousSecretTtlSeconds": 3600}'
32
+ ```
33
+
34
+ <Warning>
35
+ Trigger.dev stores credentials encrypted and doesn't display saved values. Copy a generated secret
36
+ before closing the dialog.
37
+ </Warning>
38
+
39
+ ## Store secrets from the CLI
40
+
41
+ The [CLI webhooks commands](/cli-webhooks-commands) store a secret without printing it. Use them with AI agents that can run shell commands: a secret passed to `set_webhook_secret`, or returned by `generate_webhook_secret`, becomes part of the agent's conversation, and the MCP tool descriptions point agents to the CLI instead.
42
+
43
+ ```bash
44
+ # Store a secret the provider issued, from an env file or a pipe
45
+ npx trigger.dev@latest webhooks set-secret stripe --env prod --from-env STRIPE_WEBHOOK_SECRET
46
+
47
+ # Generate one and save it to .env.local for the agent to pass to the provider by name
48
+ npx trigger.dev@latest webhooks generate-secret github --env prod --to-env GITHUB_WEBHOOK_SECRET
49
+ ```
50
+
51
+ ## MCP tools
52
+
53
+ The Trigger.dev MCP server (`npx trigger.dev@latest install-mcp`) has these webhook tools:
54
+
55
+ | Tool | What it does |
56
+ | --- | --- |
57
+ | `list_webhook_endpoints` | Lists the environment's endpoints, with their URL and whether a secret is set. |
58
+ | `get_webhook_endpoint_details` | Reads one endpoint: URL, subscribers and their filters, secret state, and the setup prompt. |
59
+ | `generate_webhook_secret` | Generates a signing secret and returns it once, for providers where you choose the secret. Optionally keeps accepting the old secret (`previousSecretTtlSeconds`). |
60
+ | `set_webhook_secret` | Stores a secret the provider issued. Optionally keeps accepting the old secret (`previousSecretTtlSeconds`). |
61
+
62
+ ## REST API
63
+
64
+ The same operations are available on the REST API with the environment's secret key:
65
+
66
+ | Request | What it does |
67
+ | --- | --- |
68
+ | [`GET /api/v1/webhooks/endpoints`](/management/webhooks/list-endpoints) | Lists the environment's endpoints, with their URL and whether a secret is set. |
69
+ | [`GET /api/v1/webhooks/endpoints/{endpointId}`](/management/webhooks/retrieve-endpoint) | Reads the endpoint, including `subscribers` and `setupPrompt`. |
70
+ | [`POST /api/v1/webhooks/endpoints/{endpointId}/rotate-secret`](/management/webhooks/generate-secret) | Generates a secret and returns it once. |
71
+ | [`PUT /api/v1/webhooks/endpoints/{endpointId}/secret`](/management/webhooks/set-secret) | Stores a secret, sent as `{ "secret": "..." }`. |
72
+
73
+ `endpointId` is the endpoint's declared id (the `id` passed to `webhooks.endpoint.define`) or its `wh_` id, shown on its page and returned by `list_webhook_endpoints`:
74
+
75
+ ```bash
76
+ curl -X PUT "https://api.trigger.dev/api/v1/webhooks/endpoints/stripe/secret" \
77
+ -H "Authorization: Bearer $TRIGGER_SECRET_KEY" \
78
+ -H "Content-Type: application/json" \
79
+ -d '{"secret": "whsec_..."}'
80
+ ```