# Upload a file using api

**URL:** <https://forum.gitea.com/t/upload-a-file-using-api/1435>\
**Category:** API/SDK/Tea/HelmChart/Terraform\
**Created:** [August 31, 2019, 10:13am UTC](https://forum.gitea.com/t/upload-a-file-using-api/1435 "2019-08-31T10:13:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![binary](https://avatars.discourse-cdn.com/v4/letter/b/8c91f0/32.png) [@binary](https://forum.gitea.com/u/binary)\
**Post date:** [August 31, 2019, 10:13am UTC](https://forum.gitea.com/t/upload-a-file-using-api/1435/1 "2019-08-31T10:13:56Z")

</div>

Hello. I am new to Gitea.  
Can someone tell me how I can upload a file to a repository using the rest api. Please.  
Any examples?

---

<div class="post-metadata">

**Author:** ![binary](https://avatars.discourse-cdn.com/v4/letter/b/8c91f0/32.png) [@binary](https://forum.gitea.com/u/binary)\
**Post date:** [September 1, 2019, 11:14am UTC](https://forum.gitea.com/t/upload-a-file-using-api/1435/2 "2019-09-01T11:14:33Z")

</div>

Hello guys.  
Via the Gitea running locally from the site when a repository is selected, a binary can be uploaded, api may go something like this:  
[http://localhost:3000/defaultOrg/repo3/upload-file](http://localhost:3000/defaultOrg/repo3/upload-file)

Is there a equivalent of it in rest api published.  
Please, I am trying hard to believe in the power of open source.

---

<div class="post-metadata">

**Author:** ![buddyspencer](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/buddyspencer/32/4770_2.png) [@buddyspencer](https://forum.gitea.com/u/buddyspencer)\
**Post date:** [October 1, 2019, 7:10am UTC](https://forum.gitea.com/t/upload-a-file-using-api/1435/3 "2019-10-01T07:10:26Z")

</div>

Hi,  
I think this is what you are looking for:  
[https://try.gitea.io/api/swagger#/repository/repoCreateFile](https://try.gitea.io/api/swagger#/repository/repoCreateFile)
