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

# GET セッションメトリクス

> Enterprise アカウントのセッション指標の集計データを取得します。

任意で playbook_id によるフィルターを指定して、特定のプレイブックで作成されたセッションの指標のみを取得できます。

<div id="permissions">
  ## Permissions
</div>

Enterprise レベルで `ViewAccountMetrics` 権限を持つサービスユーザーが必要です。


## OpenAPI

````yaml ja/v3-openapi.yaml GET /v3/enterprise/metrics/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/metrics/sessions:
    get:
      tags:
        - metrics
      summary: GET セッションメトリクス
      description: |-
        Enterprise アカウントのセッション指標の集計データを取得します。

        任意で playbook_id によるフィルターを指定して、特定のプレイブックで作成されたセッションの指標のみを取得できます。
      operationId: handle_get_session_metrics_v3_enterprise_metrics_sessions_get
      parameters:
        - 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: time_before
          required: true
          schema:
            title: Time Before
            type: integer
        - in: query
          name: time_after
          required: true
          schema:
            title: Time After
            type: integer
        - in: query
          name: org_ids
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            title: Org Ids
        - in: query
          name: playbook_id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Playbook Id
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionMetricsResponse'
          description: 正常なレスポンス
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 認証されていません
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: アクセス禁止
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 見つかりません
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 競合
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 処理できないコンテンツ
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: リクエストが多すぎます
components:
  schemas:
    SessionMetricsResponse:
      description: セッションメトリクスのレスポンスモデル。
      properties:
        avg_acus_per_session:
          title: Avg Acus Per Session
          type: number
        sessions_created_by_origin:
          $ref: '#/components/schemas/SessionCountsByOrigin'
        sessions_created_by_size:
          $ref: '#/components/schemas/SessionCountsBySize'
        sessions_created_count:
          title: Sessions Created Count
          type: integer
        sessions_created_with_playbook_count:
          title: Sessions Created With Playbook Count
          type: integer
        sessions_created_with_search_count:
          title: Sessions Created With Search Count
          type: integer
        sessions_with_merged_prs_by_size:
          $ref: '#/components/schemas/SessionCountsBySize'
        sessions_with_merged_prs_count:
          title: Sessions With Merged Prs Count
          type: integer
      required:
        - sessions_created_count
        - sessions_created_by_size
        - sessions_created_by_origin
        - sessions_created_with_playbook_count
        - sessions_created_with_search_count
        - sessions_with_merged_prs_count
        - sessions_with_merged_prs_by_size
        - avg_acus_per_session
      title: SessionMetricsResponse
      type: object
    ProblemDetail:
      description: >-
        v3 API 用の RFC 9457 application/problem+json エラーボディ。


        detail は後方互換性のため、レガシーな {"detail": ...}
        ボディから引き継がれます。その他のメンバーは追加式です。errors にはフィールドレベルのバリデーションエラーが含まれます（422
        の場合のみ）。
      properties:
        detail:
          anyOf:
            - type: string
            - type: 'null'
          description: この事象に固有の、人が読める説明。
          title: Detail
        errors:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          description: フィールド単位のバリデーションエラー（422 レスポンスのみ）。
          title: Errors
        instance:
          anyOf:
            - type: string
            - type: 'null'
          description: この発生箇所の URI 参照（リクエストパス）。
          title: Instance
        status:
          description: HTTP ステータスコード。
          title: Status
          type: integer
        title:
          description: 問題タイプを人が読める短い要約。
          title: Title
          type: string
        type:
          default: about:blank
          description: 問題タイプを識別する URI 参照。
          title: Type
          type: string
      required:
        - title
        - status
      title: ProblemDetail
      type: object
    SessionCountsByOrigin:
      description: |-
        v3 メトリクス API で公開される、起点タイプ別のセッション数。

        `SessionOrigin` の厳選されたサブセットです。レガシーな起点（cli、
        vscode_extension、devin_spaces）は意図的に公開されません。
        DB 起点が `scheduled` のセッション数は、正規の `db_origin_to_api` マッピングにより
        `automation` に集約されます。これは、自動化が schedule の移行先となる上位概念であるためです。
      properties:
        api:
          default: 0
          title: Api
          type: integer
        automation:
          default: 0
          title: Automation
          type: integer
        code_scan:
          default: 0
          title: Code Scan
          type: integer
        desktop:
          default: 0
          title: Desktop
          type: integer
        jira:
          default: 0
          title: Jira
          type: integer
        linear:
          default: 0
          title: Linear
          type: integer
        slack:
          default: 0
          title: Slack
          type: integer
        teams:
          default: 0
          title: Teams
          type: integer
        webapp:
          default: 0
          title: Webapp
          type: integer
      title: SessionCountsByOrigin
      type: object
    SessionCountsBySize:
      description: サイズカテゴリ別セッション数。
      properties:
        l:
          default: 0
          title: L
          type: integer
        m:
          default: 0
          title: M
          type: integer
        s:
          default: 0
          title: S
          type: integer
        xl:
          default: 0
          title: Xl
          type: integer
        xs:
          default: 0
          title: Xs
          type: integer
      title: SessionCountsBySize
      type: object
  securitySchemes:
    bearerAuth:
      description: 'サービスユーザーの認証情報（接頭辞: cog_）'
      scheme: bearer
      type: http

````