# \[Solved\] How to make a repo private via API?

**URL:** <https://forum.gitea.com/t/solved-how-to-make-a-repo-private-via-api/1198>\
**Category:** API/SDK/Tea/HelmChart/Terraform\
**Created:** [May 29, 2019, 12:39pm UTC](https://forum.gitea.com/t/solved-how-to-make-a-repo-private-via-api/1198 "2019-05-29T12:39:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vorlon](https://avatars.discourse-cdn.com/v4/letter/v/977dab/32.png) [@vorlon](https://forum.gitea.com/u/vorlon)\
**Post date:** [May 29, 2019, 12:39pm UTC](https://forum.gitea.com/t/solved-how-to-make-a-repo-private-via-api/1198/1 "2019-05-29T12:39:03Z")

</div>

Is there a way to modify the private true/false status of a repository via the API? This can e.g. be done when creating the repository via the API, but I did not find anything in the Swagger docs on how to set this later on.

---

<div class="post-metadata">

**Author:** ![techknowlogick](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/techknowlogick/32/4706_2.png) [@techknowlogick](https://forum.gitea.com/u/techknowlogick)\
**Post date:** [June 6, 2019, 2:20am UTC](https://forum.gitea.com/t/solved-how-to-make-a-repo-private-via-api/1198/2 "2019-06-06T02:20:57Z")

</div>

This endpoint should be helpful: [https://try.gitea.io/api/swagger#/repository/repoEdit](https://try.gitea.io/api/swagger#/repository/repoEdit)

---

<div class="post-metadata">

**Author:** ![vorlon](https://avatars.discourse-cdn.com/v4/letter/v/977dab/32.png) [@vorlon](https://forum.gitea.com/u/vorlon)\
**Post date:** [June 20, 2019, 2:03pm UTC](https://forum.gitea.com/t/solved-how-to-make-a-repo-private-via-api/1198/3 "2019-06-20T14:03:52Z")

</div>

Nice, that’s exactly what I was missing 🙂, so I don’t have to use the DB next time 😉

---

<div class="post-metadata">

**Author:** ![techknowlogick](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/techknowlogick/32/4706_2.png) [@techknowlogick](https://forum.gitea.com/u/techknowlogick)\
**Post date:** [June 29, 2019, 6:39am UTC](https://forum.gitea.com/t/solved-how-to-make-a-repo-private-via-api/1198/4 "2019-06-29T06:39:31Z")

</div>

Closed on June 29, 2019, 6:39am UTC


