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

# Harness連携を作成

> PATまたはService Account Tokenを検証した後、Harness Code SCM連携を作成します。`integrations.manage_integration`権限が必要です。各連携で異なる組織許可リストを使用する場合、1つのアカウントに複数の連携を作成できます。



## OpenAPI

````yaml /ja/api-reference/openapi.json post /integrations/harness
openapi: 3.0.0
info:
  title: Corgea API
  version: 1.0.0
  description: Corgeaのスキャン機能および脆弱性管理機能を操作するためのAPI
servers:
  - url: https://www.corgea.app/api/v1
    description: 本番サーバー
security:
  - CorgeaToken: []
  - BearerAuth: []
paths:
  /integrations/harness:
    post:
      tags:
        - Harness連携
      summary: Harness連携を作成
      description: >-
        PATまたはService Account Tokenを検証した後、Harness Code
        SCM連携を作成します。`integrations.manage_integration`権限が必要です。各連携で異なる組織許可リストを使用する場合、1つのアカウントに複数の連携を作成できます。
      operationId: createHarnessIntegration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateHarnessIntegrationRequest'
      responses:
        '201':
          description: Harness連携を作成し、認証情報を検証しました
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HarnessIntegrationWriteResponse'
        '400':
          description: リクエストが無効か、認証情報を検証できませんでした
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: APIアクセス権または必要な権限がありません
        '409':
          description: このアカウントと組織許可リストの組み合わせには連携がすでに存在します
components:
  schemas:
    CreateHarnessIntegrationRequest:
      type: object
      required:
        - secure_token
      properties:
        secure_token:
          type: string
          writeOnly: true
          description: HarnessのPATまたはService Account Token。
        name:
          type: string
          default: Harness
        org_allowlist:
          type: array
          items:
            type: string
          default: []
        base_url:
          type: string
          format: uri
          default: https://app.harness.io
        gateway_prefix:
          type: string
          default: /gateway
    HarnessIntegrationWriteResponse:
      allOf:
        - $ref: '#/components/schemas/HarnessIntegrationResponse'
        - type: object
          required:
            - credentials_verified
          properties:
            credentials_verified:
              type: boolean
              enum:
                - true
    HarnessIntegrationResponse:
      type: object
      required:
        - status
        - integration
      properties:
        status:
          type: string
          enum:
            - ok
        integration:
          $ref: '#/components/schemas/HarnessIntegration'
    HarnessIntegration:
      type: object
      description: Harness Code SCM連携。認証情報の値が返されることはありません。
      required:
        - id
        - uuid
        - type
        - name
        - account_id
        - account_name
        - org_allowlist
        - base_url
        - gateway_prefix
        - expired
      properties:
        id:
          type: integer
        uuid:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - harness
        name:
          type: string
        account_id:
          type: string
          description: トークンから取得したHarnessアカウントID。
        account_name:
          type: string
        org_allowlist:
          type: array
          description: この連携で利用できるHarness組織の識別子。空の一覧を指定すると、トークンでアクセス可能なすべての組織が許可されます。
          items:
            type: string
        base_url:
          type: string
          format: uri
        gateway_prefix:
          type: string
        expired:
          type: boolean
        created_at:
          type: string
          format: date-time
          nullable: true
        updated_at:
          type: string
          format: date-time
          nullable: true
  responses:
    Unauthorized:
      description: トークンが無効か、指定されていません
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Missing or invalid authorization header
  securitySchemes:
    CorgeaToken:
      type: apiKey
      in: header
      name: CORGEA-TOKEN
      description: 認証用のAPIキー
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Authorizationヘッダーで使用するOAuth2アクセストークン（JWT）

````