ERROR - API syntax for /firmware/actions/upgrade

Hi, I got a problem with firmware upgrade through API. I need help with syntax (at least I think that it is syntax, still new to this).
Here is the code I need help with:

url_firmUpg = f"{baseUrl}/firmware/actions/upgrade"
header_firmUpg = {“Authorization”: f"Bearer {token}"}
data_firmUpg = {“keep_settings”: “true”}
response_firmUpg =,


This is the error message:
{‘success’: False, ‘errors’: [{‘source’: ‘Validation’, ‘code’: 102, ‘error’: ‘No arguments provided for action’, ‘section’: ‘upgrade’}]}

I know that I am missing something but I can’t find what, even on Teltonika Networks website under firmware/actions/upgrade there is only this:

    "data": {
        "keep_settings": "string"

Thanks in advance for your help.

You need to add the data object as described in the documentation. The correct POST json should be:

data_firmUpg = {"data": {"keep_settings": "1"}}

Thanks for reply, but even with this it doesn’t work. This time when you change it to this:

I get this error:
{‘success’: False, ‘errors’: [{‘source’: ‘JSON body’, ‘code’: 122, ‘error’: ‘unexpected character’}]}

(if you change “1” to “true” it’s the same)

Ok I found what I did wrong, I used in: “…, header=…, data=data_firmUpg)”, but I needed to change “data” to “json” like this: “…, header=…, json=data_firmUpg)”

pwsh thanks for the help with this :heart:

1 Like

This topic was automatically closed 40 hours after the last reply. New replies are no longer allowed.