> ## 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.

# 列出会话

> 列出会话

<div id="permissions">
  ## 权限
</div>

需要一个在组织级别拥有 `ViewOrgSessions` 权限的服务用户。


## OpenAPI

````yaml zh/v3-openapi.yaml GET /v3/organizations/{org_id}/sessions
openapi: 3.1.0
info:
  description: 采用 Service User 身份验证和 RBAC 的 Devin v3 API
  title: Devin API v3
  version: 3.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v3/organizations/{org_id}/sessions:
    get:
      tags:
        - sessions
      summary: 列出会话
      description: 列出会话
      operationId: handle_get_sessions_v3_organizations__org_id__sessions_get
      parameters:
        - description: 组织 ID（前缀：org-）
          in: path
          name: org_id
          required: true
          schema:
            anyOf:
              - type: string
              - type: 'null'
            example: org-abc123def456
            title: Org Id
        - in: query
          name: qs
          required: true
          schema:
            $ref: '#/components/schemas/SessionsQueryParams'
        - in: query
          name: devin_id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Devin Id
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponse_SessionResponse_'
          description: 成功响应
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: 验证错误
components:
  schemas:
    SessionsQueryParams:
      properties:
        after:
          anyOf:
            - type: string
            - type: 'null'
          title: After
        category:
          anyOf:
            - enum:
                - bug_fixing
                - ci_cd_and_devops
                - code_quality_and_security
                - code_review
                - code_review_and_analysis
                - data_and_automation
                - documentation_and_content
                - feature_development
                - migrations_and_upgrades
                - other
                - refactoring_and_optimization
                - research_and_exploration
                - security
                - unit_test_generation
              type: string
            - type: 'null'
          title: Category
        created_after:
          anyOf:
            - type: integer
            - type: 'null'
          title: Created After
        created_before:
          anyOf:
            - type: integer
            - type: 'null'
          title: Created Before
        first:
          default: 100
          maximum: 200
          minimum: 1
          title: First
          type: integer
        is_archived:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Archived
        origins:
          anyOf:
            - items:
                enum:
                  - webapp
                  - slack
                  - teams
                  - api
                  - linear
                  - jira
                  - automation
                  - cli
                  - desktop
                  - code_scan
                  - other
                type: string
              type: array
            - type: 'null'
          title: Origins
        playbook_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Playbook Id
        repo_names:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: 按代码仓库名称筛选（例如“owner/repo”）
          title: Repo Names
        schedule_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Schedule Id
        service_user_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Service User Ids
        session_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Session Ids
        tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tags
        updated_after:
          anyOf:
            - type: integer
            - type: 'null'
          title: Updated After
        updated_before:
          anyOf:
            - type: integer
            - type: 'null'
          title: Updated Before
        user_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: User Ids
      title: SessionsQueryParams
      type: object
    PaginatedResponse_SessionResponse_:
      properties:
        end_cursor:
          anyOf:
            - type: string
            - type: 'null'
          description: 用于获取下一页的游标；如果已经是最后一页，则为 None。
          title: End Cursor
        has_next_page:
          default: false
          description: 当前页之后是否还有更多可用条目。
          title: Has Next Page
          type: boolean
        items:
          items:
            $ref: '#/components/schemas/SessionResponse'
          title: Items
          type: array
        total:
          anyOf:
            - type: integer
            - type: 'null'
          description: 可选的总计数（可为提升性能而省略）。
          title: Total
      required:
        - items
      title: PaginatedResponse[SessionResponse]
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    SessionResponse:
      properties:
        acus_consumed:
          title: Acus Consumed
          type: number
        category:
          anyOf:
            - enum:
                - bug_fixing
                - ci_cd_and_devops
                - code_quality_and_security
                - code_review
                - code_review_and_analysis
                - data_and_automation
                - documentation_and_content
                - feature_development
                - migrations_and_upgrades
                - other
                - refactoring_and_optimization
                - research_and_exploration
                - security
                - unit_test_generation
              type: string
            - type: 'null'
          description: 如果已完成分类，则为会话分配的用例类别。仅在 get/list 端点中返回。
          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
        org_id:
          title: Org Id
          type: string
        origin:
          anyOf:
            - enum:
                - webapp
                - slack
                - teams
                - api
                - linear
                - jira
                - automation
                - cli
                - desktop
                - code_scan
                - other
              type: string
            - type: 'null'
          description: 该会话的创建来源。
          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
        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: >-
            会话当前状态的附加信息。当 status
            为“running”时：可为“working”（正在处理）、“waiting_for_user”（需要用户输入）、“waiting_for_approval”（在安全模式下等待操作批准）或“finished”（任务已完成）。当
            status
            为“suspended”时：表示挂起原因，例如“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”。仅在
            get/list 端点中返回。
          title: Status Detail
        structured_output:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: 来自会话的已验证结构化输出。仅在 GET/LIST 端点中返回。
          title: Structured Output
        subcategory:
          anyOf:
            - type: string
            - type: 'null'
          description: 为会话分配的子类别显示名称。若已设置类别但未分配或未解析出子类别，则为“Other”。仅在 get/list 端点中返回。
          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
      title: SessionResponse
      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
    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
  securitySchemes:
    bearerAuth:
      description: 服务用户凭据（前缀：cog_）
      scheme: bearer
      type: http

````