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

# プロジェクトタグを更新

> プロジェクトのタグを追加、削除、または置換します。受け取ったタグは前後の空白を除去して小文字に変換され、空の値は無視されます。更新を適用する前に重複する値も削除されます。



## OpenAPI

````yaml /ja/api-reference/openapi.json patch /projects/{project_id}/tags
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:
  /projects/{project_id}/tags:
    patch:
      tags:
        - プロジェクト
      summary: プロジェクトタグを更新
      description: >-
        プロジェクトのタグを追加、削除、または置換します。受け取ったタグは前後の空白を除去して小文字に変換され、空の値は無視されます。更新を適用する前に重複する値も削除されます。
      operationId: updateProjectTags
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: integer
          description: 更新するプロジェクトのID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - operation
                - tags
              properties:
                operation:
                  type: string
                  enum:
                    - add
                    - remove
                    - replace
                  description: 指定したタグを現在のプロジェクトタグ一覧に適用する方法
                tags:
                  type: array
                  items:
                    type: string
                  description: 正規化後に追加、削除、または置換するタグ
      responses:
        '200':
          description: プロジェクトタグを正常に更新しました
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  project:
                    type: object
                    properties:
                      id:
                        type: integer
                      name:
                        type: string
                      repo_url:
                        type: string
                        nullable: true
                        description: 利用可能な場合、プロジェクトに関連付けられたリポジトリURL
                      tags:
                        type: array
                        items:
                          type: string
                        description: 更新後の正規化済みプロジェクトタグ
        '400':
          description: 不正なリクエスト - 検証エラー
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: tags must be a list
              examples:
                invalid_json:
                  summary: リクエストボディが有効なJSONではありません
                  value:
                    error: Invalid JSON body
                invalid_operation:
                  summary: 操作がサポートされていません
                  value:
                    error: 'operation must be one of: add, remove, replace'
                tags_not_list:
                  summary: tagsフィールドが配列ではありません
                  value:
                    error: tags must be a list
                tag_not_string:
                  summary: 1つ以上のタグが文字列ではありません
                  value:
                    error: all tags must be strings
        '401':
          description: トークンが無効か、指定されていません
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: API key is missing
              examples:
                missing_token:
                  summary: APIキーヘッダーがありません
                  value:
                    error: API key is missing
                invalid_token:
                  summary: APIキーが無効です
                  value:
                    error: Invalid API key
        '403':
          description: 権限がありません
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Permission denied
        '404':
          description: プロジェクトアクセス制御によりプロジェクトが非表示になっています
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: error
                  message:
                    type: string
                    example: Project doesn't exist
components:
  securitySchemes:
    CorgeaToken:
      type: apiKey
      in: header
      name: CORGEA-TOKEN
      description: 認証用のAPIキー
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Authorizationヘッダーで使用するOAuth2アクセストークン（JWT）

````