When attempting to manually test a Dokploy webhook endpoint for auto-deployment, the API returns a "Branch Not Match" error:
{
"message": "Branch Not Match"
}Dokploy webhook endpoints expect requests to mimic the format of actual Git provider webhooks, particularly GitHub's webhook format. The key requirement is the X-GitHub-Event header.
curl -X POST https://dokploy.knowsuchagency.com/api/deploy/compose/g9_VUyDCSqM5wzxeplg51 \
-H "Content-Type: application/json" \
-H "X-GitHub-Event: push" \
-d '{"ref":"refs/heads/main","repository":{"full_name":"test/repo"}}'{
"message": "Compose deployed successfully"
}- X-GitHub-Event Header: Must be set to
pushto indicate a push event - ref Field: Must match the format
refs/heads/BRANCH_NAMEwhereBRANCH_NAMEmatches the branch configured in Dokploy - repository Field: Should include at minimum a
full_nameproperty - Content-Type: Must be
application/json
- Missing the
X-GitHub-Eventheader will cause "Branch Not Match" errors - The branch name in the
reffield must exactly match what's configured in Dokploy - The
refmust use the full formatrefs/heads/BRANCH_NAME, not just the branch name
To test with a different branch, modify the ref field:
# For master branch
curl -X POST https://dokploy.knowsuchagency.com/api/deploy/compose/YOUR_ID \
-H "Content-Type: application/json" \
-H "X-GitHub-Event: push" \
-d '{"ref":"refs/heads/master","repository":{"full_name":"test/repo"}}'
# For develop branch
curl -X POST https://dokploy.knowsuchagency.com/api/deploy/compose/YOUR_ID \
-H "Content-Type: application/json" \
-H "X-GitHub-Event: push" \
-d '{"ref":"refs/heads/develop","repository":{"full_name":"test/repo"}}'