Trigger "Query Endpoints" via code

Hello!

Is there any way to trigger the “Query Endpoints” action (which lives under Investigation->Explore Contextual Data) via API?

Currently we have a script that lives in a workflow and needs to “login in R7 and then call the same sequence of backend calls that R7 Frontend does”.

Even filtering the correct POST calls in order to trigger an endpoint query is very tricky, error-prone and cumbersome.

Is there any way we can use the API to trigger Query Endpoints when an Investigation is created? What we would really like to do is to make sure investigations are enriched with some contextual data automatically.

Thanks!