title: Github enterprise API delete branch after merge
body: <p>I am currently working with the Github API (on enterprise edition). After some trial and error I was able to change the status of a pull request using curl -X POST:</p>
  
  <pre><code>curl -u &lt;token&gt;:x-oauth-basic --header "Content-Type: application/json" -X POST --data "{\"state\":\"success\",\"target_url\":\"%BUILD_URL%\",\"description\":\"my description\",\"context\":\"continuous-integration/mycontext\"}" http://&lt;server&gt;/api/v3/repos/&lt;myuserid&gt;/&lt;myreponame&gt;/statuses/%COMMIT_SHA%
  </code></pre>
  
  <p>and also to automatically merge if verything was successfull using curl -X PUT:</p>
  
  <pre><code>curl -u &lt;token&gt;:x-oauth-basic --header "Content-Type: application/json" -X PUT --data "{\"state\":\"merged\",\"commit_title\":\"automatic merge\",\"commit_message\":\"automatic merge\",\"sha\":\"%COMMIT_SHA%\",\"merge_method\":\"merge\"}" http://&lt;server&gt;/api/v3/repos/&lt;myuserid&gt;/&lt;myreponame&gt;/pulls/%PullRequest%/merge
  </code></pre>
  
  <p>So far so good...But I am not able to delete the branch after successfull merge. I want to use the Github API, because the Jenkins job which is controlling this, does not know a thing about the repository or its branches.</p>
  
  <p>What I tried was the following:</p>
  
  <pre><code>curl -u &lt;token&gt;:x-oauth-basic -X DELETE http://&lt;server&gt;/api/v3/repos/&lt;myuserid&gt;/&lt;myreponame&gt;/git/refs/heads/develop
  </code></pre>
  
  <p>It returns:</p>
  
  <pre><code>{
    "message": "Not Found",
    "documentation_url": "https://developer.github.com/enterprise/2.11/v3/git/refs/#update-a-reference"
  }
  </code></pre>
  
  <p>The URL is fine from my perspective. Opened in a browser I get some nice JSON lines. 
  My thought was, that I will not need JSON data this time, since I don't want to patch or create something, but rather "only" delete it. Am I right? What else might miss here?</p>