I'm working on a big refacto of the api, i submitted this PR because i needed this feature in https://github.com/drone/drone