Create unique temporary endpoint and wait for payload

Is there a way to create a temporary endpoint from within a running endpoint and wait/receive the POST data and continue processing? We have a workflow that uses an RMM scheduling engine to execute scripts on remote machines. These scripts call back to an endpoint to provide the results. We can use PSU to schedule these scripts with the RMM API (scheduling usually takes 1-5min), but need a way to get the results back to PSU. Is something like this possible with PSU?

Should technically be possible…

I’m assuming you want PSU to schedule a script to request the information, then ingest the result via an API endpoint that self-destructs.

So you’ll need to do a New-PSUEndpoint in the script, then have the Endpoint do a Remove-PSUEndpoint.

Thanks Jori. I looked at creating/destroying endpoints via the cmdlets, but what I don’t understand is how I can get the POST data from the created endpoint to the original calling endpoint.

What I need is something like this:

External form submits data to /endpoint1.
/endpoint1 creates /endpoint2
/endpoint1 submits job to external RMM scheduler via API calls and provides /endpoint2 url
/endpoint1 waits for data submitted to /endpoint2
/endpoint1 receives data from /endpoint2 and continues