build ws endpoint