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

需要在 Enterprise 级别具有 `ViewAccountSessions` 权限的服务用户。


## OpenAPI

````yaml zh/v3-openapi.yaml GET /v3/enterprise/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/enterprise/sessions:
    get:
      tags:
        - sessions
      summary: 列出账户的所有会话
      description: 列出整个企业中的所有会话。
      operationId: handle_get_account_sessions_v3_enterprise_sessions_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
                    - automation
                    - cli
                    - desktop
                    - code_scan
                    - 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
        - description: 按代码仓库名称筛选（例如“owner/repo”）
          in: query
          name: repo_names
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: 按代码仓库名称筛选（例如“owner/repo”）
            title: Repo Names
        - in: query
          name: category
          required: false
          schema:
            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
        - in: query
          name: is_archived
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            title: Is Archived
        - 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_SessionResponse_'
          description: 成功响应
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: 验证错误
components:
  schemas:
    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

````