You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 98adb66
Browse filesBrowse the repository at this point in the historyBrowse files
The `generate_webhook_secret` and `set_webhook_secret` MCP tools take an optional `previousSecretTtlSeconds` to keep accepting a webhook endpoint's old signing secret while the provider switches to the new one (up to 7 days), and report when the old secret stops working.
Copy file name to clipboardExpand all lines: apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.webhooks.endpoints.$endpointParam/route.tsx
? ` ${asymmetric ? "A public key" : "A secret"} is already set; replacing it breaks deliveries until ${source} uses the new one, so only replace it when you're creating or updating the webhook in${source}.`
155
+
? ` ${asymmetric ? "A public key" : "A secret"} is already set; only replace it when you're creating or updating the webhook in ${source}, and pass \`previousSecretTtlSeconds\` (for example 3600) so deliveries signed with the old one keep verifying until${source} uses the new one.`
Copy file name to clipboardExpand all lines: docs/webhooks/connect.mdx
+14-3Lines changed: 14 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,8 +18,8 @@ The prompt tells the agent to use the Trigger.dev MCP server (`npx trigger.dev@l
18
18
| --- | --- |
19
19
|`list_webhook_endpoints`| Lists the environment's endpoints, with their URL and whether a secret is set. |
20
20
|`get_webhook_endpoint_details`| Reads one endpoint: URL, subscribers and their filters, secret state, and the setup prompt. |
21
-
|`generate_webhook_secret`| Generates a signing secret and returns it once, for providers where you choose the secret. |
22
-
|`set_webhook_secret`| Stores a secret the provider issued. |
21
+
|`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`). |
22
+
|`set_webhook_secret`| Stores a secret the provider issued. Optionally keeps accepting the old secret (`previousSecretTtlSeconds`). |
23
23
24
24
Without the MCP server, the same operations are available on the REST API with the environment's secret key:
25
25
@@ -74,7 +74,18 @@ The verify token answers the URL check. The signing secret verifies event delive
74
74
75
75
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.
76
76
77
+
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.
78
+
79
+
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:
80
+
81
+
```bash
82
+
curl -X POST "https://api.trigger.dev/api/v1/webhooks/endpoints/github/rotate-secret" \
83
+
-H "Authorization: Bearer $TRIGGER_SECRET_KEY" \
84
+
-H "Content-Type: application/json" \
85
+
-d '{"previousSecretTtlSeconds": 3600}'
86
+
```
87
+
77
88
<Warning>
78
89
Trigger.dev stores credentials encrypted and doesn't display saved values. Copy a generated secret
79
-
before closing the dialog. Deliveries signed with the old secret fail verification after rotation.
0 commit comments