func webhookInfo(w http.ResponseWriter, r *http.Request, t auth.Token) error {
	webhookName := r.URL.Query().Get(":name")
	webhook, err := servicemanager.Webhook.Find(webhookName)
	if err != nil {
		if err == eventTypes.ErrWebhookNotFound {
			w.WriteHeader(http.StatusNotFound)
		}
		return err
	}
	ctx := permission.Context(permTypes.CtxTeam, webhook.TeamOwner)
	if !permission.Check(t, permission.PermWebhookRead, ctx) {
		return permission.ErrUnauthorized
	}
	w.Header().Set("Content-Type", "application/json")
	return json.NewEncoder(w).Encode(webhook)
}
title: webhook info
path: /events/webhooks/{name}
method: GET
produce: application/json
responses:
200: Get webhook
404: Not found
401: Unauthorized
package api
import (
	"encoding/json"
	"net/http"
	"github.com/tsuru/tsuru/auth"
	"github.com/tsuru/tsuru/event"
	"github.com/tsuru/tsuru/permission"
	"github.com/tsuru/tsuru/servicemanager"
	eventTypes "github.com/tsuru/tsuru/types/event"
	permTypes "github.com/tsuru/tsuru/types/permission"
)
func webhookList(w http.ResponseWriter, r *http.Request, t auth.Token) error {
	ctxs := permission.ContextsForPermission(t, permission.PermWebhookRead, permTypes.CtxTeam)
	var teams []string
	for _, c := range ctxs {
		if c.CtxType == permTypes.CtxGlobal {
			teams = nil
			break
		}
		teams = append(teams, c.Value)
	}
	webhooks, err := servicemanager.Webhook.List(teams)
	if err != nil {
		return err
	}
	if len(webhooks) == 0 {
		w.WriteHeader(http.StatusNoContent)
		return nil
	}
	w.Header().Set("Content-Type", "application/json")
	return json.NewEncoder(w).Encode(webhooks)
}