All the amazing docs, which help you to start are available here:

https://docs.microsoft.com/en-us/powerapps/maker/portals/web-api-perform-operations#update-and-delete-entities-using-the-web-api

https://docs.microsoft.com/en-us/powerapps/maker/portals/web-api-overview#web-api-operations

I was testing the scenario where we had to workaround with the plugin: prior portal Web API times 🙂 it wasn’t possible to deactivate a record from a portal with a status different from the default one. Now it’s super easy!

  1. I added a new inactive status for a testing purpose:
This image has an empty alt attribute; its file name is image-9.png

2. I updated Site Settings to include statecode and statuscode fields:

This image has an empty alt attribute; its file name is image-10.png

3. I added a script to update the record I wanted to deactivate:

	webapi.safeAjax = safeAjax;	})(window.webapi = window.webapi || {}, jQuery)    if (confirm('Update?')) {    alert('Thanks for confirming');  webapi.safeAjax({    type: "PATCH",    url: "/_api/tk_inspections(e4c23961-61f5-ea11-a815-000d3ad20d1d)",    contentType: "application/json",    data: JSON.stringify({      "statecode": 1,      "statuscode": 821350004 //Cancelled - custom new inactive value    }),    success: function (res) {      alert("Yay!")    }  });

4. It just worked! 😎

This image has an empty alt attribute; its file name is image-11.png

Happy days!