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

# 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: 正常応答
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          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
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      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

````