To test API, for simplicity, you can do as below, it works for me.
configure
set service https api keys id MY-HTTPS-API-ID key MY-HTTPS-API-PLAINTEXT-KEY
commit
save
curl -k --location --request POST 'https://${IP-VyOS}/configure' \
--form data='{"op": "set", "path": ["interfaces", "dummy", "dum1", "address", "10.11.0.1/32"]}' \
--form key='MY-HTTPS-API-PLAINTEXT-KEY'
If you need certificate, you can consider to use Certbot Lets Encrypt.
set service https certificates certbot domain-name api.example.com
set service https certificates certbot email [email protected]
set service https virtual-host api server-name api.example.com
commit
save