Delete pipeline via API fails with 403 Forbidden again

Getting 403 when deleting environment via API

*Describe your question in as much detail as possible:

  • What are you seeing, and how does it differ from what you expect to see?*
    • I’m getting 403 when deleting the environment via API. I have tried a few ways to pass to the token. Also different tokens - job token and personal token with all privileges - api, sudo, admin, etc. Also, I added the project to Limit access to this project in CI/CD settings.
{"message":"403 Forbidden"}

curl -X DELETE -F private_token="[MASKED]" ''
{"message":"403 Forbidden"}

curl -X DELETE -H "Authorization: Bearer [MASKED]" ''
{"message":"403 Forbidden"}

{"message":"403 Forbidden"}
  • Consider including screenshots, error messages, and/or other helpful visuals
    • gitlab-workhorse:

Well I found the problem. 403 = Environment is not stopped. Even if env is just available it can’t be deleted. So you have to stop it first via POST …ID/stop. And then you can delete it.