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

# List sessions with insights

> List sessions with detailed insights including message counts,
session size classification, and AI-generated analysis.

## Permissions

Requires a service user with the `ViewAccountSessions` permission at the enterprise level.


## OpenAPI

````yaml /v3-openapi.yaml GET /v3/enterprise/sessions/insights
openapi: 3.1.0
info:
  description: Devin v3 API with Service User authentication and RBAC
  title: Devin API v3
  version: 3.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v3/enterprise/sessions/insights:
    get:
      tags:
        - sessions
      summary: List sessions with insights
      description: |-
        List sessions with detailed insights including message counts,
        session size classification, and AI-generated analysis.
      operationId: handle_get_account_sessions_insights_v3_enterprise_sessions_insights_get
      parameters:
        - in: query
          name: after
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: After
        - in: query
          name: first
          required: false
          schema:
            default: 100
            maximum: 200
            minimum: 1
            title: First
            type: integer
        - in: query
          name: session_ids
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            title: Session Ids
        - in: query
          name: created_after
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Created After
        - in: query
          name: created_before
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Created Before
        - in: query
          name: updated_after
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Updated After
        - in: query
          name: updated_before
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Updated Before
        - in: query
          name: tags
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            title: Tags
        - in: query
          name: playbook_id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Playbook Id
        - in: query
          name: origins
          required: false
          schema:
            anyOf:
              - items:
                  enum:
                    - webapp
                    - slack
                    - teams
                    - api
                    - linear
                    - jira
                    - scheduled
                    - automation
                    - cli
                    - desktop
                    - other
                  type: string
                type: array
              - type: 'null'
            title: Origins
        - in: query
          name: schedule_id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Schedule Id
        - in: query
          name: user_ids
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            title: User Ids
        - in: query
          name: service_user_ids
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            title: Service User Ids
        - in: query
          name: category
          required: false
          schema:
            anyOf:
              - enum:
                  - bug_fixing
                  - ci_cd_and_devops
                  - code_quality_and_security
                  - code_review_and_analysis
                  - data_and_automation
                  - documentation_and_content
                  - feature_development
                  - migrations_and_upgrades
                  - other
                  - refactoring_and_optimization
                  - research_and_exploration
                  - unit_test_generation
                type: string
              - type: 'null'
            title: Category
        - in: query
          name: org_ids
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            title: Org Ids
        - in: query
          name: include_deleted_orgs
          required: false
          schema:
            default: false
            title: Include Deleted Orgs
            type: boolean
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PaginatedResponse_SessionInsightsResponse_
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    PaginatedResponse_SessionInsightsResponse_:
      properties:
        end_cursor:
          anyOf:
            - type: string
            - type: 'null'
          description: Cursor to fetch the next page, or None if this is the last page.
          title: End Cursor
        has_next_page:
          default: false
          description: Whether there are more items available after this page.
          title: Has Next Page
          type: boolean
        items:
          items:
            $ref: '#/components/schemas/SessionInsightsResponse'
          title: Items
          type: array
        total:
          anyOf:
            - type: integer
            - type: 'null'
          description: Optional total count (can be omitted for performance).
          title: Total
      required:
        - items
      title: PaginatedResponse[SessionInsightsResponse]
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    SessionInsightsResponse:
      description: >-
        Session details augmented with quantitative metrics and AI analysis.


        Extends SessionResponse with additional fields that require extra
        queries.
      properties:
        acus_consumed:
          title: Acus Consumed
          type: number
        analysis:
          anyOf:
            - $ref: '#/components/schemas/SessionInsightsAnalysis'
            - type: 'null'
          description: AI-generated session analysis. None if analysis has not completed.
        category:
          anyOf:
            - enum:
                - bug_fixing
                - ci_cd_and_devops
                - code_quality_and_security
                - code_review_and_analysis
                - data_and_automation
                - documentation_and_content
                - feature_development
                - migrations_and_upgrades
                - other
                - refactoring_and_optimization
                - research_and_exploration
                - unit_test_generation
              type: string
            - type: 'null'
          description: >-
            The session's assigned use-case category, if categorisation has run.
            Only populated on get/list endpoints.
          title: Category
        child_session_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Child Session Ids
        created_at:
          title: Created At
          type: integer
        is_archived:
          default: false
          title: Is Archived
          type: boolean
        num_devin_messages:
          description: Number of Devin messages sent during the session.
          title: Num Devin Messages
          type: integer
        num_user_messages:
          description: Number of user messages sent during the session.
          title: Num User Messages
          type: integer
        org_id:
          title: Org Id
          type: string
        origin:
          anyOf:
            - enum:
                - webapp
                - slack
                - teams
                - api
                - linear
                - jira
                - scheduled
                - automation
                - cli
                - desktop
                - other
              type: string
            - type: 'null'
          default: null
          description: The origin from which the session was created.
          title: Origin
        parent_session_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Session Id
        playbook_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Playbook Id
        pull_requests:
          items:
            $ref: '#/components/schemas/SessionPullRequest'
          title: Pull Requests
          type: array
        service_user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Service User Id
        session_id:
          title: Session Id
          type: string
        session_size:
          description: Session size classification based on ACU usage and message count.
          enum:
            - xs
            - s
            - m
            - l
            - xl
          title: Session Size
          type: string
        status:
          enum:
            - new
            - claimed
            - running
            - exit
            - error
            - suspended
            - resuming
          title: Status
          type: string
        status_detail:
          anyOf:
            - enum:
                - working
                - waiting_for_user
                - waiting_for_approval
                - finished
                - inactivity
                - user_request
                - usage_limit_exceeded
                - out_of_credits
                - out_of_quota
                - no_quota_allocation
                - payment_declined
                - org_usage_limit_exceeded
                - total_session_limit_exceeded
                - error
              type: string
            - type: 'null'
          description: >-
            Additional detail about the session's current status. When status is
            'running': 'working' (actively working), 'waiting_for_user' (needs
            user input), 'waiting_for_approval' (awaiting action approval in
            safe mode), or 'finished' (task complete). When status is
            'suspended': the reason for suspension such as 'inactivity',
            'user_request', 'usage_limit_exceeded', 'out_of_credits',
            'out_of_quota', 'no_quota_allocation', 'payment_declined',
            'org_usage_limit_exceeded', 'total_session_limit_exceeded', or
            'error'. Only populated on get/list endpoints.
          title: Status Detail
        structured_output:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: >-
            Validated structured output from the session. Only populated on
            get/list endpoints.
          title: Structured Output
        subcategory:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The session's assigned subcategory display name. 'Other' when a
            category is set but no subcategory was assigned or resolved. Only
            populated on get/list endpoints.
          title: Subcategory
        tags:
          items:
            type: string
          title: Tags
          type: array
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        updated_at:
          title: Updated At
          type: integer
        url:
          title: Url
          type: string
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
      required:
        - session_id
        - url
        - status
        - tags
        - org_id
        - created_at
        - updated_at
        - acus_consumed
        - pull_requests
        - num_user_messages
        - num_devin_messages
        - session_size
      title: SessionInsightsResponse
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    SessionInsightsAnalysis:
      description: AI-generated analysis data from a completed session analysis.
      properties:
        action_items:
          default: []
          items:
            $ref: '#/components/schemas/SessionInsightsActionItem'
          title: Action Items
          type: array
        classification:
          anyOf:
            - $ref: '#/components/schemas/SessionInsightsClassification'
            - type: 'null'
        issues:
          default: []
          items:
            $ref: '#/components/schemas/SessionInsightsIssue'
          title: Issues
          type: array
        note_usage:
          anyOf:
            - $ref: '#/components/schemas/SessionInsightsNoteUsage'
            - type: 'null'
        suggested_prompt:
          anyOf:
            - $ref: '#/components/schemas/SessionInsightsSuggestedPrompt'
            - type: 'null'
        timeline:
          default: []
          items:
            $ref: '#/components/schemas/SessionInsightsTimelineEvent'
          title: Timeline
          type: array
      title: SessionInsightsAnalysis
      type: object
    SessionPullRequest:
      properties:
        pr_state:
          anyOf:
            - type: string
            - type: 'null'
          title: Pr State
        pr_url:
          title: Pr Url
          type: string
      required:
        - pr_url
        - pr_state
      title: SessionPullRequest
      type: object
    SessionInsightsActionItem:
      properties:
        action_item:
          title: Action Item
          type: string
        issue_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Issue Id
        type:
          default: other
          enum:
            - machine_setup
            - repo_config
            - knowledge
            - prompt_improvement
            - other
          title: Type
          type: string
      required:
        - action_item
      title: SessionInsightsActionItem
      type: object
    SessionInsightsClassification:
      properties:
        category:
          title: Category
          type: string
        confidence:
          title: Confidence
          type: number
        programming_languages:
          default: []
          items:
            type: string
          title: Programming Languages
          type: array
        tools_and_frameworks:
          default: []
          items:
            type: string
          title: Tools And Frameworks
          type: array
      required:
        - category
        - confidence
      title: SessionInsightsClassification
      type: object
    SessionInsightsIssue:
      properties:
        id:
          default: ''
          title: Id
          type: string
        impact:
          title: Impact
          type: string
        issue:
          title: Issue
          type: string
        label:
          title: Label
          type: string
      required:
        - issue
        - impact
        - label
      title: SessionInsightsIssue
      type: object
    SessionInsightsNoteUsage:
      properties:
        bad_usages:
          default: []
          items:
            $ref: '#/components/schemas/SessionInsightsNoteUsageItem'
          title: Bad Usages
          type: array
        good_usages:
          default: []
          items:
            $ref: '#/components/schemas/SessionInsightsNoteUsageItem'
          title: Good Usages
          type: array
      title: SessionInsightsNoteUsage
      type: object
    SessionInsightsSuggestedPrompt:
      properties:
        feedback_items:
          default: []
          items:
            $ref: '#/components/schemas/SessionInsightsFeedbackItem'
          title: Feedback Items
          type: array
        original_prompt:
          title: Original Prompt
          type: string
        suggested_prompt:
          title: Suggested Prompt
          type: string
      required:
        - original_prompt
        - suggested_prompt
      title: SessionInsightsSuggestedPrompt
      type: object
    SessionInsightsTimelineEvent:
      properties:
        color:
          default: ''
          title: Color
          type: string
        description:
          title: Description
          type: string
        issue_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Issue Id
        title:
          title: Title
          type: string
      required:
        - title
        - description
      title: SessionInsightsTimelineEvent
      type: object
    SessionInsightsNoteUsageItem:
      properties:
        message:
          title: Message
          type: string
        note_id:
          title: Note Id
          type: string
        reason:
          title: Reason
          type: string
      required:
        - reason
        - message
        - note_id
      title: SessionInsightsNoteUsageItem
      type: object
    SessionInsightsFeedbackItem:
      properties:
        details:
          title: Details
          type: string
        excerpt:
          title: Excerpt
          type: string
        issue_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Issue Id
        summary:
          title: Summary
          type: string
      required:
        - summary
        - excerpt
        - details
      title: SessionInsightsFeedbackItem
      type: object
  securitySchemes:
    bearerAuth:
      description: 'Service User credential (prefix: cog_)'
      scheme: bearer
      type: http

````