Skip to content
POST /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

idstring
required·

Resource id

triggerKeystring
required·

Webhook trigger key within the workflow

Request Body

grace_secondsinteger

Response Body

endpointobject
can_manageboolean
created_atstring
endpoint_idstring
presetstring,null
previous_secret_expires_atstring,null
rotated_atstring,null
schemestring
Possible values:
standardhmactoken
secret_statestring
Possible values:
unrevealedrevealedprovidedmissing
statusstring
Possible values:
activeneeds_secretdraft_only
trigger_keystring
urlstring
secretstring
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())