{"id":1514,"date":"2024-07-23T16:43:59","date_gmt":"2024-07-23T14:43:59","guid":{"rendered":"https:\/\/cln.io\/blog\/?p=1514"},"modified":"2024-10-12T19:38:14","modified_gmt":"2024-10-12T17:38:14","slug":"gitlab-403-forbidden-error-when-trying-to-delete-a-merge-request","status":"publish","type":"post","link":"https:\/\/cln.io\/blog\/gitlab-403-forbidden-error-when-trying-to-delete-a-merge-request\/","title":{"rendered":"GitLab &#8211; 403 Forbidden error when trying to delete a merge request"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I&#8217;ve run into the issue of automating the deletion of merge requests over the API ( <a href=\"https:\/\/docs.gitlab.com\/17.2\/ee\/api\/merge_requests.html#delete-a-merge-request\">https:\/\/docs.gitlab.com\/17.2\/ee\/api\/merge_requests.html#delete-a-merge-request<\/a> ) <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Googled around, and found people saying to use personal access tokens instead of project access tokens&#8230;<br>failed to spot this little detail: Only administrators and project owners can do this!<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"527\" src=\"https:\/\/cln.io\/blog\/wp-content\/uploads\/2024\/07\/image-1024x527.png\" alt=\"\" class=\"wp-image-1515\" srcset=\"https:\/\/cln.io\/blog\/wp-content\/uploads\/2024\/07\/image-1024x527.png 1024w, https:\/\/cln.io\/blog\/wp-content\/uploads\/2024\/07\/image-300x154.png 300w, https:\/\/cln.io\/blog\/wp-content\/uploads\/2024\/07\/image-768x395.png 768w, https:\/\/cln.io\/blog\/wp-content\/uploads\/2024\/07\/image-1536x790.png 1536w, https:\/\/cln.io\/blog\/wp-content\/uploads\/2024\/07\/image.png 2022w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">After elevating the permissions of my automation user, merge requests are being deleted now! yay<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve run into the issue of automating the deletion of merge requests over the API ( https:\/\/docs.gitlab.com\/17.2\/ee\/api\/merge_requests.html#delete-a-merge-request ) Googled around, and found people saying to use personal access tokens instead of project access tokens&#8230;failed to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1683,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[57,3],"tags":[],"class_list":["post-1514","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apis","category-automation"],"_links":{"self":[{"href":"https:\/\/cln.io\/blog\/wp-json\/wp\/v2\/posts\/1514","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cln.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cln.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cln.io\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cln.io\/blog\/wp-json\/wp\/v2\/comments?post=1514"}],"version-history":[{"count":2,"href":"https:\/\/cln.io\/blog\/wp-json\/wp\/v2\/posts\/1514\/revisions"}],"predecessor-version":[{"id":1517,"href":"https:\/\/cln.io\/blog\/wp-json\/wp\/v2\/posts\/1514\/revisions\/1517"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cln.io\/blog\/wp-json\/wp\/v2\/media\/1683"}],"wp:attachment":[{"href":"https:\/\/cln.io\/blog\/wp-json\/wp\/v2\/media?parent=1514"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cln.io\/blog\/wp-json\/wp\/v2\/categories?post=1514"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cln.io\/blog\/wp-json\/wp\/v2\/tags?post=1514"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}