> ## Documentation Index
> Fetch the complete documentation index at: https://test-8862363a-tembo-docs-commit-attribution-preference.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a session

> Update the configuration of a session you have permission to access.



## OpenAPI

````yaml https://api.tembo.io/public-api/openapi/public patch /v1/sessions/{sessionId}
openapi: 3.1.0
info:
  title: Tembo Public API
  description: >-
    Manage agents, sessions, repositories, and organization resources with the
    Tembo API.
  version: 1.0.0
servers:
  - url: https://api.tembo.io
    description: Tembo API
  - url: https://{deployment-origin}/api/public-api
    description: Self-hosted Tembo
    variables:
      deployment-origin:
        default: tembo.example.com
        description: Hostname of your self-hosted Tembo deployment
security: []
paths:
  /v1/sessions/{sessionId}:
    patch:
      tags:
        - Sessions
      summary: Update a session
      description: Update the configuration of a session you have permission to access.
      operationId: updateSession
      parameters:
        - in: path
          name: sessionId
          schema:
            type: string
            format: uuid
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                agent:
                  type:
                    - string
                    - 'null'
                  minLength: 1
                  maxLength: 500
                agentOptions:
                  $ref: '#/components/schemas/AgentOptions'
                baseBranch:
                  type:
                    - string
                    - 'null'
                  minLength: 1
                  maxLength: 500
                branchName:
                  type:
                    - string
                    - 'null'
                  minLength: 1
                  maxLength: 500
                description:
                  type: string
                  minLength: 1
                  maxLength: 1000000
                richContent:
                  oneOf:
                    - $ref: '#/components/schemas/SessionTipTapDocument'
                    - type: 'null'
                level:
                  type: integer
                  minimum: 0
                  maximum: 100
                mcpServers:
                  type: array
                  items:
                    type: string
                    minLength: 1
                    maxLength: 500
                  maxItems: 100
                mode:
                  type: string
                  enum:
                    - normal
                    - planning
                projectId:
                  type:
                    - string
                    - 'null'
                sandboxSize:
                  type:
                    - string
                    - 'null'
                  enum:
                    - nano
                    - micro
                    - small
                    - medium
                    - large
                    - xl
                    - xxl
                    - ultra
                    - null
                targetBranch:
                  type:
                    - string
                    - 'null'
                  minLength: 1
                  maxLength: 500
                title:
                  type: string
                  minLength: 1
                  maxLength: 1000
                visibility:
                  type: string
                  enum:
                    - private
                    - public
              additionalProperties: false
      responses:
        '200':
          description: Update a session
          content:
            application/json:
              schema:
                type: object
                properties:
                  agent:
                    type:
                      - string
                      - 'null'
                  agentId:
                    type:
                      - string
                      - 'null'
                    format: uuid
                  artifactType:
                    type:
                      - string
                      - 'null'
                    enum:
                      - PullRequest
                      - ToolCall
                      - Plan
                      - Response
                      - File
                      - Service
                      - Source
                      - null
                  baseBranch:
                    type:
                      - string
                      - 'null'
                  branchName:
                    type:
                      - string
                      - 'null'
                  createdAt:
                    type: string
                    format: date-time
                  externalId:
                    type:
                      - string
                      - 'null'
                  externalUrl:
                    type:
                      - string
                      - 'null'
                  id:
                    type: string
                    format: uuid
                  kind:
                    type: string
                  lastQueuedAt:
                    type:
                      - string
                      - 'null'
                    format: date-time
                  lastSeenAt:
                    type: string
                    format: date-time
                  level:
                    type: integer
                  mode:
                    type: string
                    enum:
                      - normal
                      - planning
                    default: normal
                  projectId:
                    type:
                      - string
                      - 'null'
                  sandboxSize:
                    type:
                      - string
                      - 'null'
                    enum:
                      - nano
                      - micro
                      - small
                      - medium
                      - large
                      - xl
                      - xxl
                      - ultra
                      - null
                  sessionType:
                    type: string
                    enum:
                      - Chat
                      - Terminal
                    default: Chat
                  targetBranch:
                    type:
                      - string
                      - 'null'
                  title:
                    type: string
                  updatedAt:
                    type: string
                    format: date-time
                  visibility:
                    type: string
                    enum:
                      - public
                      - private
                    default: public
                  artifacts:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                        type:
                          type: string
                          enum:
                            - PullRequest
                            - ToolCall
                            - Plan
                            - Response
                            - File
                            - Service
                            - Source
                        createdAt:
                          type: string
                          format: date-time
                        updatedAt:
                          type: string
                          format: date-time
                        pullRequests:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: string
                                format: uuid
                              url:
                                type: string
                                format: uri
                              title:
                                type:
                                  - string
                                  - 'null'
                              status:
                                type: string
                                enum:
                                  - open
                                  - merged
                                  - closed
                              isDraft:
                                type: boolean
                              sourceBranch:
                                type:
                                  - string
                                  - 'null'
                              createdAt:
                                type: string
                                format: date-time
                              agent:
                                type:
                                  - string
                                  - 'null'
                              diff:
                                type:
                                  - object
                                  - 'null'
                                properties:
                                  additions:
                                    type: integer
                                    minimum: 0
                                  deletions:
                                    type: integer
                                    minimum: 0
                                  data:
                                    type: string
                                    maxLength: 1000000
                              updatedAt:
                                type: string
                                format: date-time
                              baseBranch:
                                type:
                                  - string
                                  - 'null'
                                maxLength: 500
                              headSha:
                                type:
                                  - string
                                  - 'null'
                                maxLength: 200
                              author:
                                type:
                                  - object
                                  - 'null'
                                properties:
                                  avatarUrl:
                                    type:
                                      - string
                                      - 'null'
                                    format: uri
                                  login:
                                    type:
                                      - string
                                      - 'null'
                                    maxLength: 500
                                required:
                                  - avatarUrl
                                  - login
                                additionalProperties: false
                              codeRepository:
                                type:
                                  - object
                                  - 'null'
                                properties:
                                  id:
                                    type: string
                                    format: uuid
                                  name:
                                    type: string
                                  owner:
                                    type:
                                      - string
                                      - 'null'
                                  baseBranch:
                                    type:
                                      - string
                                      - 'null'
                                  provider:
                                    type: string
                                required:
                                  - id
                                  - name
                                  - owner
                                  - baseBranch
                                  - provider
                                additionalProperties: false
                            required:
                              - id
                              - url
                              - title
                              - status
                              - isDraft
                              - sourceBranch
                              - createdAt
                              - agent
                              - diff
                              - updatedAt
                              - baseBranch
                              - headSha
                              - author
                              - codeRepository
                            additionalProperties: false
                      required:
                        - id
                        - type
                        - createdAt
                        - updatedAt
                        - pullRequests
                      additionalProperties: false
                  description:
                    type:
                      - string
                      - 'null'
                  diffSummary:
                    type:
                      - object
                      - 'null'
                    properties:
                      additions:
                        type: integer
                      deletions:
                        type: integer
                    required:
                      - additions
                      - deletions
                    additionalProperties: false
                  htmlUrl:
                    type: string
                    format: uri
                  isPinned:
                    type: boolean
                  project:
                    type:
                      - object
                      - 'null'
                    properties:
                      id:
                        type: string
                        format: uuid
                      name:
                        type: string
                      icon:
                        type: string
                        enum:
                          - folder
                          - code
                          - terminal
                          - book
                          - brain
                          - bug
                          - building
                          - cloud
                          - globe
                          - idea
                          - tools
                          - magic
                          - processor
                          - sandbox
                          - server
                          - tasks
                          - tactics
                          - images
                          - database
                          - api
                          - mobile
                          - package
                      color:
                        type: string
                        enum:
                          - neutral
                          - red
                          - orange
                          - yellow
                          - green
                          - teal
                          - blue
                          - purple
                          - pink
                    required:
                      - id
                      - name
                      - icon
                      - color
                    additionalProperties: false
                  sessionSource:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      name:
                        type: string
                      type:
                        type: string
                      repositories:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                            name:
                              type: string
                            provider:
                              type: string
                          required:
                            - id
                            - name
                            - provider
                          additionalProperties: false
                    required:
                      - id
                      - name
                      - type
                      - repositories
                    additionalProperties: false
                  sourcePullRequest:
                    type:
                      - object
                      - 'null'
                    properties:
                      id:
                        type: string
                        format: uuid
                      url:
                        type: string
                        format: uri
                      title:
                        type:
                          - string
                          - 'null'
                      status:
                        type: string
                        enum:
                          - open
                          - merged
                          - closed
                      isDraft:
                        type: boolean
                    required:
                      - id
                      - url
                      - title
                      - status
                      - isDraft
                    additionalProperties: false
                  state:
                    type: object
                    properties:
                      current:
                        type: string
                        enum:
                          - inProgress
                          - queued
                          - completed
                          - failed
                          - cancelled
                      isQueued:
                        type: boolean
                      isCancelled:
                        type: boolean
                      isCompleted:
                        type: boolean
                      isFailed:
                        type: boolean
                      inProgress:
                        type: boolean
                    required:
                      - isQueued
                      - isCancelled
                      - isCompleted
                      - isFailed
                      - inProgress
                    additionalProperties: false
                required:
                  - agent
                  - agentId
                  - artifactType
                  - baseBranch
                  - branchName
                  - createdAt
                  - externalId
                  - externalUrl
                  - id
                  - kind
                  - lastQueuedAt
                  - lastSeenAt
                  - level
                  - mode
                  - projectId
                  - sandboxSize
                  - sessionType
                  - targetBranch
                  - title
                  - updatedAt
                  - visibility
                  - artifacts
                  - description
                  - diffSummary
                  - htmlUrl
                  - isPinned
                  - project
                  - sessionSource
                  - sourcePullRequest
                  - state
                additionalProperties: false
        '400':
          description: >-
            Invalid request or missing required organization or user
            information.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '401':
          description: The session is private
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '403':
          description: The caller is not permitted to perform this operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '404':
          description: Session resource not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '409':
          description: Session operation conflicts with existing data
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '500':
          description: Session operation failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '502':
          description: Session runtime or provider operation failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
      security:
        - apiKey: []
