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

# コードスキャンの一覧（Devin API）

> v3 組織 API を使用して、組織内の Devin コードスキャンを一覧表示し、時間とリポジトリでフィルタリングしてスキャンのステータスをポーリングします

<div id="permissions">
  ## 権限
</div>

組織レベルで`ViewCodeScans`権限を持つ[サービスユーザー](/ja/api-reference/v3/service-users/members-service-users)または[パーソナルアクセストークン](/ja/api-reference/personal-access-tokens)が必要です。

<div id="behavior">
  ## 動作
</div>

組織のコードスキャンを新しい順に返します。[Start Code Scan](/ja/api-reference/v3/code-scans/organizations-code-scans-start) で開始したスキャンの `status` をポーリングする際に使用します。ステータスは `waiting` → `pending` → `running` → `completed` (または `failed` / `cancelled`) の順に遷移します。`awaiting_user_input` は web app から開始した対話型スキャンにのみ適用され、API で開始したスキャンはこの状態になりません。Enterprise 内のすべての組織のスキャンを一覧表示するには、[List Code Scans (Enterprise)](/ja/api-reference/v3/code-scans/enterprise-code-scans-list) を使用します。

<div id="filters">
  ### フィルター
</div>

* `time_after` / `time_before`: スキャン作成時刻の範囲を指定する UTC の Unix タイムスタンプ (秒単位) 。
* `repo_name`: このリポジトリを対象としたスキャンのみ。これを含む複数リポジトリのスキャンにも一致します。

結果は不透明なカーソル (`after` / `first`) を使用してページ分割されます。


## OpenAPI

````yaml ja/v3-openapi.yaml GET /v3/organizations/{org_id}/code-scans/scans
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}/code-scans/scans:
    get:
      tags:
        - code-scans
      summary: コードスキャンを一覧表示
      description: >-
        組織のコードスキャンを一覧表示します。


        スキャンは新しい順に返されます。必要に応じて ``repo_name`` および作成時刻（``time_after`` /
        ``time_before``）で絞り込めます。結果は不透明なカーソル（``after`` /
        ``first``）を使用してページ分割されます。
      operationId: handle_list_code_scans_v3_organizations__org_id__code_scans_scans_get
      parameters:
        - description: '組織 ID（プレフィックス: org-）'
          in: path
          name: org_id
          required: true
          schema:
            example: org-abc123def456
            title: Org Id
            type: string
        - in: query
          name: time_before
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Time Before
        - in: query
          name: time_after
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Time After
        - 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
        - description: >-
            このリポジトリをスキャンしたスキャンに絞り込みます。リポジトリがスキャンの主要リポジトリでない場合でも、複数リポジトリを対象としたスキャンに一致するため、返されるアイテムの
            ``repo_name`` が異なる場合があります。
          in: query
          name: repo_name
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              このリポジトリをスキャンしたスキャンに絞り込みます。リポジトリがスキャンの主要リポジトリでない場合でも、複数リポジトリを対象としたスキャンに一致するため、返されるアイテムの
              ``repo_name`` が異なる場合があります。
            title: Repo Name
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponse_CodeScanResponse_'
          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:
    PaginatedResponse_CodeScanResponse_:
      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/CodeScanResponse'
          title: Items
          type: array
        total:
          anyOf:
            - type: integer
            - type: 'null'
          description: 任意の合計件数（パフォーマンスのため省略可能）。
          title: Total
      required:
        - items
      title: PaginatedResponse[CodeScanResponse]
      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
    CodeScanResponse:
      description: 1件のコードスキャン。
      properties:
        created_at:
          description: スキャンの作成日時（Unix秒）。
          title: Created At
          type: integer
        host:
          anyOf:
            - type: string
            - type: 'null'
          description: 既知の場合のリポジトリの Git ホスト。
          title: Host
        org_id:
          description: スキャンが属する組織。
          title: Org Id
          type: string
        profile:
          anyOf:
            - $ref: '#/components/schemas/CodeScanProfileResponse'
            - type: 'null'
          description: スキャンの実行時に使用されたプロファイル（ある場合）。
        repo_name:
          description: スキャンの主要なリポジトリ。マルチリポジトリスキャンには、ここに記載されていない追加のリポジトリも含まれます。
          title: Repo Name
          type: string
        scan_id:
          description: スキャンの一意の識別子。
          title: Scan Id
          type: string
        scan_type:
          description: 作成時に記録されるスキャンのタイプ。
          enum:
            - security
            - performance
            - db-queries
            - test-coverage
            - dead-code
            - code-quality
            - telemetry
            - accessibility
            - general
            - migration-docs
          title: Scan Type
          type: string
        status:
          description: >-
            スキャンのステータス:
            waiting、pending、running、awaiting_user_input、completed、failed、または
            cancelled。
          enum:
            - waiting
            - pending
            - running
            - awaiting_user_input
            - completed
            - failed
            - cancelled
          title: Status
          type: string
      required:
        - scan_id
        - org_id
        - repo_name
        - host
        - status
        - profile
        - scan_type
        - created_at
      title: CodeScanResponse
      type: object
    CodeScanProfileResponse:
      description: スキャンの実行時に使用されたプロファイルの要約。
      properties:
        name:
          description: プロファイル名。
          title: Name
          type: string
        profile_id:
          description: プロファイルの一意の識別子。
          title: Profile Id
          type: string
      required:
        - profile_id
        - name
      title: CodeScanProfileResponse
      type: object
  securitySchemes:
    bearerAuth:
      description: 'サービスユーザーの認証情報（接頭辞: cog_）'
      scheme: bearer
      type: http

````