I have created a custom trigger form my project in GitLab and it works fine on branch 'main' via curl (with POST queries):
curl -X POST -F token=%myToken% -F ref=main https://%mygitlab%/api/v4/projects/82/trigger/pipeline
OR:
curl --request POST "https://%mygitlab%/api/v4/projects/82/trigger/pipeline?token=%myToken%&ref=main"
But I want to use webhook and try the next:
https://%mygitlab%/api/v4/projects/82/ref/main/trigger/pipeline?token=%myToken%
It doesn't work and returns 404:
{"error":"404 Not Found"}
What do I miss or do wrong? May be I must to configure something?
Your webhook URL https://%mygitlab%/api/v4/projects/82/ref/main/trigger/pipeline?token=%myToken% should work (use the token from Settings->CI/CD->Pipeline triggers), but the webhook request must be http POST.
This is why
will return 404, but
will work. I have the same behavior on my GitLab (Self-Managed).