diff --git a/app/controllers/projects/environments_controller.rb b/app/controllers/projects/environments_controller.rb
index 2252ece68ce9ccb0c5a3c9ffeae8a3def66d06e7..3b7240d8469f2bb20c777b25d872bd66333cff2b 100644
--- a/app/controllers/projects/environments_controller.rb
+++ b/app/controllers/projects/environments_controller.rb
@@ -28,6 +28,24 @@ class Projects::EnvironmentsController < Projects::ApplicationController
     end
   end
 
+  def folder
+    @environments = project.environments
+      .where(environment_type: params[:id])
+      .with_state(params[:scope] || :available)
+
+    respond_to do |format|
+      format.html
+      format.json do
+        render json: {
+          environments: EnvironmentSerializer
+            .new(project: @project, user: @current_user)
+            .with_pagination(request, response)
+            .represent(@environments),
+        }
+      end
+    end
+  end
+
   def show
     @deployments = environment.deployments.order(id: :desc).page(params[:page])
   end
diff --git a/config/routes/project.rb b/config/routes/project.rb
index 2ac98cf3842d62b90e10342157d720ef202be7fc..84f123ff7172c66e9bd1b0b71e4f3cfdfa4005de 100644
--- a/config/routes/project.rb
+++ b/config/routes/project.rb
@@ -156,6 +156,10 @@ constraints(ProjectUrlConstrainer.new) do
           get :terminal
           get '/terminal.ws/authorize', to: 'environments#terminal_websocket_authorize', constraints: { format: nil }
         end
+
+        collection do
+          get :folder, path: 'folders/:id'
+        end
       end
 
       resource :cycle_analytics, only: [:show]