Create a workspace workflow hook
Add a hook to a transition of a catalog workflow. The new hook runs last in its phase, because Plane sets execution_order to one more than the highest in that phase.
For a send_webhook hook, the 201 response is the only place the signing secret appears, as config.secret_plaintext. Store it then. No read returns it again. To get a new one, use Regenerate a workspace workflow hook secret.
Each handler needs its own plan feature: Plane Runner for run_script, and Webhook transition conditions for send_webhook. Without that feature, the request returns 402 payment_required.
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.
Body parameters
phase:requiredstringWhen the hook runs. Fixed at creation.
pre: before the move. The firstprehook that fails blocks the move.post: after the move. Everyposthook runs, and a failure doesn't undo the move.
handler_name:requiredstringWhat the hook does, run_script or send_webhook. Fixed at creation.
config:requiredobjectThe handler's settings. The shape depends on handler_name.
For run_script:
script_idstring (uuid), required. A system script, or a script in this workspace that isn't tied to a project.execution_variablesobject, optional. Values passed to the script. It must be an object.
A run_script config error keeps the v1 shape inside errors[]: the entry with field set to error holds the message, and the entry with field set to error_code holds WORKFLOW_RULE_INVALID_CONFIG (no script_id, or an execution_variables that isn't an object) or WORKFLOW_RULE_INVALID_SCRIPT_ID (a script this transition can't use).
For send_webhook:
urlstring, required. Where to send the event,httporhttpsonly. Plane rejects URLs that resolve to private or internal addresses and any domain the instance disallows for webhooks.headersarray of object, optional. Up to 20 extra request headers, each withkey(1 to 256 characters),value(up to 8192 characters), andis_secret(defaults totrue). Keys must be unique, and the comparison ignores case.Host,Content-Length,Content-Type,User-Agent,X-Plane-Delivery,X-Plane-Event, andX-Plane-Signatureare reserved. Plane stores secret header values encrypted.
Don't send a signing secret. Plane generates one for every send_webhook hook.
is_enabled:optionalbooleanWhether the hook runs. Defaults to true.
Response shaping
fields:optionalstringComma-separated list of fields to return. Fields you don't request are left out of the response instead of coming back as null, so a missing key means you didn't ask for it and null means the value is null. id is always included, whether or not you name it.
Pass all to get every requestable field. An unknown field name returns 400 with the list of valid names and the closest match, so a typo is caught instead of being silently ignored.
Requestable here: config, created_at, execution_order, handler_name, id, is_enabled, phase, project_id, updated_at, workflow_transition_id.
See Sparse fields.
Scopes
workspaces.workflows:write
Errors
| Status | Code | Cause |
|---|---|---|
400 | invalid_request | A phase or handler_name outside the enum, a run_script config without a usable script_id or with a non-object execution_variables, or a send_webhook config with an invalid URL or headers. |
401 | unauthorized | Missing or invalid credentials. |
402 | payment_required | The Workflows feature isn't on your plan, or is turned off. |
402 | payment_required | The handler's feature isn't on your plan, or is turned off: Plane Runner for run_script, Webhook transition conditions for send_webhook. |
403 | forbidden | Your role or token scope can't edit workspace workflows. |
404 | not_found | No such workflow in this workspace's catalog, or no such transition in it. |
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/" \
-H "X-Api-Key: $PLANE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phase": "post",
"handler_name": "send_webhook",
"config": {
"url": "https://hooks.example.com/plane",
"headers": [
{
"key": "X-Team",
"value": "platform",
"is_secret": false
}
]
}
}'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/",
headers={"X-Api-Key": "your-api-key"},
json={
"phase": "post",
"handler_name": "send_webhook",
"config": {
"url": "https://hooks.example.com/plane",
"headers": [
{
"key": "X-Team",
"value": "platform",
"is_secret": False,
},
],
},
},
)
print(response.json())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/",
{
method: "POST",
headers: {
"X-Api-Key": "your-api-key",
"Content-Type": "application/json",
},
body: JSON.stringify({
phase: "post",
handler_name: "send_webhook",
config: {
url: "https://hooks.example.com/plane",
headers: [
{
key: "X-Team",
value: "platform",
is_secret: false,
},
],
},
}),
},
);
const data = await response.json();{
"id": "e4b7c9a2-3d1f-4e68-8a52-9f0c6b3d7e15",
"workflow_transition_id": "d7a3f5c9-0b2e-4d81-b6f4-9e1c3a5d7b20",
"project_id": null,
"phase": "post",
"handler_name": "send_webhook",
"is_enabled": true,
"execution_order": 1,
"config": {
"url": "https://hooks.example.com/plane",
"headers": [
{
"key": "X-Team",
"value": "platform",
"is_secret": false
}
],
"secret_plaintext": "plane_wh_4f9a2c7e1b8d4e3fa6c05d9b2e7f7c1d"
},
"created_at": "2026-01-15T11:04:52.660219Z",
"updated_at": "2026-01-15T11:04:52.660219Z"
}{
"type": "invalid_request",
"code": "invalid_request",
"detail": "One or more fields failed validation.",
"errors": [
{
"field": "config",
"code": "invalid",
"message": "Invalid send_webhook hook configuration. Check the webhook URL and headers."
}
]
}{
"type": "invalid_request",
"code": "invalid_request",
"detail": "One or more fields failed validation.",
"errors": [
{
"field": "error",
"code": "invalid",
"message": "run_script hook must include config.script_id."
},
{
"field": "error_code",
"code": "invalid",
"message": "WORKFLOW_RULE_INVALID_CONFIG"
}
]
}{
"type": "payment_required",
"code": "payment_required",
"detail": "The send_webhook handler is not enabled for this workspace."
}
