Regenerate a workspace workflow hook secret
Replace the signing secret of a send_webhook hook and return the new one. This response is the only time you see the new secret. Plane signs every later delivery with the new secret. Signatures made with the old secret stop validating at once, so update your receiver before the next move through the transition.
This is a bodyless POST. Calling it on a run_script hook returns 400.
Path Parameters
slug:requiredstringThe workspace slug. It appears in your Plane URLs. In https://app.plane.so/my-team/projects/, the slug is my-team.
workflow_id:requiredstring (uuid)The catalog workflow the transition belongs to.
transition_id:requiredstring (uuid)The transition the hooks run on. It must belong to the workflow in the path, or the request returns 404.
pk:requiredstring (uuid)The id of the hook.
Body Parameters
None. The endpoint takes no request body and ignores anything you send.
Response
secretstring. The new signing secret,plane_wh_followed by 32 hexadecimal characters.
Scopes
workspaces.workflows:write
Errors
| Status | Code | Cause |
|---|---|---|
400 | invalid_request | The hook's handler isn't send_webhook. |
401 | unauthorized | Missing or invalid credentials. |
402 | payment_required | Workflows isn't on your plan, or is switched off. |
403 | forbidden | Your role or token scope can't edit workspace workflows. |
404 | not_found | No such workflow, transition, or hook, or the hook was deleted. |
406 | not_acceptable | The Accept header asks for a representation the API can't produce. |
409 | governance_migration_in_progress | A governance migration is running in this workspace, so writes are paused. Retry after it finishes. |
409 | states_managed_at_project | The workspace doesn't have governance turned on. Use the project's workflows instead. |
413 | payload_too_large | The request body is over the size limit. |
415 | unsupported_media_type | The Content-Type isn't one this endpoint accepts. |
429 | rate_limited | Throttled. Honor the Retry-After header before retrying. |
curl -X POST \
"https://api.plane.so/api/v2/workspaces/my-team/workflows/9c1f0b3d-6d2e-4c9a-8b41-2f7e5a0d6c88/state-transitions/d7a3f5c9-0b2e-4d81-b6f4-9e1c3a5d7b20/hooks/e4b7c9a2-3d1f-4e68-8a52-9f0c6b3d7e15/regenerate-webhook-secret/" \
-H "X-Api-Key: $PLANE_API_KEY"import requests
response = requests.post(
"https://api.plane.so/api/v2/workspaces/my-team/workflows/9c1f0b3d-6d2e-4c9a-8b41-2f7e5a0d6c88/state-transitions/d7a3f5c9-0b2e-4d81-b6f4-9e1c3a5d7b20/hooks/e4b7c9a2-3d1f-4e68-8a52-9f0c6b3d7e15/regenerate-webhook-secret/",
headers={"X-Api-Key": "your-api-key"},
)
print(response.json()["secret"])const response = await fetch(
"https://api.plane.so/api/v2/workspaces/my-team/workflows/9c1f0b3d-6d2e-4c9a-8b41-2f7e5a0d6c88/state-transitions/d7a3f5c9-0b2e-4d81-b6f4-9e1c3a5d7b20/hooks/e4b7c9a2-3d1f-4e68-8a52-9f0c6b3d7e15/regenerate-webhook-secret/",
{
method: "POST",
headers: {
"X-Api-Key": "your-api-key",
},
},
);
const data = await response.json();{
"secret": "plane_wh_8e1d5b3a9c6f4e27b0d4a3f6c9e2b5a8"
}{
"type": "invalid_request",
"code": "invalid_request",
"detail": "Only send_webhook hooks carry a webhook secret."
}
