Remote image manipulation via API

I am very new to UXP, so I have a few questions:
Is it possible to send/upload the selected image layer to remote service via API, then perform some manipulations on server and send it back (insert) as a new layer in Photoshop?
If so, how to do that? Any suggestions, code samples?