Return a Value From a X-Callback-Url to a Variable in KM

I am trying to use an x-callback-url which returns a JSON object to set a variable in KM. I understand that for this to work somebody (KM) rshould register a mechanism to handle the x-success callback. Is there such a mechanism? I can't find it. I can do this using the Shortcuts on iOS or Scriptable on iOS. Any suggestions for how to do this on MacOS would be much appreciated.

This has worked well for me.

I use this 5 year old little CLI tool too for getting x-callback data from applications, but I really feel like Keyboard Maestro could easily integrate this functionality more elegantly.