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

# Retrieve a session

> Retrieve one visible bounded session resource.



## OpenAPI

````yaml https://api.tembo.io/public-api/openapi/public get /v1/sessions/{sessionId}
openapi: 3.1.0
info:
  title: Tembo Public API
  description: Public API Endpoints for Tembo
  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}:
    get:
      tags:
        - Sessions
      summary: Retrieve a session
      description: Retrieve one visible bounded session resource.
      operationId: retrieveSession
      parameters:
        - in: path
          name: sessionId
          schema:
            type: string
            format: uuid
          required: true
      responses:
        '200':
          description: Retrieve 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
                        pullRequest:
                          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
                              metadata:
                                type: object
                                properties:
                                  baseBranch:
                                    type: string
                                    maxLength: 500
                                  headSha:
                                    type: string
                                    maxLength: 200
                                  author:
                                    type: object
                                    properties:
                                      avatarUrl:
                                        type: string
                                        format: uri
                                      login:
                                        type: string
                                        maxLength: 500
                              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
                              - metadata
                              - codeRepository
                            additionalProperties: false
                      required:
                        - id
                        - type
                        - createdAt
                        - updatedAt
                        - pullRequest
                      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 resource scope
          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:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````