A Rundeck webhook is a project-level HTTP endpoint. When it receives a POST request, a handler plugin runs, usually one that starts a job and passes values from the JSON payload into job options. This page walks through the setup screenshots below, then explains how authentication really works, fixes the curl command in the original post, and shows how to map payload fields to job options and connect a Git provider such as GitHub.
Step 1 – Create a Project and Job with Node Steps

Step 2 – Go to Webhooks under project Menu

Step 3 – Create Webhook

Step 4 – Add Webhook Handlers Configurations



Step 5 – Validate the webhook url

Step 6 – Get a User API Token



Step 6 – Generate a CURL command and Run using Gitbash
ENCODED_API_TOKEN=$(echo -n "6BnnOqW7EicQix9lDAn9MceNtSIQ2LBN" | base64)
curl -X POST \
-H "Authorization: Basic $ENCODED_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"webhook_id": "c6lMILXGYTvR6uaY59ZxhgsWybEfF5uF#hook1",
"payload": {
"key1": "value1",
"key2": "value2"
}
}' \
http://localhost:4440/api/45/webhook/c6lMILXGYTvR6uaY59ZxhgsWybEfF5uF#hook1Code language: PHP (php)



How Rundeck webhooks work
Each webhook belongs to a project and has a unique URL like http://<host>:4440/api/<version>/webhook/<token>#<name>. The long random string is the webhook's own auth token, and it is the credential. Anyone who has the full URL can trigger the webhook. The #<name> part at the end is only a readable label. It is a URL fragment, so HTTP clients like curl never send it to the server.
When a request arrives, Rundeck passes the request body to the configured handler plugin. The open-source edition includes a Run Job handler, which starts a chosen job, and a Log Events handler, which writes the payload to the server log. The Log Events handler is useful for checking what a sender actually posts. Commercial editions add more handlers, such as ones that can filter or route events by conditions.
| Webhook field | Purpose |
|---|---|
| Name | Label shown in the UI and appended to the URL after # |
| User | The Rundeck user that triggered executions run as |
| Roles | The roles used to check ACL permissions when the handler runs the job |
| Enabled | Turns the endpoint on or off without deleting it |
| Handler | The plugin that processes the payload, for example Run Job |
Prepare the job to accept webhook data
The webhook can only pass data into a job if the job defines options to receive it. In the job from Step 1, open Edit Job โ Workflow โ Options and add an option for each value you expect, for example key1 and key2. Then reference those options in the node steps:
# Command step
echo "key1 is ${option.key1}"
# Inline script step (token replaced before the script runs)
echo "key1 is @option.key1@"
# Inside any script on the node, options are also exported as environment variables
echo "key2 is $RD_OPTION_KEY2"Code language: PHP (php)
Note: If an option is marked Required and the payload does not include a value for it, the job will not start. During testing, give options default values or leave them optional.
Map payload fields in the Run Job handler
In the handler configuration from Step 4, the Job Options field takes option arguments. Use ${data.<field>} to pull values from the JSON body. For nested objects, use dot notation.
-key1 ${data.key1} -key2 ${data.key2}
With this mapping, a body of {"key1":"value1","key2":"value2"} sets key1=value1 and key2=value2. If a field is nested, for example {"build":{"version":"1.4.2"}}, reference it as ${data.build.version}. The handler's optional Node Filter field accepts the same ${data...} references, so the payload can also decide which nodes the job runs on.
Corrected curl command
The command in the example above works only because Rundeck ignores the Authorization header it sends. It also wraps the data so that the mapping shown earlier will not find the fields. Here is the corrected request, which runs as-is in Git Bash, Linux or macOS:
curl -i -X POST \
-H "Content-Type: application/json" \
-d '{"key1":"value1","key2":"value2"}' \
"http://localhost:4440/api/45/webhook/<WEBHOOK_TOKEN>#hook1"Code language: JavaScript (javascript)
- No API token or Basic auth header. The token in the URL authenticates the request. Rundeck user API tokens are never sent as base64 Basic credentials anyway.
- A flat JSON body. Fields at the top level match
${data.key1}. In the original body the value would sit at${data.payload.key1}, and thewebhook_idfield does nothing. - A quoted URL. Quoting stops the shell from interpreting special characters.
-iprints the HTTP status so you can confirm success. - The API version from the UI. Copy the full URL that Rundeck shows on the webhook page instead of typing
45yourself.
An HTTP 200 response means Rundeck accepted the request. To confirm the job ran and received the options, open the project's Activity page and check the execution log.
Note: The original post publishes what looks like a real user API token and webhook token. Treat any token that has appeared in a document, screenshot or chat as compromised: delete it under Profile โ User API Tokens, and regenerate the webhook token or recreate the webhook.
Webhook vs the job run API
Step 6 in the example above creates a user API token, but webhooks do not need one. You need a user token when you call the regular Rundeck API directly, for example to run a job by ID with explicit options. In that case, send the token in the X-Rundeck-Auth-Token header:
curl -X POST \
-H "X-Rundeck-Auth-Token: $RD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"options":{"key1":"value1","key2":"value2"}}' \
"http://localhost:4440/api/45/job/<JOB_UUID>/run"Code language: JavaScript (javascript)
Use a webhook when an outside system sends its own fixed JSON format, such as GitHub, GitLab, a monitoring tool or a ticketing system. Use the job run API when you control the client and want the response to include execution details.
Triggering a job from a GitHub push
- Make sure Rundeck is reachable from the internet over HTTPS, for example through a reverse proxy. GitHub cannot reach
localhost:4440. - Create a Run Job webhook and set Job Options to
-repo ${data.repository.full_name} -ref ${data.ref} -commit ${data.head_commit.id}. - In GitHub, go to Settings โ Webhooks โ Add webhook. Paste the Rundeck webhook URL without the
#namepart and set Content type toapplication/json. - Push a commit, then check Recent Deliveries in GitHub and the Activity page in Rundeck.
Every push to any branch triggers the job. If you only want some branches, check the ref option inside the job, for example exit early unless it equals refs/heads/main, or use a commercial handler that supports conditions. For broader Git automation patterns, see GitOps concepts.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| 404 or not found | Wrong token, webhook deleted, or wrong host or port | Copy the URL again from the project's Webhooks page |
| Request accepted but no execution | Webhook disabled, the webhook user or roles lack run permission on the job, or a required option is empty | Enable the webhook, review ACLs for the configured roles, and check the server log |
| Job runs but options are blank | Payload fields don't match the ${data...} paths | Temporarily switch to the Log Events handler to see the exact payload |
| Job runs but options are blank (GitHub) | GitHub content type set to form-encoded | Set the content type to application/json |
| Authorization error | The webhook has an authorization header secret enabled | Send the configured secret in the Authorization header |
Security best practices
- Expose Rundeck only over HTTPS, because the token travels in the URL.
- Run webhooks as a dedicated low-privilege user and roles that can run only the target jobs.
- Where your Rundeck version supports it, turn on the webhook's authorization header secret so that the URL alone is not enough to trigger it.
- Validate option values inside the job, using allowed values or regex rules, because payload content comes from outside Rundeck.
- Regenerate the webhook token if the URL leaks, and disable webhooks you no longer use.
Frequently asked questions
Do Rundeck webhooks need an API token?
No. The random token in the webhook URL authenticates the request, so a plain POST with a JSON body is enough. User API tokens are only needed for regular API endpoints, and they go in the X-Rundeck-Auth-Token header.
How do I pass webhook payload values into a Rundeck job?
Define options on the job, then fill them in the Run Job handler's Job Options field with ${data.field} references, for example -key1 ${data.key1}. Nested fields use dot notation, such as ${data.repository.full_name}.
What does the #name at the end of a Rundeck webhook URL do?
It is only a label. As a URL fragment, it is never sent to the server, and the token before it identifies the webhook.
Why does my webhook return success but no job runs?
Usually the webhook user or roles lack permission to run the job, the webhook is disabled, or a required option got no value. Check the Rundeck server log and the ACL policy for the configured roles.
Can GitHub trigger a Rundeck job directly?
Yes. Add the Rundeck webhook URL as a GitHub webhook with content type application/json, and make sure GitHub can reach Rundeck over the internet, ideally over HTTPS.
Related tutorials
- What is GitOps? Declarative config and Git as source of truth
- Git Workflow Master Tutorial
- More Git tutorials
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services โ all in one place.
Explore Hospitals