POST
/api/v1/webhooks/{id}/rotateRotate a webhook signing secret (dual-sign during grace window)
Generates a new HMAC signing secret for the webhook. During the configurable grace window, outbound deliveries are signed with BOTH the new and previous secrets (header X-EvalGuard-Signature-Previous) so receivers can roll their verifier without dropping events. After the grace window expires, only the new secret is used.
Authentication
Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/api-keys.
Parameters
id in pathrequiredstringRequest body
Example
{
"graceSeconds": 0
}Schema
{
"application/json": {
"schema": {
"type": "object",
"properties": {
"graceSeconds": {
"type": "integer",
"minimum": 0,
"description": "Seconds the previous secret remains valid for dual-signing after rotation."
}
}
}
}
}Response
All status codes
200Rotation succeeded; response includes the new secret value and the previous secret expiry timestamp
404Webhook not found or not in caller org
Code samples
cURL
curl -X POST \
https://evalguard.ai/api/v1/webhooks/{id}/rotate \
-H "Authorization: Bearer $EVALGUARD_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "graceSeconds": 0 }'TypeScript
import { EvalGuard } from "@evalguard/sdk";
const client = new EvalGuard({ apiKey: process.env.EVALGUARD_API_KEY });
const response = await client.request({
method: "POST",
path: "/api/v1/webhooks/{id}/rotate",
body: {
"graceSeconds": 0
},
});
console.log(response);Python
from evalguard import EvalGuard
import os
client = EvalGuard(api_key=os.environ["EVALGUARD_API_KEY"])
response = client.request(
method="POST",
path="/api/v1/webhooks/{id}/rotate",
body={
"graceSeconds": 0
},
)
print(response)Go
package main
import (
"context"
"fmt"
"os"
"github.com/evalguard/evalguard-go"
)
func main() {
client := evalguard.NewClient(os.Getenv("EVALGUARD_API_KEY"))
resp, err := client.Request(context.Background(), "POST", "/api/v1/webhooks/{id}/rotate", map[string]any{"graceSeconds": 0})
if err != nil { panic(err) }
fmt.Println(resp)
}Errors
404