conditional – When I insert an if block into the ScheduledTask, I’m entering the password and the program is closing

I’m new in Mathematica. So I’m unable to settle a matter. When I insert an if block into the ScheduledTask, I’m entering the password and the program is closing. What is my mistake? Can you help me please?

obj = SessionSubmit[
       ScheduledTask[
      If[URLRead[
     "https://api.archis.company/welcome", {"StatusCode", 
     "Body"}] == 
     <|"StatusCode" -> 200, "Body" -> ""Welcome To ArchisAcademy API!""|>, 
      SendMail["wlmailtest@wolfram.com", 
      "Here is the body of the message."]],
      {Quantity[1, "Seconds"], 30}]]