components:
  schemas:
    AgentOptions:
      type: object
      properties:
        reasoningLevel:
          type: string
          minLength: 1
          maxLength: 100
        mode:
          type: string
          enum:
            - normal
            - planning
        speed:
          type: string
          enum:
            - normal
            - fast
        goal:
          type: object
          properties:
            enabled:
              type: boolean
            objective:
              type: string
              maxLength: 100000
          additionalProperties: false
      additionalProperties: false
    SessionTipTapDocument:
      allOf:
        - $ref: '#/components/schemas/SessionDocumentNode'
        - $ref: '#/components/schemas/TipTapDocument'
    SessionDocumentNode:
      type: object
      properties:
        type:
          type: string
          minLength: 1
          maxLength: 100
        text:
          type: string
          maxLength: 1000000
        attrs:
          type: object
          additionalProperties: {}
        marks:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                minLength: 1
                maxLength: 100
              attrs:
                type: object
                additionalProperties: {}
            required:
              - type
            additionalProperties: false
          maxItems: 1000
        content:
          type: array
          items:
            $ref: '#/components/schemas/SessionDocumentNode'
          maxItems: 10000
      additionalProperties: false
    TipTapDocument:
      anyOf:
        - $ref: '#/components/schemas/TipTapNode'
        - $ref: '#/components/schemas/CustomDocument'
      description: >-
        Rich-text document containing text, formatting, images, and mentions. A
        document typically has a "doc" root with nested content nodes.
      example:
        type: doc
        content:
          - type: paragraph
            content:
              - type: text
                text: Hello
    TipTapNode:
      anyOf:
        - oneOf:
            - type: object
              properties:
                text:
                  type: string
                  maxLength: 1000000
                marks:
                  type: array
                  items:
                    anyOf:
                      - $ref: '#/components/schemas/TipTapLinkMark'
                      - $ref: '#/components/schemas/TipTapMark'
                  maxItems: 1000
                type:
                  type: string
                  const: image
                attrs:
                  $ref: '#/components/schemas/TipTapImageAttributes'
                content:
                  type: array
                  items:
                    $ref: '#/components/schemas/TipTapNode'
                  maxItems: 10000
              required:
                - type
              additionalProperties: {}
            - type: object
              properties:
                text:
                  type: string
                  maxLength: 1000000
                marks:
                  type: array
                  items:
                    anyOf:
                      - $ref: '#/components/schemas/TipTapLinkMark'
                      - $ref: '#/components/schemas/TipTapMark'
                  maxItems: 1000
                type:
                  type: string
                  const: mention
                attrs:
                  $ref: '#/components/schemas/TipTapMentionAttributes'
                content:
                  type: array
                  items:
                    $ref: '#/components/schemas/TipTapNode'
                  maxItems: 10000
              required:
                - type
              additionalProperties: {}
            - type: object
              properties:
                text:
                  type: string
                  maxLength: 1000000
                marks:
                  type: array
                  items:
                    anyOf:
                      - $ref: '#/components/schemas/TipTapLinkMark'
                      - $ref: '#/components/schemas/TipTapMark'
                  maxItems: 1000
                type:
                  type: string
                  const: heading
                attrs:
                  type: object
                  properties:
                    level:
                      type: integer
                      minimum: 1
                      maximum: 6
                  additionalProperties: {}
                content:
                  type: array
                  items:
                    $ref: '#/components/schemas/TipTapNode'
                  maxItems: 10000
              required:
                - type
              additionalProperties: {}
            - type: object
              properties:
                text:
                  type: string
                  maxLength: 1000000
                marks:
                  type: array
                  items:
                    anyOf:
                      - $ref: '#/components/schemas/TipTapLinkMark'
                      - $ref: '#/components/schemas/TipTapMark'
                  maxItems: 1000
                type:
                  type: string
                  const: orderedList
                attrs:
                  type: object
                  properties:
                    start:
                      type: integer
                    type:
                      type:
                        - string
                        - 'null'
                  additionalProperties: {}
                content:
                  type: array
                  items:
                    $ref: '#/components/schemas/TipTapNode'
                  maxItems: 10000
              required:
                - type
              additionalProperties: {}
            - type: object
              properties:
                text:
                  type: string
                  maxLength: 1000000
                marks:
                  type: array
                  items:
                    anyOf:
                      - $ref: '#/components/schemas/TipTapLinkMark'
                      - $ref: '#/components/schemas/TipTapMark'
                  maxItems: 1000
                type:
                  type: string
                  const: taskItem
                attrs:
                  type: object
                  properties:
                    checked:
                      type: boolean
                  additionalProperties: {}
                content:
                  type: array
                  items:
                    $ref: '#/components/schemas/TipTapNode'
                  maxItems: 10000
              required:
                - type
              additionalProperties: {}
            - type: object
              properties:
                text:
                  type: string
                  maxLength: 1000000
                marks:
                  type: array
                  items:
                    anyOf:
                      - $ref: '#/components/schemas/TipTapLinkMark'
                      - $ref: '#/components/schemas/TipTapMark'
                  maxItems: 1000
                type:
                  type: string
                  const: codeBlock
                attrs:
                  type: object
                  properties:
                    language:
                      type:
                        - string
                        - 'null'
                  additionalProperties: {}
                content:
                  type: array
                  items:
                    $ref: '#/components/schemas/TipTapNode'
                  maxItems: 10000
              required:
                - type
              additionalProperties: {}
        - $ref: '#/components/schemas/TipTapContentNode'
    CustomDocument:
      type: object
      additionalProperties: {}
      description: Rich-text content with custom document properties and node attributes.
    TipTapLinkMark:
      type: object
      properties:
        type:
          type: string
          const: link
        attrs:
          type: object
          properties:
            href:
              type:
                - string
                - 'null'
            target:
              type:
                - string
                - 'null'
            rel:
              type:
                - string
                - 'null'
            class:
              type:
                - string
                - 'null'
            title:
              type:
                - string
                - 'null'
          additionalProperties: {}
      required:
        - type
      additionalProperties: {}
    TipTapMark:
      type: object
      properties:
        type:
          type: string
          minLength: 1
          maxLength: 100
          not:
            enum:
              - link
        attrs:
          $ref: '#/components/schemas/TipTapExtensionAttributes'
      required:
        - type
      additionalProperties: {}
    TipTapImageAttributes:
      type: object
      properties:
        src:
          type:
            - string
            - 'null'
        alt:
          type:
            - string
            - 'null'
        title:
          type:
            - string
            - 'null'
        width:
          type:
            - string
            - 'null'
        data-uploading:
          type:
            - string
            - 'null'
        data-placeholder-id:
          type:
            - string
            - 'null'
        upload-progress:
          type:
            - string
            - 'null'
      additionalProperties: {}
    TipTapMentionAttributes:
      type: object
      properties:
        id:
          type:
            - string
            - 'null'
        label:
          type:
            - string
            - 'null'
        type:
          type:
            - string
            - 'null'
        mentionSuggestionChar:
          type:
            - string
            - 'null'
        metadata:
          type:
            - object
            - 'null'
          properties:
            integrationType:
              type: string
            codeRepositoryId:
              type: string
            isHeader:
              type: boolean
            argumentHint:
              type: string
            commandName:
              type: string
            source:
              type: string
          additionalProperties: {}
      additionalProperties: {}
    TipTapContentNode:
      type: object
      properties:
        text:
          type: string
          maxLength: 1000000
        marks:
          type: array
          items:
            anyOf:
              - $ref: '#/components/schemas/TipTapLinkMark'
              - $ref: '#/components/schemas/TipTapMark'
          maxItems: 1000
        type:
          type: string
          minLength: 1
          maxLength: 100
          not:
            enum:
              - image
              - mention
              - heading
              - orderedList
              - taskItem
              - codeBlock
        attrs:
          $ref: '#/components/schemas/TipTapExtensionAttributes'
        content:
          type: array
          items:
            $ref: '#/components/schemas/TipTapNode'
          maxItems: 10000
      additionalProperties: {}
    TipTapExtensionAttributes:
      type: object
      additionalProperties: {}
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````