API help needed.

What would be ananalog API command to this?

/ip dhcp-server lease set [find mac-address= && address=] address-list=klienti

You first do

/ip/dhcp-server/lease/print
=.proplist=.id
?mac-address=<some mac>
?address=<some ip>
?#&

in order to get what would look something like

!re
=.id=*ab12

!done

You must then extract the value in “.id”, and with it, do

/ip/dhcp-server/lease/set
=numbers=*ab12
=address-list=klienti

in order to do the set.

The exact code (or lack thereof) depends on the API client you’re using, but that’s the protocol flow that needs to happen.

Thank You! Works like a charm!