Rotate a webhook secret
/automation/{id}/webhook/{triggerKey}/rotate
The previous secret keeps verifying for `grace_seconds` (0 to 86400, default 86400). 409 `webhook_scheme_mismatch` for hmac endpoints: use PUT secret. The new secret is applied to the live endpoint before this answers; 503 `automation_unavailable` means it could not be applied yet and the call should be retried (the previous secret is still the one being checked).
Path Parameters
Resource id
Webhook trigger key within the workflow
Request Body
Response Body
standardhmactoken
unrevealedrevealedprovidedmissing
activeneeds_secretdraft_only
curl -X POST 'https://api.elaichi.ai/automation/<id>/webhook/<triggerKey>/rotate' \
-H 'Authorization: Bearer $ELAICHI_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"grace_seconds":0}'const body = {
"grace_seconds": 0
};
const response = await fetch('https://api.elaichi.ai/automation/<id>/webhook/<triggerKey>/rotate', {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + process.env.ELAICHI_API_TOKEN,
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
});
const data = await response.json();
console.log(data);import os
import requests
url = "https://api.elaichi.ai/automation/<id>/webhook/<triggerKey>/rotate"
headers = {
"Authorization": f"Bearer {os.environ['ELAICHI_API_TOKEN']}",
"Content-Type": "application/json",
}
payload = {
"grace_seconds": 0
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())