https://docs.gitlab.com/ce/api/branches.html#delete-merged-branches
Will delete all branches that are merged into the project’s default branch.
DELETE /projects/:id/repository/merged_branches
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/repository/merged_branches