code: func (s *HTTPServer) EventFire(resp http.ResponseWriter, req *http.Request) (interface{}, error) {
  
  	// Get the datacenter
  	var dc string
  	s.parseDC(req, &dc)
  
  	event := &UserEvent{}
  	event.Name = strings.TrimPrefix(req.URL.Path, "/v1/event/fire/")
  	if event.Name == "" {
  		resp.WriteHeader(http.StatusBadRequest)
  		fmt.Fprint(resp, "Missing name")
  		return nil, nil
  	}
  
  	// Get the ACL token
  	var token string
  	s.parseToken(req, &token)
  
  	// Get the filters
  	if filt := req.URL.Query().Get("node"); filt != "" {
  		event.NodeFilter = filt
  	}
  	if filt := req.URL.Query().Get("service"); filt != "" {
  		event.ServiceFilter = filt
  	}
  	if filt := req.URL.Query().Get("tag"); filt != "" {
  		event.TagFilter = filt
  	}
  
  	// Get the payload
  	if req.ContentLength > 0 {
  		var buf bytes.Buffer
  		if _, err := io.Copy(&buf, req.Body); err != nil {
  			return nil, err
  		}
  		event.Payload = buf.Bytes()
  	}
  
  	// Try to fire the event
  	if err := s.agent.UserEvent(dc, token, event); err != nil {
  		if acl.IsErrPermissionDenied(err) {
  			resp.WriteHeader(http.StatusForbidden)
  			fmt.Fprint(resp, acl.ErrPermissionDenied.Error())
  			return nil, nil
  		}
  		resp.WriteHeader(http.StatusInternalServerError)
  		return nil, err
  	}
  
  	// Return the event
  	return event, nil
  }
docs: // EventFire is used to fire a new event