Gitpod gitpod.v1.EnvironmentService API

The gitpod.v1.EnvironmentService API from Gitpod — 15 operation(s) for gitpod.v1.environmentservice.

OpenAPI Specification

gitpod-gitpod-v1-environmentservice-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: gitpod.v1 gitpod.v1.AccountService gitpod.v1.EnvironmentService API
  version: v1.0.0
servers:
- url: https://api.gitpod.io
  description: Gitpod API
tags:
- name: gitpod.v1.EnvironmentService
  x-displayName: gitpod.v1.EnvironmentService
paths:
  /gitpod.v1.EnvironmentService/AllowPortAccess:
    servers: []
    post:
      deprecated: true
      description: "Deprecated: Use local validation with the environment state cache instead.\n\n Checks if the authenticated caller can access a specific port on an environment.\n This is called by the Runner Proxy to validate access tokens against current state.\n The caller's identity is extracted from the JWT in the request context.\n\n ### Examples\n\n - Check port access:\n\n   Verifies if the caller can access port 8080 on an environment.\n\n   ```yaml\n   environmentId: \"07e03a28-65a5-4d98-b532-8ea67b188048\"\n   port: 8080\n   ```"
      operationId: gitpod.v1.EnvironmentService.AllowPortAccess
      parameters: []
      requestBody:
        content:
          application/json:
            examples:
              check_port_access:
                description: Verifies if the caller can access port 8080 on an environment.
                value:
                  environmentId: 07e03a28-65a5-4d98-b532-8ea67b188048
                  port: 8080
            schema:
              $ref: '#/components/schemas/gitpod.v1.AllowPortAccessRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/gitpod.v1.AllowPortAccessResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
          description: Error
      security:
      - bearerAuth: []
      summary: AllowPortAccess
      tags:
      - gitpod.v1.EnvironmentService
  /gitpod.v1.EnvironmentService/CreateEnvironment:
    servers: []
    post:
      description: "Creates a development environment from a context URL (e.g. Git repository) and starts it.\n\n The `class` field must be a valid environment class ID. You can find a list of\n available environment classes with the `ListEnvironmentClasses` method.\n\n ### Examples\n\n - Create from context URL:\n\n   Creates an environment from a Git repository URL with default settings.\n\n   ```yaml\n   spec:\n     machine:\n       class: \"d2c94c27-3b76-4a42-b88c-95a85e392c68\"\n     content:\n       initializer:\n         specs:\n           - contextUrl:\n               url: \"https://github.com/gitpod-io/gitpod\"\n   ```\n\n - Create from Git repository:\n\n   Creates an environment from a Git repository with specific branch targeting.\n\n   ```yaml\n   spec:\n     machine:\n       class: \"d2c94c27-3b76-4a42-b88c-95a85e392c68\"\n     content:\n       initializer:\n         specs:\n           - git:\n               remoteUri: \"https://github.com/gitpod-io/gitpod\"\n               cloneTarget: \"main\"\n               targetMode: \"CLONE_TARGET_MODE_REMOTE_BRANCH\"\n   ```\n\n - Create with custom timeout and ports:\n\n   Creates an environment with custom inactivity timeout and exposed port configuration.\n\n   ```yaml\n   spec:\n     machine:\n       class: \"d2c94c27-3b76-4a42-b88c-95a85e392c68\"\n     content:\n       initializer:\n         specs:\n           - contextUrl:\n               url: \"https://github.com/gitpod-io/gitpod\"\n     timeout:\n       disconnected: \"7200s\"  # 2 hours in seconds\n     ports:\n       - port: 3000\n         admission: \"ADMISSION_LEVEL_EVERYONE\"\n         name: \"Web App\"\n   ```"
      operationId: gitpod.v1.EnvironmentService.CreateEnvironment
      parameters: []
      requestBody:
        content:
          application/json:
            examples:
              create_from_context_url:
                description: Creates an environment from a Git repository URL with default settings.
                value:
                  spec:
                    content:
                      initializer:
                        specs:
                        - contextUrl:
                            url: https://github.com/gitpod-io/gitpod
                    machine:
                      class: d2c94c27-3b76-4a42-b88c-95a85e392c68
              create_from_git_repository:
                description: Creates an environment from a Git repository with specific branch targeting.
                value:
                  spec:
                    content:
                      initializer:
                        specs:
                        - git:
                            cloneTarget: main
                            remoteUri: https://github.com/gitpod-io/gitpod
                            targetMode: CLONE_TARGET_MODE_REMOTE_BRANCH
                    machine:
                      class: d2c94c27-3b76-4a42-b88c-95a85e392c68
              create_with_custom_timeout_and_ports:
                description: Creates an environment with custom inactivity timeout and exposed port configuration.
                value:
                  spec:
                    content:
                      initializer:
                        specs:
                        - contextUrl:
                            url: https://github.com/gitpod-io/gitpod
                    machine:
                      class: d2c94c27-3b76-4a42-b88c-95a85e392c68
                    ports:
                    - admission: ADMISSION_LEVEL_EVERYONE
                      name: Web App
                      port: 3000
                    timeout:
                      disconnected: 7200s
            schema:
              $ref: '#/components/schemas/gitpod.v1.CreateEnvironmentRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/gitpod.v1.CreateEnvironmentResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
          description: Error
      security:
      - bearerAuth: []
      summary: CreateEnvironment
      tags:
      - gitpod.v1.EnvironmentService
  /gitpod.v1.EnvironmentService/CreateEnvironmentAccessToken:
    servers: []
    post:
      description: "Creates an access token for the environment.\n\n Generated tokens are valid for one hour and provide environment-specific access permissions.\n The token is scoped to a specific environment.\n\n ### Examples\n\n - Generate environment token:\n\n   Creates a temporary access token for accessing an environment.\n\n   ```yaml\n   environmentId: \"07e03a28-65a5-4d98-b532-8ea67b188048\"\n   ```"
      operationId: gitpod.v1.EnvironmentService.CreateEnvironmentAccessToken
      parameters: []
      requestBody:
        content:
          application/json:
            examples:
              generate_environment_token:
                description: Creates a temporary access token for accessing an environment.
                value:
                  environmentId: 07e03a28-65a5-4d98-b532-8ea67b188048
            schema:
              $ref: '#/components/schemas/gitpod.v1.CreateEnvironmentAccessTokenRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/gitpod.v1.CreateEnvironmentAccessTokenResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
          description: Error
      security:
      - bearerAuth: []
      summary: CreateEnvironmentAccessToken
      tags:
      - gitpod.v1.EnvironmentService
  /gitpod.v1.EnvironmentService/CreateEnvironmentFromProject:
    servers: []
    post:
      description: "Creates an environment from an existing project configuration and starts it.\n\n This method uses project settings as defaults but allows overriding specific\n configurations. Project settings take precedence over default configurations,\n while custom specifications in the request override project settings.\n\n ### Examples\n\n - Create with project defaults:\n\n   Creates an environment using all default settings from the project configuration.\n\n   ```yaml\n   projectId: \"b0e12f6c-4c67-429d-a4a6-d9838b5da047\"\n   ```\n\n - Create with custom compute resources:\n\n   Creates an environment from project with custom machine class and timeout settings.\n\n   ```yaml\n   projectId: \"b0e12f6c-4c67-429d-a4a6-d9838b5da047\"\n   spec:\n     machine:\n       class: \"d2c94c27-3b76-4a42-b88c-95a85e392c68\"\n     timeout:\n       disconnected: \"14400s\"  # 4 hours in seconds\n   ```"
      operationId: gitpod.v1.EnvironmentService.CreateEnvironmentFromProject
      parameters: []
      requestBody:
        content:
          application/json:
            examples:
              create_with_custom_compute_resources:
                description: Creates an environment from project with custom machine class and timeout settings.
                value:
                  projectId: b0e12f6c-4c67-429d-a4a6-d9838b5da047
                  spec:
                    machine:
                      class: d2c94c27-3b76-4a42-b88c-95a85e392c68
                    timeout:
                      disconnected: 14400s
              create_with_project_defaults:
                description: Creates an environment using all default settings from the project configuration.
                value:
                  projectId: b0e12f6c-4c67-429d-a4a6-d9838b5da047
            schema:
              $ref: '#/components/schemas/gitpod.v1.CreateEnvironmentFromProjectRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/gitpod.v1.CreateEnvironmentFromProjectResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
          description: Error
      security:
      - bearerAuth: []
      summary: CreateEnvironmentFromProject
      tags:
      - gitpod.v1.EnvironmentService
  /gitpod.v1.EnvironmentService/CreateEnvironmentLogsToken:
    servers: []
    post:
      description: "Creates an access token for retrieving environment logs.\n\n Generated tokens are valid for one hour and provide read-only access\n to the environment's logs.\n\n ### Examples\n\n - Generate logs token:\n\n   Creates a temporary access token for retrieving environment logs.\n\n   ```yaml\n   environmentId: \"07e03a28-65a5-4d98-b532-8ea67b188048\"\n   ```"
      operationId: gitpod.v1.EnvironmentService.CreateEnvironmentLogsToken
      parameters: []
      requestBody:
        content:
          application/json:
            examples:
              generate_logs_token:
                description: Creates a temporary access token for retrieving environment logs.
                value:
                  environmentId: 07e03a28-65a5-4d98-b532-8ea67b188048
            schema:
              $ref: '#/components/schemas/gitpod.v1.CreateEnvironmentLogsTokenRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/gitpod.v1.CreateEnvironmentLogsTokenResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
          description: Error
      security:
      - bearerAuth: []
      summary: CreateEnvironmentLogsToken
      tags:
      - gitpod.v1.EnvironmentService
  /gitpod.v1.EnvironmentService/CreatePortAccessToken:
    servers: []
    post:
      description: "Creates an access token for a specific port on an environment.\n\n The token grants access to the specified port based on the port's admission level.\n Tokens are short-lived (~1 hour) with refresh tokens for long-running connections.\n\n ### Examples\n\n - Generate port access token:\n\n   Creates a token for accessing port 8080 on an environment.\n\n   ```yaml\n   environmentId: \"07e03a28-65a5-4d98-b532-8ea67b188048\"\n   port: 8080\n   ```"
      operationId: gitpod.v1.EnvironmentService.CreatePortAccessToken
      parameters: []
      requestBody:
        content:
          application/json:
            examples:
              generate_port_access_token:
                description: Creates a token for accessing port 8080 on an environment.
                value:
                  environmentId: 07e03a28-65a5-4d98-b532-8ea67b188048
                  port: 8080
            schema:
              $ref: '#/components/schemas/gitpod.v1.CreatePortAccessTokenRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/gitpod.v1.CreatePortAccessTokenResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
          description: Error
      security:
      - bearerAuth: []
      summary: CreatePortAccessToken
      tags:
      - gitpod.v1.EnvironmentService
  /gitpod.v1.EnvironmentService/DeleteEnvironment:
    servers: []
    post:
      description: "Permanently deletes an environment.\n\n Running environments are automatically stopped before deletion. If force\n is true, the environment is deleted immediately without graceful shutdown.\n\n ### Examples\n\n - Delete with graceful shutdown:\n\n   Deletes an environment after gracefully stopping it.\n\n   ```yaml\n   environmentId: \"07e03a28-65a5-4d98-b532-8ea67b188048\"\n   force: false\n   ```\n\n - Force delete:\n\n   Immediately deletes an environment without waiting for graceful shutdown.\n\n   ```yaml\n   environmentId: \"07e03a28-65a5-4d98-b532-8ea67b188048\"\n   force: true\n   ```"
      operationId: gitpod.v1.EnvironmentService.DeleteEnvironment
      parameters: []
      requestBody:
        content:
          application/json:
            examples:
              delete_with_graceful_shutdown:
                description: Deletes an environment after gracefully stopping it.
                value:
                  environmentId: 07e03a28-65a5-4d98-b532-8ea67b188048
                  force: false
              force_delete:
                description: Immediately deletes an environment without waiting for graceful shutdown.
                value:
                  environmentId: 07e03a28-65a5-4d98-b532-8ea67b188048
                  force: true
            schema:
              $ref: '#/components/schemas/gitpod.v1.DeleteEnvironmentRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/gitpod.v1.DeleteEnvironmentResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
          description: Error
      security:
      - bearerAuth: []
      summary: DeleteEnvironment
      tags:
      - gitpod.v1.EnvironmentService
  /gitpod.v1.EnvironmentService/GetEnvironment:
    servers: []
    post:
      description: "Gets details about a specific environment including its status, configuration, and context URL.\n\n Use this method to:\n - Check if an environment is ready to use\n - Get connection details for IDE and exposed ports\n - Monitor environment health and resource usage\n - Debug environment setup issues\n\n ### Examples\n\n - Get environment details:\n\n   Retrieves detailed information about a specific environment using its unique identifier.\n\n   ```yaml\n   environmentId: \"07e03a28-65a5-4d98-b532-8ea67b188048\"\n   ```"
      operationId: gitpod.v1.EnvironmentService.GetEnvironment
      parameters: []
      requestBody:
        content:
          application/json:
            examples:
              get_environment_details:
                description: Retrieves detailed information about a specific environment using its unique identifier.
                value:
                  environmentId: 07e03a28-65a5-4d98-b532-8ea67b188048
            schema:
              $ref: '#/components/schemas/gitpod.v1.GetEnvironmentRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/gitpod.v1.GetEnvironmentResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
          description: Error
      security:
      - bearerAuth: []
      summary: GetEnvironment
      tags:
      - gitpod.v1.EnvironmentService
  /gitpod.v1.EnvironmentService/ListEnvironmentClasses:
    servers: []
    post:
      description: "Lists available environment classes with their specifications and resource limits.\n\n Use this method to understand what types of environments you can create and their\n capabilities. Environment classes define the compute resources and features available\n to your environments.\n\n ### Examples\n\n - List all available classes:\n\n   Retrieves a list of all environment classes with their specifications.\n\n   ```yaml\n   {}\n   ```\n buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE"
      operationId: gitpod.v1.EnvironmentService.ListEnvironmentClasses
      parameters:
      - in: query
        name: pageSize
        schema:
          default: 25
          maximum: 100
          minimum: 0
          type: integer
      - in: query
        name: token
        schema:
          default: ''
          type: string
      requestBody:
        content:
          application/json:
            examples:
              list_all_available_classes:
                description: Retrieves a list of all environment classes with their specifications.
                value: {}
            schema:
              $ref: '#/components/schemas/gitpod.v1.ListEnvironmentClassesRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/gitpod.v1.ListEnvironmentClassesResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
          description: Error
      security:
      - bearerAuth: []
      summary: ListEnvironmentClasses
      tags:
      - gitpod.v1.EnvironmentService
  /gitpod.v1.EnvironmentService/ListEnvironments:
    servers: []
    post:
      description: "Lists all environments matching the specified criteria.\n\n Use this method to find and monitor environments across your organization.\n Results are ordered by creation time with newest environments first.\n\n ### Examples\n\n - List running environments for a project:\n\n   Retrieves all running environments for a specific project with pagination.\n\n   ```yaml\n   filter:\n     statusPhases: [\"ENVIRONMENT_PHASE_RUNNING\"]\n     projectIds: [\"b0e12f6c-4c67-429d-a4a6-d9838b5da047\"]\n   pagination:\n     pageSize: 10\n   ```\n\n - List all environments for a specific runner:\n\n   Filters environments by runner ID and creator ID.\n\n   ```yaml\n   filter:\n     runnerIds: [\"e6aa9c54-89d3-42c1-ac31-bd8d8f1concentrate\"]\n     creatorIds: [\"f53d2330-3795-4c5d-a1f3-453121af9c60\"]\n   ```\n\n - List stopped and deleted environments:\n\n   Retrieves all environments in stopped or deleted state.\n\n   ```yaml\n   filter:\n     statusPhases: [\"ENVIRONMENT_PHASE_STOPPED\", \"ENVIRONMENT_PHASE_DELETED\"]\n   ```"
      operationId: gitpod.v1.EnvironmentService.ListEnvironments
      parameters:
      - in: query
        name: pageSize
        schema:
          default: 25
          maximum: 100
          minimum: 0
          type: integer
      - in: query
        name: token
        schema:
          default: ''
          type: string
      requestBody:
        content:
          application/json:
            examples:
              list_all_environments_for_a_specific_runner:
                description: Filters environments by runner ID and creator ID.
                value:
                  filter:
                    creatorIds:
                    - f53d2330-3795-4c5d-a1f3-453121af9c60
                    runnerIds:
                    - e6aa9c54-89d3-42c1-ac31-bd8d8f1concentrate
              list_running_environments_for_a_project:
                description: Retrieves all running environments for a specific project with pagination.
                value:
                  filter:
                    projectIds:
                    - b0e12f6c-4c67-429d-a4a6-d9838b5da047
                    statusPhases:
                    - ENVIRONMENT_PHASE_RUNNING
                  pagination:
                    pageSize: 10
              list_stopped_and_deleted_environments:
                description: Retrieves all environments in stopped or deleted state.
                value:
                  filter:
                    statusPhases:
                    - ENVIRONMENT_PHASE_STOPPED
                    - ENVIRONMENT_PHASE_DELETED
            schema:
              $ref: '#/components/schemas/gitpod.v1.ListEnvironmentsRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/gitpod.v1.ListEnvironmentsResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
          description: Error
      security:
      - bearerAuth: []
      summary: ListEnvironments
      tags:
      - gitpod.v1.EnvironmentService
  /gitpod.v1.EnvironmentService/MarkEnvironmentActive:
    servers: []
    post:
      description: "Records environment activity to prevent automatic shutdown.\n\n Activity signals should be sent every 5 minutes while the environment\n is actively being used. The source must be between 3-80 characters.\n\n ### Examples\n\n - Signal VS Code activity:\n\n   Records VS Code editor activity to prevent environment shutdown.\n\n   ```yaml\n   environmentId: \"07e03a28-65a5-4d98-b532-8ea67b188048\"\n   activitySignal:\n     source: \"VS Code\"\n     timestamp: \"2025-02-12T14:30:00Z\"\n   ```"
      operationId: gitpod.v1.EnvironmentService.MarkEnvironmentActive
      parameters: []
      requestBody:
        content:
          application/json:
            examples:
              signal_vs_code_activity:
                description: Records VS Code editor activity to prevent environment shutdown.
                value:
                  activitySignal:
                    source: VS Code
                    timestamp: '2025-02-12T14:30:00Z'
                  environmentId: 07e03a28-65a5-4d98-b532-8ea67b188048
            schema:
              $ref: '#/components/schemas/gitpod.v1.MarkEnvironmentActiveRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/gitpod.v1.MarkEnvironmentActiveResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
          description: Error
      security:
      - bearerAuth: []
      summary: MarkEnvironmentActive
      tags:
      - gitpod.v1.EnvironmentService
  /gitpod.v1.EnvironmentService/StartEnvironment:
    servers: []
    post:
      description: "Starts a stopped environment.\n\n Use this method to resume work on a previously stopped environment. The environment\n retains its configuration and workspace content from when it was stopped.\n\n ### Examples\n\n - Start an environment:\n\n   Resumes a previously stopped environment with its existing configuration.\n\n   ```yaml\n   environmentId: \"07e03a28-65a5-4d98-b532-8ea67b188048\"\n   ```"
      operationId: gitpod.v1.EnvironmentService.StartEnvironment
      parameters: []
      requestBody:
        content:
          application/json:
            examples:
              start_an_environment:
                description: Resumes a previously stopped environment with its existing configuration.
                value:
                  environmentId: 07e03a28-65a5-4d98-b532-8ea67b188048
            schema:
              $ref: '#/components/schemas/gitpod.v1.StartEnvironmentRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/gitpod.v1.StartEnvironmentResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
          description: Error
      security:
      - bearerAuth: []
      summary: StartEnvironment
      tags:
      - gitpod.v1.EnvironmentService
  /gitpod.v1.EnvironmentService/StopEnvironment:
    servers: []
    post:
      description: "Stops a running environment.\n\n Use this method to pause work while preserving the environment's state.\n The environment can be resumed later using StartEnvironment.\n\n ### Examples\n\n - Stop an environment:\n\n   Gracefully stops a running environment while preserving its state.\n\n   ```yaml\n   environmentId: \"07e03a28-65a5-4d98-b532-8ea67b188048\"\n   ```"
      operationId: gitpod.v1.EnvironmentService.StopEnvironment
      parameters: []
      requestBody:
        content:
          application/json:
            examples:
              stop_an_environment:
                description: Gracefully stops a running environment while preserving its state.
                value:
                  environmentId: 07e03a28-65a5-4d98-b532-8ea67b188048
            schema:
              $ref: '#/components/schemas/gitpod.v1.StopEnvironmentRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/gitpod.v1.StopEnvironmentResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
          description: Error
      security:
      - bearerAuth: []
      summary: StopEnvironment
      tags:
      - gitpod.v1.EnvironmentService
  /gitpod.v1.EnvironmentService/UnarchiveEnvironment:
    servers: []
    post:
      description: "Unarchives an environment.\n\n ### Examples\n\n - Unarchive an environment:\n\n   ```yaml\n   environmentId: \"07e03a28-65a5-4d98-b532-8ea67b188048\"\n   ```"
      operationId: gitpod.v1.EnvironmentService.UnarchiveEnvironment
      parameters: []
      requestBody:
        content:
          application/json:
            examples:
              unarchive_an_environment:
                description: 'environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048"

                  '
                value:
                  environmentId: 07e03a28-65a5-4d98-b532-8ea67b188048
            schema:
              $ref: '#/components/schemas/gitpod.v1.UnarchiveEnvironmentRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/gitpod.v1.UnarchiveEnvironmentResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
          description: Error
      security:
      - bearerAuth: []
      summary: UnarchiveEnvironment
      tags:
      - gitpod.v1.EnvironmentService
  /gitpod.v1.EnvironmentService/UpdateEnvironment:
    servers: []
    post:
      description: "Updates an environment's configuration while it is running.\n\n Updates are limited to:\n - Git credentials (username, email)\n - SSH public keys\n - Content initialization\n - Port configurations\n - Automation files\n - Environment timeouts\n\n ### Examples\n\n - Update Git credentials:\n\n   Updates the Git configuration for the environment.\n\n   ```yaml\n   environmentId: \"07e03a28-65a5-4d98-b532-8ea67b188048\"\n   spec:\n     content:\n       gitUsername: \"example-user\"\n       gitEmail: \"user@example.com\"\n   ```\n\n - Add SSH public key:\n\n   Adds a new SSH public key for authentication.\n\n   ```yaml\n   environmentId: \"07e03a28-65a5-4d98-b532-8ea67b188048\"\n   spec:\n     sshPublicKeys:\n       - id: \"0194b7c1-c954-718d-91a4-9a742aa5fc11\"\n         value: \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI...\"\n   ```\n\n - Update content session:\n\n   Updates the content session identifier for the environment.\n\n   ```yaml\n   environmentId: \"07e03a28-65a5-4d98-b532-8ea67b188048\"\n   spec:\n     content:\n       session: \"0194b7c1-c954-718d-91a4-9a742aa5fc11\"\n   ```\n\n Note: Machine class changes require stopping the environment and creating a new one."
      operationId: gitpod.v1.EnvironmentService.UpdateEnvironment
      parameters: []
      requestBody:
        content:
          application/json:
            examples:
              add_ssh_public_key:
                description: Adds a new SSH public key for authentication.
                value:
                  environmentId: 07e03a28-65a5-4d98-b532-8ea67b188048
                  spec:
                    sshPublicKeys:
                    - id: 0194b7c1-c954-718d-91a4-9a742aa5fc11
                      value: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI...
              update_content_session:
                description: Updates the content session identifier for the environment.
                value:
                  environmentId: 07e03a28-65a5-4d98-b532-8ea67b188048
                  spec:
                    content:
                      session: 0194b7c1-c954-718d-91a4-9a742aa5fc11
              update_git_credentials:
                description: Updates the Git configuration for the environment.
                value:
                  environmentId: 07e03a28-65a5-4d98-b532-8ea67b188048
                  spec:
                    content:
                      gitEmail: user@example.com
                      gitUsername: example-user
            schema:
              $ref: '#/components/schemas/gitpod.v1.UpdateEnvironmentRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/gitpod.v1.UpdateEnvironmentResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
          description: Error
      security:
      - bearerAuth: []
      summary: UpdateEnvironment
      tags:
      - gitpod.v1.EnvironmentService
components:
  schemas:
    gitpod.v1.EnvironmentStatus.DevContainer.Phase:
      enum:
      - PHASE_UNSPECIFIED
      - PHASE_CREATING
      - PHASE_RUNNING
      - PHASE_STOPPED
      - PHASE_FAILED
      title: Phase
      type: string
    gitpod.v1.CreateEnvironmentFromProjectRequest:
      additionalProperties: false
      properties:
        annotations:
          additionalProperties:
            title: value
            type: string
          description: annotations are key/value pairs attached to the environment metadata.
          title: annotations
          type: object
          x-stainless-skip: true
        name:
          description: "name is a user-defined identifier for the environment.\n If not specified, the system will generate a name."
          maxLength: 80
          nullable: true
          title: name
          type: string
        projectId:
          format: uuid
          title: project_id
          type: string
        sessionId:
          description: "session_id is the ID of the session this environment belongs to.\n If

# --- truncated at 32 KB (117 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/gitpod/refs/heads/main/openapi/gitpod-gitpod-v1-environmentservice-api-openapi.yml