code: func (s *APIServer) emitAuditEvent(auth ClientI, w http.ResponseWriter, r *http.Request, p httprouter.Params, version string) (interface{}, error) {
  	var req auditEventReq
  	err := httplib.ReadJSON(r, &req)
  	if err != nil {
  		return nil, trace.Wrap(err)
  	}
  	// For backwards compatibility, check if the full event struct has
  	// been sent in the request or just the event type.
  	if req.Event.Name != "" {
  		err = auth.EmitAuditEvent(req.Event, req.Fields)
  	} else {
  		err = auth.EmitAuditEvent(events.Event{Name: req.Type}, req.Fields)
  	}
  	if err != nil {
  		return nil, trace.Wrap(err)
  	}
  	return message("ok"), nil
  }
docs: // HTTP	POST /:version/events