Is melatonin safe?

Cynthia
Is melatonin safe to use while pregnant? I just found out I'm pregnant and can't sleep at night the most hours of sleep I get at night is 2-3 hours the rest of the night I just toss and turn