Delete pipeline via API fails with 403 Forbidden

I am a maintainer on a project. I want to clear out the old pipelines. I created a personal access token with all permissions. The script runs correctly but it doesn’t delete any pipelines returning this error:

Deleting pipeline 134566632
{“message”:“403 Forbidden”}Deleting pipeline 134607716
{“message”:“403 Forbidden”}Deleting pipeline 134932351
{“message”:“403 Forbidden”}Deleting pipeline 134932931
and on and on…

Any thoughts would be appreciated!

Thanks in advance

-Andy

1 Like

Has anyone had success deleting pipelines using the API? I too am getting the 403 Forbidden message. The access token is configured with the api permission. URLs and IDs are correct per the API docs. This happens on any project that I configure - I am using omnibus Gitlab CE.

curl --header "PRIVATE-TOKEN: <mytoken>" --request "DELETE" "https://...../api/v4/projects/3/pipelines/14514

Thanks --Don

1 Like

You have to generate a personal access token instead of project level access token

Yes, that worked.

User must be Admin?
I get {“message”:“403 Forbidden”}

User not admin has PAT with scopes: api, read_user, read_repository, write_repository, read_registry, write_registry