Configure mqtt binding for items using the rest api

Hello, I’m using openhab2. I use the rest api to create a new item called lamp2. Is there any way I can configure mqtt binding for lamp2 item using the rest api?
For example lamp1: “Switch lamp1 {mqtt=”>[mqtt:control/lamp:command:ON:{“lamp1”\:“ON”}],>[mqtt:control/lamp:command:OFF:{“lamp1”\:“OFF”}]"}" (this is configured in the .items file)

Well, the syntax you are point out is the MQTT 1.x binding. None of the 1.x version bindings have any support through the REST API and therefore through the UIs. You can only configure an Item to use a 1.x version binding in .items files.

But, there is an MQTT 2.x version binding. And this one indeed can be configured through the REST API, though I would recommend creating your first Thing using PaperUI so you can look in the JSONDB to see how you need to format the JSON you need to pass to the REST API calls.

Thank you very much, I will try.