> ## 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 PR メトリクス

> Enterprise アカウントの PR に関する集計メトリクスを取得します。

playbook_id でフィルタリングすることで、特定のプレイブックで作成されたセッションからの PR のみを対象としたメトリクスを取得できます。

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

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


## OpenAPI

````yaml ja/v3-openapi.yaml GET /v3/enterprise/metrics/prs
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/prs:
    get:
      tags:
        - metrics
      summary: GET PR メトリクス
      description: >-
        Enterprise アカウントの PR に関する集計メトリクスを取得します。


        playbook_id でフィルタリングすることで、特定のプレイブックで作成されたセッションからの PR
        のみを対象としたメトリクスを取得できます。
      operationId: handle_get_pr_metrics_v3_enterprise_metrics_prs_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/PrMetricsResponse'
          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:
    PrMetricsResponse:
      description: PR（プルリクエスト）のメトリクス用レスポンスモデル。
      properties:
        prs_closed_count:
          description: Devin が作成し、マージされずにクローズされた PR。
          title: Prs Closed Count
          type: integer
        prs_created_count:
          description: すべての状態（open + merged + closed）における、Devin が作成した PR の合計。
          title: Prs Created Count
          type: integer
        prs_merged_count:
          description: Devin が作成し、マージされた PR。
          title: Prs Merged Count
          type: integer
        prs_opened_count:
          description: Devin が作成し、現在 open の PR。
          title: Prs Opened Count
          type: integer
        prs_taken_over_closed_count:
          default: 0
          description: Devin が引き継ぎ、マージされずにクローズされた PR。
          title: Prs Taken Over Closed Count
          type: integer
        prs_taken_over_count:
          default: 0
          description: >-
            すべての状態（open + merged + closed）における、Devin が引き継いだ PR の合計。引き継ぎとは、Devin
            が元々作成していない PR にコミットを push した場合を指します。
          title: Prs Taken Over Count
          type: integer
        prs_taken_over_merged_count:
          default: 0
          description: Devin が引き継ぎ、マージされた PR。
          title: Prs Taken Over Merged Count
          type: integer
        prs_taken_over_opened_count:
          default: 0
          description: Devin が引き継ぎ、現在 open の PR。
          title: Prs Taken Over Opened Count
          type: integer
      required:
        - prs_created_count
        - prs_opened_count
        - prs_merged_count
        - prs_closed_count
      title: PrMetricsResponse
      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
  securitySchemes:
    bearerAuth:
      description: 'サービスユーザーの認証情報（接頭辞: cog_）'
      scheme: bearer
      type: http

````