> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baseten.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Update interactive session

> Updates specific fields on a training job's interactive session. Only provided (non-null) fields are updated.



## OpenAPI

````yaml patch /v1/training_projects/{training_project_id}/jobs/{training_job_id}/interactive_sessions/{session_id}
openapi: 3.1.0
info:
  description: REST API for management of Baseten resources
  title: Baseten management API
  version: 1.0.0
servers:
  - url: https://api.baseten.co
security:
  - BearerAuth: []
paths:
  /v1/training_projects/{training_project_id}/jobs/{training_job_id}/interactive_sessions/{session_id}:
    parameters:
      - $ref: '#/components/parameters/training_project_id'
      - $ref: '#/components/parameters/training_job_id'
      - $ref: '#/components/parameters/session_id'
    patch:
      summary: Patches an interactive session
      description: >-
        Updates specific fields on a training job's interactive session. Only
        provided (non-null) fields are updated.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchInteractiveSessionRequestV1'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatchInteractiveSessionResponseV1'
      x-codeSamples:
        - lang: bash
          source: >-
            curl --request PATCH \

            --url
            https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/interactive_sessions/{session_id}
            \

            --header "Authorization: Bearer $BASETEN_API_KEY" \

            --data '{
              "timeout_minutes": null,
              "trigger": null
            }'
        - lang: python
          source: >-
            import requests

            import os

            API_KEY = os.environ.get("BASETEN_API_KEY", "<YOUR_API_KEY>")

            url =
            "https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/interactive_sessions/{session_id}"


            headers = {"Authorization": f"Bearer {API_KEY}"}


            response = requests.request(
                "PATCH",
                url,
                headers=headers,
                json={'timeout_minutes': None, 'trigger': None}
            )


            print(response.text)
components:
  parameters:
    training_project_id:
      schema:
        type: string
      name: training_project_id
      in: path
      required: true
    training_job_id:
      schema:
        type: string
      name: training_job_id
      in: path
      required: true
    session_id:
      schema:
        type: string
      name: session_id
      in: path
      required: true
  schemas:
    PatchInteractiveSessionRequestV1:
      description: |-
        Request to patch an interactive session.

        Only fields that are provided (non-None) will be applied.
      properties:
        timeout_minutes:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          description: >-
            For on_startup sessions, minutes to add to the expiration. For
            on_demand/on_failure sessions, minutes to add to the timeout. Use -1
            for infinite timeout (bumps by 10 years).
          title: Timeout Minutes
        trigger:
          anyOf:
            - $ref: '#/components/schemas/V1InteractiveSessionTrigger'
            - type: 'null'
          default: null
          description: >-
            Update when the interactive session is created. Cannot be changed if
            the session trigger is 'on_startup'.
      title: PatchInteractiveSessionRequestV1
      type: object
    PatchInteractiveSessionResponseV1:
      description: Response after patching an interactive session.
      properties:
        interactive_session:
          $ref: '#/components/schemas/InteractiveSessionV1'
          description: The updated interactive session.
        message:
          description: Human-readable summary of what was updated.
          title: Message
          type: string
      required:
        - interactive_session
        - message
      title: PatchInteractiveSessionResponseV1
      type: object
    V1InteractiveSessionTrigger:
      enum:
        - on_startup
        - on_failure
        - on_demand
      title: V1InteractiveSessionTrigger
      type: string
    InteractiveSessionV1:
      description: Representation of a training job interactive session.
      properties:
        id:
          description: Unique identifier of the interactive session.
          title: Id
          type: string
        trigger:
          description: When the interactive session is created.
          title: Trigger
          type: string
        timeout_minutes:
          description: Minutes before the session times out.
          title: Timeout Minutes
          type: integer
        session_provider:
          description: The IDE client for the session.
          title: Session Provider
          type: string
        auth_provider:
          description: The authentication provider for the session.
          title: Auth Provider
          type: string
        pod_name:
          description: Pod name / node rank for the session.
          title: Pod Name
          type: string
        expires_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          default: null
          description: When the session expires, in ISO 8601 format.
          title: Expires At
        tunnel_name:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The tunnel name for the session.
          title: Tunnel Name
        auth_code:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The device authentication code.
          title: Auth Code
        auth_url:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: URL where the user should enter the auth code.
          title: Auth Url
        auth_code_generated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          default: null
          description: When the auth code was generated.
          title: Auth Code Generated At
        authenticated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          default: null
          description: When the session was authenticated.
          title: Authenticated At
        working_directory:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The working directory of the session.
          title: Working Directory
      required:
        - id
        - trigger
        - timeout_minutes
        - session_provider
        - auth_provider
        - pod_name
      title: InteractiveSessionV1
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send `Authorization: Bearer <api_key>`. The legacy `Authorization:
        Api-Key <api_key>` scheme is also accepted.

````