Seems to also apply to modelTemplateAdd and modelTemplateRename (potentially others too).
import requests
response = requests.post('http://localhost:8765', json = {
'action': 'modelTemplateRename',
'version': 6,
'params': {
'modelName': 'Basic',
'oldTemplateName': 'Card 1',
'newTemplateName': 'Card 1 renamed'
}
})
print(response.text)
curl -X POST -H "Content-Type: application/json" -d "{\"action\": \"modelTemplateRename\", \"version\": 6, \"params\": {\"modelName\": \"Basic\", \"oldTemplateName\": \"Card 1\", \"newTemplateName\": \"Card 1 renamed\"}}" http://localhost:8765
Always results in {"result": null, "error": "unsupported action"} no matter which versions, model names, or template names I use and the same applies to the other two actions.
Line of code with that string: https://github.com/FooSoft/anki-connect/blob/master/plugin/__init__.py#L128