This worked for me!
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$Credentials = @{
username = 'domain\username'
password = 'mypassword'
}
$Server = "av1.domain.local"
Invoke-RestMethod -SessionVariable ServerSession -Method Post -Uri "https://$Server/cv_api/sessions" -Body $Credentials
What resolved it was the first line.