Deleting uploaded file through API

I uploaded a file through the API with

curl --header "PRIVATE-TOKEN: my-token" --request POST --form "file=@my-file" "https://gitlab.com/api/v4/projects/my-project-id/uploads"

How do I delete the file?

1 Like

Have you tried repository api’s.

curl --request PUT --header ‘PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK’ ‘https://gitlab.example.com/api/v3/projects/13083/repository/files?file_path=app/project.rb&branch_name=master&author_email=author%40example.com&author_name=Firstname%20Lastname&commit_message=delete%20file

https://scm.hue.workslan/help/api/repository_files.md

@hozawa: repository_files is related to Git repository, not uploaded files.
I’m still looking for an answer to the OP.