No, the marriage is not valid. You should remake the contract with the presence of the wali.
https://www.youtube.com/watch?v=SeGbVwG_RBg

I am a previously divorced mother of one child. Last week I had my nikah done. I originally asked my brother to be my wali and support me in the nikah but he refused. Therefore I appointed the imaam of the mosque to act as my wali. The nikah was then done in mosque with the presence of two witnesses and haq mehr (money) was paid to me. Is this marriage valid?

Invalid Marriages |