def put(self, name):
        if self.should_fail_with_auth_error() != AuthErrorStates.NONE:
            self.fail_with_auth_error()
            return

        self.logger.log(logging.DEBUG, f"Processing PUT for /endpoints/{name}")

        try:
            if not self.request.body:
                self.error_out(400, "Input body cannot be empty")
                self.finish()
                return
            try:
                request_data = json.loads(self.request.body.decode("utf-8"))
            except BaseException as ex:
                self.error_out(
                    400, log_message="Failed to decode input body", info=str(ex)
                )
                self.finish()
                return

            # check if endpoint exists
            endpoints = self.tabpy_state.get_endpoints(name)
            if len(endpoints) == 0:
                self.error_out(404, f"endpoint {name} does not exist.")
                self.finish()
                return

            new_version = int(endpoints[name]["version"]) + 1
            self.logger.log(logging.INFO, f"Endpoint info: {request_data}")
            err_msg = yield self._add_or_update_endpoint(
                "update", name, new_version, request_data
            )
            if err_msg:
                self.error_out(400, err_msg)
                self.finish()
            else:
                self.write(self.tabpy_state.get_endpoints(name))
                self.finish()

        except Exception as e:
            err_msg = format_exception(e, "update_endpoint")
            self.error_out(500, err_msg)
            self.finish()