Using The RStudio Connect API to Gather Application Information


Since RStudio Connect 1.9.0, the URL string for applications hosted on RStudio Connect changed from displaying the Application ID to the GUID. Some administrators have reported the need to retain the ability to locate apps by their internal ID. Administrators can use the RStudio Connect Content API to view and manage content for applications hosted on Connect, including the GUID and Application IDs. This document serves as a guide for systems administrators who are hoping to find specific application information using the Connect API.

Note: The RStudio Connect API requires an appropriate license, please contact your Customer Success Rep if you are unsure if this is available.

Generate the API Key

API keys can be found in the Connect dashboard and are organized according to usernames.

Note: to use the Connect Content API, the API key will need to be generated from a user with the Admin role. 

Login to the RStudio Connect dashboard and navigate to People —> Users —> <Your Username>. Underneath the user profile click on “API Keys” and then “New API Key”. Finally, give the API Key a name, enter user credentials and save your API key somewhere safe.

Create an .Renviron File

From the Workbench or Desktop IDE instance, open the terminal and execute the below steps.

Please note: In RStudio Workbench you will need to have permission to edit the .Renviron file.

In the home folder of the user that will run the API code, execute the below:

$ sudo touch .Renviron
$ sudo vim .Renviron

# ~/.Renviron
#The CONNECT_SERVER URL must have a trailing slash.

After this is completed, save the file and then restart the R Session in the IDE. This can be done by going to Session —> Restart R

Create the Script

In the IDE, create an R script file (File —>  New File —>  R Script) with the below contents and run the entire block. 

title: "Get Content List"
output: html_notebook

connectServer <- Sys.getenv("CONNECT_SERVER")
apiKey <- Sys.getenv("CONNECT_API_KEY")


result <- GET(paste0(connectServer, '__api__/v1/content'),
add_headers(Authorization = paste("Key", apiKey)))


The output will then be displayed like the below:

[1] "ce8d2232-2a96-4146-9c02-da5564a1d7c2"

[1] "GesyerRedo-1656009359933"

[1] "GesyerRedo"

[1] ""

[1] "acl"









[1] "2022-06-23T18:36:00Z"

[1] "2022-06-23T18:46:27Z"

[1] "7"

[1] "shiny"

[1] ""


[1] "Local"


[1] "3.6.3"





[1] "57e0cafe-c8f5-469a-a105-592fb5f5f045"

[1] "<your_url>/content/ce8d2232-2a96-4146-9c02-da5564a1d7c2/"

[1] "<your_url>/connect/#/apps/ce8d2232-2a96-4146-9c02-da5564a1d7c2"

[1] "owner"

[1] "5"


The script output contains both the ID and the GUID for each application. Systems administrators can use the RStudio Connect Content API to generate this information, along with other useful data points such as timestamps and specific application process settings. That information can then be used to parse through server data related to RStudio Connect applications or given to the RStudio Support team if needed.