Most of the API endpoints on this page have description on how to use the same function remotely except these service related endpoints. Are these useable remotely? If so I believe the format would be:
curl -X POST --header "Content-Type:application/json" \
--header "Authorization: Bearer <token here>" \
--data '{ "uuid" : "uuid of device", "data" : { "serviceName" : "name of service" } }' \
"https://api.balena.local/supervisor/v1/applications/{application id number}/restart-service"
I can’t see anyway to achieve this with the cli either. I have been doing this via SSH up to not but am trying to build myself some shortcut scripts.
Worst case I can make script open SSH - run command and close.
The operation on the supervisor you are trying to run is v2/applications/{application id number}/restart-service. It seems like you are trying to run v1/applications/{application id number}/restart-service.
Can you try the following?
curl -X POST --header "Content-Type:application/json" \
--header "Authorization: Bearer <token here>" \
--data '{ "uuid" : "uuid of device", "data" : { "serviceName" : "name of service" } }' \
"https://api.balena.local/supervisor/v2/applications/{application id number}/restart-service"