When I manually sftp using username and password it works fine, when using curl it fails. The same script will successfully connect to other servers with no problem. Because
thanks and for publickey authentication :
curl -v -k --pubkey ~/.ssh/id_rsa.pub sftp://username@host/