# PUT repository endpoint

**Project:** API | **Board:** Planned | **Votes:** 1
**URL:** https://roadmap.ploi.io/projects/6-api-level-requests/items/1425-put-repository-endpoint

---

We love the quick deploy feature, but we'd like to automate it with a git hook:

On push, parse the commit message for a target environment. If found, update the site's repository branch via the API, then trigger a deployment.                                                                  

Currently this isn't possible because there's no endpoint to update the repository branch (PUT or PATCH on /api/servers/{server}/sites/{site}/repository). The only option is to delete and reinstall the repository, which wipes the deploy script and .env file.

I know I can pass the branch via deploy variables, but I'd prefer to use the built-in "auto deploy" flow where the site's configured branch is actually updated.

Requested: A PUT or PATCH endpoint for /api/servers/{server}/sites/{site}/repository that allows updating at least the branch field.
