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

組織レベルの `ViewOrgMetrics` 権限を持つサービスユーザーが必要です。


## OpenAPI

````yaml ja/v3-openapi.yaml GET /v3/organizations/{org_id}/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/organizations/{org_id}/metrics/sessions:
    get:
      tags:
        - metrics
      summary: セッションメトリクスを取得
      description: 組織の集計セッションメトリクスを取得します。
      operationId: >-
        handle_get_session_metrics_v3_organizations__org_id__metrics_sessions_get
      parameters:
        - description: '組織 ID（プレフィックス: org-）'
          in: path
          name: org_id
          required: true
          schema:
            example: org-abc123def456
            title: Org Id
            type: string
        - 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: playbook_id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Playbook Id
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionMetricsResponse'
          description: 成功レスポンス
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          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
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      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
    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
  securitySchemes:
    bearerAuth:
      description: 'サービスユーザーの認証情報（接頭辞: cog_）'
      scheme: bearer
      type: http

````