How to update multiple pins via api?

for battery operated device i would like to reduce the “online” time to a minimum.
actually, i’m in some similar situation like this: