func eventList(w http.ResponseWriter, r *http.Request, t auth.Token) error {
	var filter *event.Filter
	err := ParseInput(r, &filter)
	if err != nil {
		return err
	}
	filter.LoadKindNames(r.Form)
	filter.PruneUserValues()
	filter.Permissions, err = t.Permissions()
	if err != nil {
		return err
	}
	events, err := event.List(filter)
	if err != nil {
		return err
	}
	if len(events) == 0 {
		w.WriteHeader(http.StatusNoContent)
		return nil
	}
	for _, event := range events {
		err = suppressSensitiveEnvs(event)
		if err != nil {
			return err
		}
	}
	w.Header().Add("Content-Type", "application/json")
	return json.NewEncoder(w).Encode(events)
}
title: event list
path: /events
method: GET
produce: application/json
responses:
200: OK
204: No content
package api
import (
	"encoding/json"
	"fmt"
	"net/http"
	"strconv"
	"github.com/globalsign/mgo/bson"
	"github.com/tsuru/config"
	"github.com/tsuru/tsuru/app"
	"github.com/tsuru/tsuru/auth"
	"github.com/tsuru/tsuru/errors"
	"github.com/tsuru/tsuru/event"
	"github.com/tsuru/tsuru/permission"
)