Programmatically triggering re-rendering of RMarkdown document hosted on RStudioConnect

That's a really interesting setup, thanks for sharing that @dwhdai! Apologies for the delay in responding. I will definitely pass this along to the product team.

Unfortunately, there is not a publicly documented way to accomplish this today. Further, there may be some nuances around permissions and how the application has access to refresh the R Markdown report.

However, there is an experimental R package (connectapi) that recently added an exploration of this type of functionality. In particular, a workflow like the following might get you started:

library(connectapi)

client <- connect(host = "myhost", api_key = "my-api-key")

rmd_content <- content_item(client, "my-content-guid")

rmd_content_variant <- get_variant_default(rmd_content)

my_rendering <- variant_render(rmd_content_variant)

poll_task(my_rendering)

get_variant_renderings(rmd_content_variant)

I hope that's helpful! We would definitely love to receive any feedback you have about this process and whether there are additional things we can do to simplify the workflow. At a minimum, we definitely plan to have this type of API request more publicly documented in the future.