openapi: 3.1.0
info:
  title: kickflow REST API v1
  version: 1.0.0
  description: kickflowの開発者用REST API (v1)
  contact:
    name: kickflow, Inc.
    url: https://kickflow.com
  termsOfService: https://kickflow.com/terms
  license:
    name: MIT License
    url: https://opensource.org/license/MIT
servers:
  - url: https://api.kickflow.com
    description: kickflow REST API v1
security:
  - PersonalAccessTokenAuth: []
  - ServiceAccountTokenAuth: []
tags:
  - name: ユーザー
    description: ユーザーに関するAPI
  - name: 役職
    description: 役職に関するAPI
  - name: 代理申請
    description: 代理申請に関するAPI
  - name: 代理承認
    description: 代理承認に関するAPI
  - name: 組織図
    description: 組織図に関するAPI
  - name: チーム
    description: チームに関するAPI
  - name: カテゴリ
    description: カテゴリに関するAPI
  - name: フォルダ
    description: フォルダに関するAPI
  - name: 経路
    description: 経路に関するAPI
  - name: ワークフロー
    description: ワークフローに関するAPI
  - name: チケット
    description: チケットに関するAPI
  - name: ファイル
    description: ファイルに関するAPI
  - name: 汎用マスタ
    description: 汎用マスタに関するAPI
  - name: 管理者ロール
    description: 管理者ロールに関するAPI
  - name: コメント
    description: コメントに関するAPI
  - name: 監査ログ
    description: 監査ログに関するAPI
paths:
  /v1/categories:
    get:
      summary: カテゴリの一覧を取得
      tags:
        - カテゴリ
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Category'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: listCategories
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: ページ
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          in: query
          name: perPage
          description: 1ページあたりの件数
        - schema:
            type: string
            pattern: ^(name|createdAt|updatedAt)(-asc|-desc)?$
          in: query
          name: sortBy
          description: 'ソート対象のフィールドと順序。指定可能なフィールド: name, createdAt, updatedAt'
      description: カテゴリの一覧を取得します。
    post:
      summary: カテゴリを作成
      tags:
        - カテゴリ
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Category'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: createCategory
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 名前
              required:
                - name
      description: |-
        カテゴリを作成します。

        このAPIの実行には、ワークフロー関連設定の管理権限が必要です。
  /v1/categories/{categoryId}:
    parameters:
      - schema:
          type: string
          format: uuid
        name: categoryId
        in: path
        required: true
        description: カテゴリのUUID
    delete:
      summary: カテゴリを削除
      tags:
        - カテゴリ
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: deleteCategory
      description: |-
        カテゴリを削除します。

        このAPIの実行には、ワークフロー関連設定の管理権限が必要です。
    patch:
      summary: カテゴリを更新
      tags:
        - カテゴリ
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Category'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: updateCategory
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 名前
              required:
                - name
      description: |-
        カテゴリを更新します。

        このAPIの実行には、ワークフロー関連設定の管理権限が必要です。
  /v1/folders:
    get:
      summary: フォルダの一覧を取得
      tags:
        - フォルダ
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Folder'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: listFolders
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: ページ
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          in: query
          name: perPage
          description: 1ページあたりの件数
        - schema:
            type: string
            pattern: ^(createdAt|name|fullName)(-asc|-desc)?$
          in: query
          name: sortBy
          description: 'ソート対象のフィールドと順序。指定可能なフィールド: createdAt, name, fullName'
      description: フォルダの一覧を取得します。
    post:
      summary: フォルダを作成
      tags:
        - フォルダ
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FolderDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: createFolder
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 名前
                code:
                  type: string
                  description: コード。未指定の場合、ランダムな英数字が自動的に設定されます。
                description:
                  type: string
                  description: フォルダの説明
                parentFolderId:
                  type:
                    - string
                    - 'null'
                  description: 親フォルダのID
                  format: UUID
              required:
                - name
      description: |-
        フォルダを作成します。

        このAPIの実行には、ワークフロー関連設定の管理権限が必要です。
  /v1/folders/{folderId}:
    parameters:
      - schema:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
        name: folderId
        in: path
        required: true
        description: フォルダのUUIDまたはコード
    delete:
      summary: フォルダを削除
      tags:
        - フォルダ
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: deleteFolder
      description: |-
        フォルダを削除します。

        このAPIの実行には、ワークフロー関連設定の管理権限が必要です。

        注意：このフォルダ以下のすべてのフォルダ・ワークフロー・経路・パイプラインも削除されます。
    patch:
      summary: フォルダを更新
      tags:
        - フォルダ
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FolderDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: updateFolder
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 名前
                code:
                  type: string
                  description: コード
                description:
                  type: string
                  description: フォルダの説明
                parentFolderId:
                  type:
                    - string
                    - 'null'
                  description: 親フォルダのID
                  format: UUID
      description: |-
        フォルダを更新します。

        このAPIの実行には、ワークフロー関連設定の管理権限が必要です。
    get:
      summary: フォルダを取得
      operationId: getFolder
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FolderDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      tags:
        - フォルダ
      description: フォルダを一件取得します。
  /v1/generalMasters:
    get:
      summary: 汎用マスタの一覧を取得
      tags:
        - 汎用マスタ
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GeneralMaster'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: listGeneralMasters
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: ページ
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          in: query
          name: perPage
          description: 1ページあたりの件数
        - schema:
            type: string
            pattern: ^(createdAt|code|name)(-asc|-desc)?$
          in: query
          name: sortBy
          description: 'ソート対象のフィールドと順序。指定可能なフィールド: createdAt, code, name'
      description: |-
        汎用マスタの一覧を取得します。

        このAPIの実行には、汎用マスタの管理権限が必要です。
    post:
      summary: 汎用マスタを作成
      tags:
        - 汎用マスタ
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeneralMaster'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: createGeneralMaster
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 名前
                code:
                  type:
                    - string
                    - 'null'
                  description: コード。未指定の場合、ランダムな英数字が自動的に設定されます。
                description:
                  type:
                    - string
                    - 'null'
                  description: 説明
                defaultSortBy:
                  type: string
                  enum:
                    - name
                    - code
                  description: アイテム一覧のデフォルト並び順
                fields:
                  type: array
                  description: カスタムフィールドの配列
                  items:
                    type: object
                    properties:
                      title:
                        type: string
                        description: フィールド名
                      description:
                        type:
                          - string
                          - 'null'
                        description: フィールドの説明
                      code:
                        type: string
                        description: フィールドのコード
                      required:
                        type: boolean
                        description: 入力必須かどうか
                      fieldType:
                        type: string
                        description: フィールドの型
                        enum:
                          - text
                          - text_long
                          - number
                          - integer
                          - checkbox
                          - pull_down
                          - date
                      options:
                        type:
                          - array
                          - 'null'
                        description: 選択肢。fieldTypeがcheckboxまたはpull_downのとき必須。
                        items:
                          type: string
                      visible:
                        type: boolean
                        description: 管理者以外も閲覧可能な場合true
                    required:
                      - title
                      - code
                      - required
                      - fieldType
              required:
                - name
      description: |-
        汎用マスタを作成します。

        このAPIの実行には、汎用マスタの管理権限が必要です。
  /v1/generalMasters/{generalMasterId}:
    parameters:
      - schema:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
        name: generalMasterId
        in: path
        required: true
        description: 汎用マスタのUUIDまたはコード
    get:
      summary: 汎用マスタを取得
      tags:
        - 汎用マスタ
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeneralMaster'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: getGeneralMaster
      description: |-
        汎用マスタを一件取得します。

        このAPIの実行には、汎用マスタの管理権限が必要です。
    patch:
      summary: 汎用マスタを更新
      tags:
        - 汎用マスタ
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeneralMaster'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: updateGeneralMaster
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                code:
                  type: string
                  description: コード。未指定の場合、ランダムな英数字が自動的に設定されます。
                name:
                  type: string
                  description: 名前
                description:
                  type: string
                  description: 説明
                defaultSortBy:
                  type: string
                  enum:
                    - name
                    - code
                  description: アイテム一覧のデフォルト並び順
                fields:
                  type: array
                  description: カスタムフィールドの配列
                  items:
                    type: object
                    properties:
                      title:
                        type: string
                        description: フィールド名
                      description:
                        type:
                          - string
                          - 'null'
                        description: フィールドの説明
                      code:
                        type: string
                        description: フィールドのコード
                      required:
                        type: boolean
                        description: 入力必須かどうか
                      fieldType:
                        type: string
                        description: フィールドの型
                      options:
                        type:
                          - array
                          - 'null'
                        description: 選択肢。fieldTypeがcheckboxまたはpull_downのときのみ必須。
                        items:
                          type: string
                      visible:
                        type: boolean
                        description: 管理者以外も閲覧可能な場合true
                    required:
                      - code
      description: |-
        汎用マスタを更新します。

        このAPIの実行には、汎用マスタの管理権限が必要です。
    delete:
      summary: 汎用マスタを削除
      tags:
        - 汎用マスタ
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: deleteGeneralMaster
      description: |-
        汎用マスタを削除します。この汎用マスタのすべてのアイテムも同時に削除されます。

        このAPIの実行には、汎用マスタの管理権限が必要です。
  /v1/generalMasters/{generalMasterId}/items:
    parameters:
      - schema:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
        name: generalMasterId
        in: path
        required: true
        description: 汎用マスタのUUIDまたはコード
    get:
      summary: 汎用マスタアイテムの一覧を取得
      operationId: listGeneralMasterItems
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GeneralMasterItem'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: ページ
        - schema:
            type: integer
            default: 25
            minimum: 1
            maximum: 100
          in: query
          name: perPage
          description: 1ページあたりの件数
        - schema:
            type: string
            pattern: ^(createdAt|code|name)(-asc|-desc)?$
          in: query
          name: sortBy
          description: 'ソート対象のフィールドと順序。指定可能なフィールド: createdAt, code, name'
      tags:
        - 汎用マスタ
      description: 汎用マスタアイテムの一覧を取得します。
    post:
      summary: 汎用マスタアイテムを作成
      tags:
        - 汎用マスタ
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeneralMasterItem'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: createGeneralMasterItem
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                code:
                  type: string
                  description: コード。未指定の場合、ランダムな英数字が自動的に設定されます。
                name:
                  type: string
                  description: 名前
                description:
                  type: string
                  description: 説明
                startsOn:
                  type:
                    - string
                    - 'null'
                  description: 有効期限の開始日
                  format: date
                endsOn:
                  type:
                    - string
                    - 'null'
                  description: 有効期限の終了日
                  format: date
                inputs:
                  type: array
                  description: カスタムフィールドの入力。必須ではないカスタムフィールドを含む、すべてのカスタムフィールドに対して入力する必要があります。
                  items:
                    type: object
                    properties:
                      code:
                        type: string
                        description: フィールドのコード
                      value:
                        oneOf:
                          - type:
                              - string
                              - 'null'
                          - type: array
                            items:
                              type: string
                        description: 入力値。カスタムフィールドがcheckboxの場合は文字列の配列、それ以外は文字列。
                    required:
                      - code
                      - value
              required:
                - name
                - inputs
        description: ''
      description: |-
        汎用マスタアイテムを作成します。

        このAPIの実行には、汎用マスタの管理権限が必要です。
  /v1/generalMasters/{generalMasterId}/items/{itemId}:
    parameters:
      - schema:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
        name: generalMasterId
        in: path
        required: true
        description: 汎用マスタのUUIDまたはコード
      - schema:
          type: string
        name: itemId
        in: path
        required: true
        description: 汎用マスタアイテムのUUIDまたはコード
    get:
      summary: 汎用マスタアイテムを取得
      tags:
        - 汎用マスタ
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeneralMasterItem'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: getGeneralMasterItem
      description: 汎用マスタアイテムを一件取得します。
    patch:
      summary: 汎用マスタアイテムを更新
      tags:
        - 汎用マスタ
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeneralMasterItem'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: updateGeneralMasterItem
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                code:
                  type: string
                  description: コード。未指定の場合、ランダムな英数字が自動的に設定されます。
                name:
                  type: string
                  description: 名前
                description:
                  type: string
                  description: 説明
                startsOn:
                  type:
                    - string
                    - 'null'
                  description: 有効期限の開始日
                  format: date
                endsOn:
                  type:
                    - string
                    - 'null'
                  description: 有効期限の終了日
                  format: date
                inputs:
                  description: カスタムフィールドの入力。必須ではないカスタムフィールドを含む、すべてのカスタムフィールドに対して入力する必要があります。
                  type: array
                  items:
                    type: object
                    properties:
                      code:
                        type: string
                        description: フィールドのコード
                      value:
                        oneOf:
                          - type:
                              - string
                              - 'null'
                          - type: array
                            items:
                              type: string
                        description: 入力値。カスタムフィールドがcheckboxの場合文字列の配列、それ以外の場合文字列。
                    required:
                      - code
                      - value
      description: |-
        汎用マスタアイテムを更新します。

        このAPIの実行には、汎用マスタの管理権限が必要です。
    delete:
      summary: 汎用マスタアイテムを削除
      tags:
        - 汎用マスタ
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: deleteGeneralMasterItem
      description: |-
        汎用マスタアイテムを削除します。

        このAPIの実行には、汎用マスタの管理権限が必要です。
  /v1/grades:
    get:
      summary: 役職の一覧を取得
      tags:
        - 役職
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Grade'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: listGrades
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: ページ
        - schema:
            type: integer
            default: 25
            minimum: 1
            maximum: 100
          in: query
          name: perPage
          description: 1ページあたりの件数
        - schema:
            type: string
            pattern: ^(level|code)(-asc|-desc)?$
          in: query
          name: sortBy
          description: 'ソート対象のフィールドと順序。指定可能なフィールド: level, code'
      description: |-
        役職の一覧を取得します。

        このAPIの実行には、ユーザーの管理権限が必要です。
    post:
      summary: 役職を作成
      tags:
        - 役職
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Grade'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: createGrade
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GradeCreateBody'
      description: |-
        役職を作成します。

        このAPIの実行には、ユーザーの管理権限が必要です。
  /v1/grades/{gradeId}:
    parameters:
      - schema:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
        name: gradeId
        in: path
        required: true
        description: 役職のUUIDまたはコード
    get:
      summary: 役職を取得
      tags:
        - 役職
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Grade'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: getGrade
      description: |-
        役職を一件取得します。

        このAPIの実行には、ユーザーの管理権限が必要です。
    delete:
      summary: 役職を削除
      tags:
        - 役職
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: deleteGrade
      description: |-
        役職を削除します。

        このAPIの実行には、ユーザーの管理権限が必要です。

        注意：この役職を使用しているユーザーがいる場合、エラーとなります。先にユーザーから対象の役職を外してください。
    patch:
      summary: 役職を更新
      operationId: updateGrade
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Grade'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      tags:
        - 役職
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GradeUpdateBody'
      description: |-
        役職を更新します。

        このAPIの実行には、ユーザーの管理権限が必要です。
  /v1/grades/{gradeId}/default:
    parameters:
      - schema:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
        name: gradeId
        in: path
        required: true
        description: 役職のUUIDまたはコード
    post:
      summary: デフォルトの役職を変更
      operationId: setDefaultGrade
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      description: |-
        指定した役職をデフォルトにします。
        同時に、これまでデフォルトだった役職は自動的にデフォルトではなくなります。

        このAPIの実行には、ユーザーの管理権限が必要です。
      tags:
        - 役職
  /v1/organizationCharts:
    get:
      summary: 組織図の一覧を取得
      tags:
        - 組織図
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OrganizationChart'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: listOrganizationCharts
      parameters:
        - schema:
            type: integer
            default: 1
            minimum: 1
          in: query
          name: page
          description: ページ
        - schema:
            type: integer
            default: 25
            minimum: 1
            maximum: 100
          in: query
          name: perPage
          description: 1ページあたりの件数
        - schema:
            type: string
            pattern: ^(createdAt|name)(-asc|-desc)?$
          in: query
          name: sortBy
          description: 'ソート対象のフィールドと順序。指定可能なフィールド: createdAt, name'
      description: |-
        組織図の一覧を取得します。

        このAPIの実行には、チームの管理権限が必要です。

        注意：パフォーマンス上の理由から、組織図の一覧取得時は組織図内のチームのリストがレスポンスに含まれません。
        組織図のすべての情報を取得したい場合は、組織図を一件だけ取得するAPI経由で取得してください。
    post:
      summary: 組織図を作成
      tags:
        - 組織図
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationChartDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: createOrganizationChart
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrganizationChartBody'
      description: |-
        組織図を作成します。

        このAPIの実行には、チームの管理権限が必要です。
  /v1/organizationCharts/{organizationChartId}:
    parameters:
      - schema:
          type: string
          format: uuid
        name: organizationChartId
        in: path
        required: true
        description: 組織図のUUID
    delete:
      summary: 組織図を削除
      tags:
        - 組織図
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: deleteOrganizationChart
      description: |-
        組織図を削除します。同時に、組織図内のチームや所属もすべて削除されます。

        このAPIの実行には、チームの管理権限が必要です。

        注意：現在有効な組織図は削除できません。
        注意：組織図の削除は時間がかかることがあるため、削除は非同期で実行されます。削除の完了前にレスポンスを返すので注意してください。
    get:
      summary: 組織図を取得
      operationId: getOrganizationChart
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationChartDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      tags:
        - 組織図
      description: |-
        組織図を一件取得します。

        このAPIの実行には、チームの管理権限が必要です。
    patch:
      summary: 組織図を更新
      operationId: updateOrganizationChart
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationChartDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      tags:
        - 組織図
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrganizationChartBody'
      description: |-
        組織図を更新します。

        このAPIの実行には、チームの管理権限が必要です。
  /v1/organizationChart:
    get:
      summary: 現在の組織図を取得
      tags:
        - 組織図
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationChartDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: getCurrentOrganizationChart
      description: |-
        現在有効になっている組織図を取得します。

        このAPIの実行には、チームの管理権限が必要です。
  /v1/organizationCharts/{organizationChartId}/activate:
    parameters:
      - schema:
          type: string
          format: uuid
        name: organizationChartId
        in: path
        required: true
        description: 組織図のUUID
    post:
      summary: 組織図を有効化
      operationId: activateOrganizationChart
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationChartDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      tags:
        - 組織図
      description: |-
        指定した組織図を有効化し、ワークフローで使用する組織図を切り替えます。
        他の組織図に有効化の予定がある場合、それらの予定は削除されます。

        このAPIの実行には、チームの管理権限が必要です。

        注意：組織図の有効化は時間がかかることがあるため、有効化は非同期で実行されます。有効化の完了前にレスポンスを返すので注意してください。
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                dueOn:
                  type: string
                  format: date
                  description: 有効化する日付。nullの場合、即時で有効化します。
  /v1/organizationCharts/{organizationChartId}/teams:
    parameters:
      - schema:
          type: string
          format: uuid
        name: organizationChartId
        in: path
        required: true
        description: 組織図のUUID
    get:
      summary: チーム一覧を取得
      operationId: listTeams
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Team'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      description: |-
        指定した組織図内のチーム一覧を取得します。

        parentIdを指定した場合は指定した親チームの配下チームの一覧を、parentIdを指定しない場合は組織図内のルートのチーム一覧を返します。

        このAPIの実行には、チームの管理権限が必要です。
      parameters:
        - schema:
            type: string
          in: query
          name: parentId
          description: 親チームのUUID
        - schema:
            type: integer
            default: 1
            minimum: 1
          in: query
          name: page
          description: ページ
        - schema:
            type: integer
            default: 25
            minimum: 1
            maximum: 100
          in: query
          name: perPage
          description: 1ページあたりの件数
      tags:
        - チーム
    post:
      summary: チームを作成
      tags:
        - チーム
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TeamDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: createTeam
      description: |-
        指定した組織図内にチームを作成します。

        このAPIの実行には、チームの管理権限が必要です。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TeamCreateBody'
  /v1/organizationCharts/{organizationChartId}/teams/{teamId}:
    parameters:
      - schema:
          type: string
          format: uuid
        name: organizationChartId
        in: path
        required: true
        description: 組織図のUUID
      - schema:
          type: string
        name: teamId
        in: path
        required: true
        description: チームのUUIDまたはコード
    get:
      summary: チームを取得
      tags:
        - チーム
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TeamDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: getTeam
      description: |-
        チームを一件取得します。

        このAPIの実行には、チームの管理権限が必要です。
    patch:
      summary: チームを編集
      operationId: updateTeam
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TeamDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      tags:
        - チーム
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TeamUpdateBody'
      description: |-
        チームを更新します。

        このAPIの実行には、チームの管理権限が必要です。
    delete:
      summary: チームを削除
      tags:
        - チーム
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: deleteTeam
      description: |-
        チームを削除します。同時に、このチームの所属もすべて削除されます。

        このAPIの実行には、チームの管理権限が必要です。
  /v1/organizationCharts/{organizationChartId}/teams/{teamId}/memberships:
    parameters:
      - schema:
          type: string
          format: uuid
        name: organizationChartId
        in: path
        required: true
        description: 組織図のUUID
      - schema:
          type: string
        name: teamId
        in: path
        required: true
        description: チームのUUIDまたはコード
    get:
      summary: チームのメンバー一覧を取得
      operationId: listTeamMembers
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MemberUser'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      description: |-
        チームのメンバー一覧を取得します。

        このAPIの実行には、チームの管理権限が必要です。
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: ページ。1が先頭のページ。
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          in: query
          name: perPage
          description: 1ページあたりの件数
      tags:
        - チーム
    post:
      summary: チームにメンバーを追加
      tags:
        - チーム
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: createTeamMembers
      description: |-
        指定したチームにメンバーを追加します。最大10人まで同時に追加可能です。

        このAPIの実行には、チームの管理権限が必要です。

        注意: チームに上長は最低一人必要です。上長が不在の場合、APIは422 Unprocessable Contentを返します。
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                users:
                  type: array
                  description: メンバーに追加したいユーザー情報の配列
                  maxItems: 10
                  minItems: 1
                  uniqueItems: true
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                        description: ユーザーのUUID
                        format: uuid
                      leader:
                        type: boolean
                        description: 上長の場合、true
                      gradeIds:
                        type: array
                        minItems: 1
                        description: 役職のUUID
                        items:
                          type: string
                          format: uuid
                    required:
                      - id
                      - leader
              required:
                - users
    delete:
      summary: チームからメンバーを削除
      operationId: deleteTeamMembers
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      tags:
        - チーム
      description: |-
        指定したチームからメンバーを削除します。最大10人まで同時に削除可能です。

        このAPIの実行には、チームの管理権限が必要です。

        注意: 削除後もメンバーが残る場合、チームに上長は最低一人必要です。メンバー削除によって上長が不在になる場合、APIは422 Unprocessable Contentを返します。
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                userIds:
                  type: array
                  description: ユーザーのUUIDの配列
                  uniqueItems: true
                  minItems: 1
                  maxItems: 10
                  items:
                    type: string
                    format: uuid
              required:
                - userIds
  /v1/organizationCharts/{organizationChartId}/teams/{teamId}/memberships/{userId}:
    parameters:
      - schema:
          type: string
          format: uuid
        name: organizationChartId
        in: path
        required: true
        description: 組織図のUUID
      - schema:
          type: string
        name: teamId
        in: path
        required: true
        description: チームのUUIDまたはコード
      - schema:
          type: string
        name: userId
        in: path
        required: true
        description: ユーザーのUUIDまたはコード
    patch:
      summary: チームのメンバーを更新
      operationId: updateTeamMember
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      tags:
        - チーム
      description: |-
        指定したメンバーを更新します。

        このAPIの実行には、チームの管理権限が必要です。

        注意: チームに上長は最低一人は必要です。上長が不在の場合、APIは422 Unprocessable Contentを返します。
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                leader:
                  type: boolean
                  description: 上長の場合、true
                gradeIds:
                  type: array
                  description: 役職のUUID
                  minItems: 1
                  items:
                    type: string
                    format: uuid
              required:
                - leader
                - gradeIds
  /v1/roles:
    get:
      summary: 管理者ロールの一覧を取得
      tags:
        - 管理者ロール
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Role'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: listRoles
      parameters:
        - schema:
            type: integer
            default: 1
            minimum: 1
          in: query
          name: page
          description: ページ
        - schema:
            type: integer
            default: 25
            minimum: 1
            maximum: 100
          in: query
          name: perPage
          description: 1ページあたりの件数
        - schema:
            type: string
            pattern: ^(createdAt|name)(-asc|-desc)?$
          in: query
          name: sortBy
          description: 'ソート対象のフィールドと順序。指定可能なフィールド: createdAt, name'
      description: |-
        管理者ロールの一覧を取得します。

        このAPIの実行には、ロールの管理権限が必要です。
    post:
      summary: 管理者ロールを作成
      tags:
        - 管理者ロール
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoleDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: createRole
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoleCreateBody'
      description: |-
        管理者ロールを作成します。

        このAPIの実行には、ロールの管理権限が必要です。
  /v1/roles/{roleId}:
    parameters:
      - schema:
          type: string
          format: uuid
        name: roleId
        in: path
        required: true
        description: 管理者ロールのUUID
    get:
      summary: 管理者ロールを取得
      tags:
        - 管理者ロール
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoleDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: getRole
      description: |-
        管理者ロールを一件取得します。

        このAPIの実行には、ロールの管理権限が必要です。
    patch:
      summary: 管理者ロールを更新
      tags:
        - 管理者ロール
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoleDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: updateRole
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoleUpdateBody'
      description: |-
        管理者ロールを更新します。

        このAPIの実行には、ロールの管理権限が必要です。
    delete:
      summary: 管理者ロールを削除
      tags:
        - 管理者ロール
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: deleteRole
      description: |-
        管理者ロールを削除します。

        このAPIの実行には、ロールの管理権限が必要です。
  /v1/roles/{roleId}/memberships:
    parameters:
      - schema:
          type: string
          format: uuid
        name: roleId
        in: path
        required: true
        description: 管理者ロールのUUID
    post:
      summary: 管理者ロールにメンバーを追加
      tags:
        - 管理者ロール
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: createRoleMembers
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                userIds:
                  type: array
                  description: ユーザーUUIDの配列
                  minItems: 1
                  maxItems: 10
                  uniqueItems: true
                  items:
                    type: string
                    format: uuid
              required:
                - userIds
      description: |-
        管理者ロールにメンバーを追加します。最大10人まで複数のメンバーを同時に追加可能です。

        このAPIの実行には、ロールの管理権限が必要です。
    get:
      summary: 管理者ロールのメンバー一覧を取得
      operationId: listRoleMembers
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/User'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: ページ
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          in: query
          name: perPage
          description: 1ページあたりの件数
      tags:
        - 管理者ロール
      description: |-
        管理者ロールのメンバー一覧を取得します。

        このAPIの実行には、ロールの管理権限が必要です。
  /v1/roles/{roleId}/memberships/{userId}:
    parameters:
      - schema:
          type: string
          format: uuid
        name: roleId
        in: path
        required: true
        description: 管理者ロールのUUID
      - schema:
          type: string
        name: userId
        in: path
        required: true
        description: ユーザーのUUIDまたはコード
    delete:
      summary: 管理者ロールからメンバーを削除
      tags:
        - 管理者ロール
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: deleteRoleMember
      description: |-
        管理者ロールからメンバーを削除します。

        このAPIの実行には、ロールの管理権限が必要です。
  /v1/tickets:
    get:
      summary: チケット一覧を取得
      tags:
        - チケット
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TicketWithStep'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: listTickets
      description: |-
        チケットの一覧を取得します。複数の条件を組み合わせて、フィルタ可能です。

        注意1：パフォーマンス上の理由から、チケットの一覧取得ではフォームの入力や承認経路などはレスポンスに含まれません。
        より詳細なチケット情報を取得したい場合は、チケットを一件だけ取得するAPIをで取得してください。

        注意2：APIを実行するユーザーが閲覧可能なチケットのみ取得可能です。
        テナント内のすべてのチケットを対象としたい場合、APIを実行するユーザーがチケットの管理権限（閲覧）を持っている必要があります。
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: ページ
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          in: query
          name: perPage
          description: 1ページあたりの件数
        - schema:
            type: string
            pattern: ^(createdAt|updatedAt)(-asc|-desc)?$
          in: query
          name: sortBy
          description: 'ソート対象のフィールドと順序。指定可能なフィールド: createdAt, updatedAt'
        - schema:
            oneOf:
              - type: string
                enum:
                  - draft
                  - in_progress
                  - rejected
                  - completed
                  - denied
                  - archived
              - type: array
                items:
                  type: string
                  enum:
                    - draft
                    - in_progress
                    - rejected
                    - completed
                    - denied
                    - archived
          in: query
          name: status
          description: ステータスの配列
        - schema:
            type: array
            items:
              type: string
              format: uuid
          in: query
          name: subStatusIds
          description: サブステータスのUUIDの配列
        - schema:
            type: string
          in: query
          name: workflowId
          description: ワークフローのUUID
        - schema:
            type: string
          in: query
          name: authorId
          description: 申請者のUUID
        - schema:
            type: string
          in: query
          name: authorTeamFullName
          description: 申請時に選択したチームの上位組織を含む名前
        - schema:
            type: string
          in: query
          name: ticketNumber
          description: チケット番号
        - schema:
            type: string
            anyOf:
              - format: date
              - format: date-time
          in: query
          name: createdAtStart
          description: 作成日時の起点
        - schema:
            type: string
            anyOf:
              - format: date
              - format: date-time
          in: query
          name: createdAtEnd
          description: 作成日時の終点
        - schema:
            type: string
            anyOf:
              - format: date
              - format: date-time
          in: query
          name: updatedAtStart
          description: 更新日時の起点
        - schema:
            type: string
            anyOf:
              - format: date
              - format: date-time
          in: query
          name: updatedAtEnd
          description: 更新日時の終点
        - schema:
            type: string
            anyOf:
              - format: date
              - format: date-time
          in: query
          name: openedAtStart
          description: 申請日時の起点
        - schema:
            type: string
            anyOf:
              - format: date
              - format: date-time
          in: query
          name: openedAtEnd
          description: 申請日時の終点
        - schema:
            type: string
            anyOf:
              - format: date
              - format: date-time
          in: query
          name: completedAtStart
          description: 完了日時の起点
        - schema:
            type: string
            anyOf:
              - format: date
              - format: date-time
          in: query
          name: completedAtEnd
          description: 完了日時の終点
        - schema:
            type: string
            anyOf:
              - format: date
              - format: date-time
          in: query
          name: archivedAtStart
          description: アーカイブ日時の起点
        - schema:
            type: string
            anyOf:
              - format: date
              - format: date-time
          in: query
          name: archivedAtEnd
          description: アーカイブ日時の終点
        - schema:
            type: string
            format: uuid
          in: query
          name: assigneeUserId
          description: 承認者のUUID。assigneeStatusとセットで指定してください。
        - schema:
            type: array
            items:
              type: string
              enum:
                - all
                - current
                - approved
          in: query
          name: assigneeStatus
          description: 承認者の状態。assigneeUserIdとセットで指定してください。
        - schema:
            type: string
          in: query
          name: stepTitle
          description: 現在の承認ステップ名
    post:
      summary: チケットを作成
      operationId: createTicket
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TicketDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      description: チケットを作成します。
      tags:
        - チケット
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                  description: ステータス。作成ではdraftまたはin_progressのみ選択可能です。
                  enum:
                    - draft
                    - in_progress
                workflowId:
                  type: string
                  description: ワークフローのUUID
                  format: uuid
                authorTeamId:
                  type: string
                  format: uuid
                  description: 申請チームのUUID
                proxyClientUserId:
                  type:
                    - string
                    - 'null'
                  description: 依頼者となるユーザーのUUID。代理申請の場合のみ指定してください。
                  format: uuid
                title:
                  type:
                    - string
                    - 'null'
                  description: チケットのタイトル。ワークフローでtitleInputModeがinputのときのみ設定可能です。
                slipItems:
                  type: array
                  description: 明細アイテムの配列。明細ワークフローの場合、このフィールドは必須です。
                  items:
                    type: object
                    description: 明細アイテム
                    properties:
                      slipSectionId:
                        type:
                          - string
                          - 'null'
                        format: uuid
                        description: 明細セクションのUUID。slipSectionIdまたはslipSectionCodeのいずれかを指定してください。省略時は最初の明細セクションが使用されます。
                      slipSectionCode:
                        type:
                          - string
                          - 'null'
                        description: 明細セクションのコード。slipSectionIdまたはslipSectionCodeのいずれかを指定してください。省略時は最初の明細セクションが使用されます。
                      inputs:
                        type: array
                        description: 明細アイテム入力の配列
                        items:
                          type: object
                          description: 明細アイテム入力
                          properties:
                            slipFieldId:
                              type:
                                - string
                                - 'null'
                              description: 明細フィールドのUUID。slipFieldIdまたはslipFieldCodeは片方のみ必須です。
                              format: uuid
                            slipFieldCode:
                              type:
                                - string
                                - 'null'
                              description: 明細フィールドのコード。slipFieldIdまたはslipFieldCodeは片方のみ必須です。
                            value:
                              description: 入力値。フィールドがチェックボックスタイプのときは配列で指定してください。
                              oneOf:
                                - type:
                                    - string
                                    - 'null'
                                - type: array
                                  items:
                                    type: string
                            generalMasterItemId:
                              description: 汎用マスタアイテムのUUID。フィールドが汎用マスタタイプのときのみ指定してください。
                              oneOf:
                                - type:
                                    - string
                                    - 'null'
                                  format: uuid
                                - type: array
                                  items:
                                    type: string
                                    format: uuid
                            userId:
                              description: ユーザーUUID。フィールドがユーザータイプのときのみ指定してください。
                              oneOf:
                                - type:
                                    - string
                                    - 'null'
                                  format: uuid
                                - type: array
                                  items:
                                    type: string
                                    format: uuid
                            teamId:
                              description: チームUUID。フィールドがチームタイプのときのみ指定してください。
                              oneOf:
                                - type:
                                    - string
                                    - 'null'
                                  format: uuid
                                - type: array
                                  items:
                                    type: string
                                    format: uuid
                            ticketId:
                              description: チケットUUID。フィールドがチケットタイプのときのみ指定してください。
                              oneOf:
                                - type:
                                    - string
                                    - 'null'
                                  format: uuid
                                - type: array
                                  items:
                                    type: string
                                    format: uuid
                            files:
                              type:
                                - array
                                - 'null'
                              description: |-
                                添付ファイルの署名済みID。
                                フィールドがファイルタイプのときのみ指定してください。
                              items:
                                type: string
                    required:
                      - inputs
                inputs:
                  type: array
                  description: フォームの入力の配列。ワークフローのすべてのフォームフィールドに対応する入力を入れてください。
                  items:
                    type: object
                    description: フォームの入力
                    properties:
                      formFieldId:
                        type:
                          - string
                          - 'null'
                        description: フォームフィールドのUUID。formFieldIdまたはformFieldCodeは片方のみ必須です。
                        format: uuid
                      formFieldCode:
                        type:
                          - string
                          - 'null'
                        description: フォームフィールドのコード。formFieldIdまたはformFieldCodeは片方のみ必須です。
                      value:
                        description: 入力値。フィールドがチェックボックスタイプのときは配列で指定してください。
                        oneOf:
                          - type:
                              - string
                              - 'null'
                          - type: array
                            items:
                              type: string
                      generalMasterItemId:
                        description: 汎用マスタアイテムのUUID。フィールドが汎用マスタタイプのときのみ指定してください。
                        oneOf:
                          - type:
                              - string
                              - 'null'
                            format: uuid
                          - type: array
                            items:
                              type: string
                              format: uuid
                      userId:
                        description: ユーザーUUID。フィールドがユーザータイプのときのみ指定してください。
                        oneOf:
                          - type:
                              - string
                              - 'null'
                            format: uuid
                          - type: array
                            items:
                              type: string
                              format: uuid
                      teamId:
                        description: チームUUID。フィールドがチームタイプのときのみ指定してください。
                        oneOf:
                          - type:
                              - string
                              - 'null'
                            format: uuid
                          - type: array
                            items:
                              type: string
                              format: uuid
                      ticketId:
                        description: チケットUUID。フィールドがチケットタイプのときのみ指定してください。
                        oneOf:
                          - type:
                              - string
                              - 'null'
                            format: uuid
                          - type: array
                            items:
                              type: string
                              format: uuid
                      files:
                        type:
                          - array
                          - 'null'
                        description: |-
                          添付ファイルの署名済みID。
                          フィールドがファイルタイプのときのみ指定してください。
                        items:
                          type: string
                cloudSignDocument:
                  type: object
                  description: クラウドサイン書類。ワークフローでクラウドサイン連携が有効な場合のみ指定してください。
                  properties:
                    id:
                      type: string
                      description: クラウドサイン書類のID
                    title:
                      type: string
                      description: クラウドサイン書類のタイトル
                    sandbox:
                      type: string
                      description: クラウドサインのサンドボックス環境の場合true
                  required:
                    - id
                    - title
                    - sandbox
                approvers:
                  type:
                    - array
                    - 'null'
                  description: 承認タイプが「申請者が指名」の経路ステップの承認者を指定する配列。
                  items:
                    type: object
                    required:
                      - userId
                      - routeStepCode
                    properties:
                      routeStepCode:
                        description: 承認者を指定する経路ステップのコード
                        type: string
                      userId:
                        description: 承認者として指定するユーザーのUUID
                        type: array
                        items:
                          type: string
                          format: uuid
              required:
                - status
                - workflowId
                - authorTeamId
                - inputs
  /v1/tickets/tasks:
    get:
      summary: 承認リクエスト一覧を取得
      tags:
        - チケット
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TicketWithStep'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: listTasks
      description: |-
        現在のユーザーにアサインされている承認リクエストの一覧を取得します。複数の条件を組み合わせて、フィルタ可能です。

        注意：パフォーマンス上の理由から、チケットの一覧取得ではフォームの入力や承認経路などはレスポンスに含まれません。
        より詳細なチケット情報を取得したい場合は、チケットを一件だけ取得するAPIをで取得してください。
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: ページ
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          in: query
          name: perPage
          description: 1ページあたりの件数
        - schema:
            type: string
            pattern: ^(createdAt|updatedAt|openedAt|assignedToMeAt)(-asc|-desc)?$
          in: query
          name: sortBy
          description: 'ソート対象のフィールドと順序。指定可能なフィールド: createdAt, updatedAt, openedAt, assignedToMeAt'
        - schema:
            type: array
            items:
              type: string
              enum:
                - draft
                - in_progress
                - rejected
                - completed
                - deleted
          in: query
          name: status
          description: ステータスの配列
        - schema:
            type: array
            items:
              type: string
              format: uuid
          in: query
          name: subStatusIds
          description: サブステータスのUUIDの配列
        - schema:
            type: string
          in: query
          name: workflowId
          description: ワークフローのUUID
        - schema:
            type: string
          in: query
          name: authorId
          description: 申請者のUUID
        - schema:
            type: string
          in: query
          name: authorTeamFullName
          description: 申請時に選択したチームの上位組織を含む名前
        - schema:
            type: string
          in: query
          name: ticketNumber
          description: チケット番号
        - schema:
            type: string
            format: date-time
          in: query
          name: createdAtStart
          description: 作成日時の起点
        - schema:
            type: string
            format: date-time
          in: query
          name: createdAtEnd
          description: 作成日時の終点
        - schema:
            type: string
            format: date-time
          in: query
          name: updatedAtStart
          description: 更新日時の起点
        - schema:
            type: string
            format: date-time
          in: query
          name: updatedAtEnd
          description: 更新日時の終点
        - schema:
            type: string
            format: date-time
          in: query
          name: openedAtStart
          description: 申請日時の起点
        - schema:
            type: string
            format: date-time
          in: query
          name: openedAtEnd
          description: 申請日時の終点
        - schema:
            type: string
            format: date-time
          in: query
          name: assignedToMeAtStart
          description: 承認依頼日時の起点
        - schema:
            type: string
            format: date-time
          in: query
          name: assignedToMeAtEnd
          description: 承認依頼日時の終点
        - schema:
            type: string
            format: date-time
          in: query
          name: completedAtStart
          description: 完了日時の起点
        - schema:
            type: string
            format: date-time
          in: query
          name: completedAtEnd
          description: 完了日時の終点
        - schema:
            type: string
            format: date-time
          in: query
          name: archivedAtStart
          description: アーカイブ日時の起点
        - schema:
            type: string
            format: date-time
          in: query
          name: archivedAtEnd
          description: アーカイブ日時の終点
        - schema:
            type: string
          in: query
          name: stepTitle
          description: 現在の承認ステップ名
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
          in: query
          name: pending
          description: |-
            承認の保留状態でチケットを絞り込みます。
            - true: 保留中のチケットのみを取得
            - false: 保留されていないチケットのみを取得
  /v1/tickets/{ticketId}:
    parameters:
      - schema:
          type: string
          format: uuid
        name: ticketId
        in: path
        required: true
        description: チケットのUUID
    get:
      summary: チケットを取得
      tags:
        - チケット
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TicketDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: getTicket
      description: チケットを一件取得します。フォームの入力や承認経路などを含む詳細なデータを返します。
    patch:
      summary: チケットを更新
      operationId: updateTicket
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TicketDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      description: |-
        チケットを更新します。

        注意1: チケットのステータスが下書きまたは差し戻しの場合、申請者が更新可能です。

        注意2: チケットのステータスが処理中の場合、承認者が承認者用フィールドのみ更新可能です。リクエストボディにはslipItemsまたはinputsのみ設定してください（他のパラメータは無視されます）。

        注意3: 明細ワークフローの場合、slipItemsは必須です。
      tags:
        - チケット
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                  enum:
                    - draft
                    - in_progress
                    - rejected
                  description: ステータス。更新ではdraft, in_progress, rejectedのみ選択可能です。
                authorTeamId:
                  type: string
                  description: 申請チームのUUID
                  format: uuid
                proxyClientUserId:
                  type: string
                  description: 依頼者となるユーザーのUUID。代理申請の場合のみ指定してください。
                  format: uuid
                title:
                  type: string
                  description: チケットのタイトル。ワークフローでallow_titleがtrueのときのみ設定可能です。
                slipItems:
                  type: array
                  description: 明細アイテムの配列
                  items:
                    type: object
                    description: 明細アイテム
                    properties:
                      slipSectionId:
                        type:
                          - string
                          - 'null'
                        format: uuid
                        description: 明細セクションのUUID。slipSectionIdまたはslipSectionCodeのいずれかを指定してください。省略時は最初の明細セクションが使用されます。
                      slipSectionCode:
                        type:
                          - string
                          - 'null'
                        description: 明細セクションのコード。slipSectionIdまたはslipSectionCodeのいずれかを指定してください。省略時は最初の明細セクションが使用されます。
                      inputs:
                        type: array
                        description: 明細アイテム入力の配列
                        items:
                          type: object
                          description: 明細アイテム入力
                          properties:
                            slipFieldId:
                              type:
                                - string
                                - 'null'
                              description: 明細フィールドのUUID。slipFieldIdまたはslipFieldCodeは片方のみ必須です。
                            slipFieldCode:
                              type:
                                - string
                                - 'null'
                              description: 明細フィールドのコード。slipFieldIdまたはslipFieldCodeは片方のみ必須です。
                            value:
                              description: 入力値。フィールドがチェックボックスタイプのときは配列で指定してください。
                              oneOf:
                                - type:
                                    - string
                                    - 'null'
                                - type: array
                                  items:
                                    type: string
                            generalMasterItemId:
                              description: 汎用マスタアイテムのUUID。フィールドが汎用マスタタイプのときのみ指定してください。
                              oneOf:
                                - type:
                                    - string
                                    - 'null'
                                  format: uuid
                                - type: array
                                  items:
                                    type: string
                                    format: uuid
                            userId:
                              description: ユーザーUUID。フィールドがユーザータイプのときのみ指定してください。
                              oneOf:
                                - type:
                                    - string
                                    - 'null'
                                  format: uuid
                                - type: array
                                  items:
                                    type: string
                                    format: uuid
                            teamId:
                              description: チームUUID。フィールドがチームタイプのときのみ指定してください。
                              oneOf:
                                - type:
                                    - string
                                    - 'null'
                                  format: uuid
                                - type: array
                                  items:
                                    type: string
                                    format: uuid
                            ticketId:
                              description: チケットUUID。フィールドがチケットタイプのときのみ指定してください。
                              oneOf:
                                - type:
                                    - string
                                    - 'null'
                                  format: uuid
                                - type: array
                                  items:
                                    type: string
                                    format: uuid
                            files:
                              type:
                                - array
                                - 'null'
                              description: |-
                                添付ファイルの署名済みID。
                                フィールドがファイルタイプのときのみ指定してください。
                              items:
                                type: string
                    required:
                      - inputs
                inputs:
                  type: array
                  description: |-
                    フォームの入力の配列。
                    注意：申請者による更新時は、ワークフローのすべてのフォームフィールドに対応する入力を入れてください。
                    注意：承認者による更新時は、承認者用フィールドに対応する入力のみ入れてください。
                    注意：明細ワークフローの場合、slipItemsも同時にリクエストボディに入れてください。
                  items:
                    type: object
                    description: フォームの入力
                    properties:
                      formFieldId:
                        type:
                          - string
                          - 'null'
                        description: フォームフィールドのUUID。formFieldIdまたはformFieldCodeは片方のみ必須です。
                        format: uuid
                      formFieldCode:
                        type:
                          - string
                          - 'null'
                        description: フォームフィールドのコード。formFieldIdまたはformFieldCodeは片方のみ必須です。
                      value:
                        description: 入力値。フィールドがチェックボックスタイプのときは配列で指定してください。
                        oneOf:
                          - type:
                              - string
                              - 'null'
                          - type: array
                            items:
                              type: string
                      generalMasterItemId:
                        description: 汎用マスタアイテムのUUID。フィールドが汎用マスタタイプのときのみ指定してください。
                        oneOf:
                          - type:
                              - string
                              - 'null'
                            format: uuid
                          - type: array
                            items:
                              type: string
                              format: uuid
                      userId:
                        description: ユーザーUUID。フィールドがユーザータイプのときのみ指定してください。
                        oneOf:
                          - type:
                              - string
                              - 'null'
                            format: uuid
                          - type: array
                            items:
                              type: string
                              format: uuid
                      teamId:
                        description: チームUUID。フィールドがチームタイプのときのみ指定してください。
                        oneOf:
                          - type:
                              - string
                              - 'null'
                            format: uuid
                          - type: array
                            items:
                              type: string
                              format: uuid
                      ticketId:
                        description: チケットUUID。フィールドがチケットタイプのときのみ指定してください。
                        oneOf:
                          - type:
                              - string
                              - 'null'
                            format: uuid
                          - type: array
                            items:
                              type: string
                              format: uuid
                      files:
                        type:
                          - array
                          - 'null'
                        description: |-
                          添付ファイルの署名済みID。
                          フィールドがファイルタイプのときのみ指定してください。
                        items:
                          type: string
                cloudSignDocument:
                  type: object
                  description: クラウドサイン書類。ワークフローでクラウドサイン連携が有効な場合のみ指定してください。
                  properties:
                    id:
                      type: string
                      description: クラウドサイン書類のID
                    title:
                      type: string
                      description: クラウドサイン書類のタイトル
                    sandbox:
                      type: boolean
                      description: クラウドサインのサンドボックス環境の場合true
                  required:
                    - id
                    - title
                    - sandbox
                approvers:
                  type:
                    - array
                    - 'null'
                  description: 承認タイプが「申請者が指名」の経路ステップの承認者を指定する配列。
                  items:
                    type: object
                    required:
                      - userId
                      - routeStepCode
                    properties:
                      routeStepCode:
                        description: 承認者を指定する経路ステップのコード
                        type: string
                      userId:
                        description: 承認者として指定するユーザーのUUID
                        type: array
                        items:
                          type: string
                          format: uuid
  /v1/tickets/{ticketId}/approve:
    parameters:
      - schema:
          type: string
          format: uuid
        name: ticketId
        in: path
        required: true
        description: チケットのUUID
    post:
      summary: チケットを承認または確認する
      tags:
        - チケット
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TicketDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: approveTicket
      description: |-
        指定したチケットを承認もしくは確認します。
        APIの実行ユーザーがチケットにアサインされていない場合、403 Forbiddenを返します。
  /v1/tickets/{ticketId}/reject:
    parameters:
      - schema:
          type: string
          format: uuid
        name: ticketId
        in: path
        required: true
        description: チケットのUUID
    post:
      summary: チケットを差し戻す
      tags:
        - チケット
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TicketDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: rejectTicket
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                to:
                  type: integer
                  description: 差し戻し先のステップ番号（0が起票者、1が最初の承認ステップ）
              required:
                - to
      description: |-
        指定したチケットを差し戻します。
        APIの実行ユーザーがチケットにアサインされていない場合、403 Forbiddenを返します。
  /v1/tickets/{ticketId}/deny:
    parameters:
      - schema:
          type: string
          format: uuid
        name: ticketId
        in: path
        required: true
        description: チケットのUUID
    post:
      summary: チケットを却下する
      tags:
        - チケット
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TicketDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: denyTicket
      requestBody:
        content:
          application/json:
            schema:
              type: object
      description: |-
        指定したチケットを却下します。
        APIの実行ユーザーがチケットにアサインされていない場合、403 Forbiddenを返します。
  /v1/tickets/{ticketId}/withdraw:
    parameters:
      - schema:
          type: string
          format: uuid
        name: ticketId
        in: path
        required: true
        description: チケットのUUID
    post:
      summary: チケットを取り下げる
      tags:
        - チケット
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TicketDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: withdrawTicket
      description: 自分が作成したチケットを取り下げます。
  /v1/tickets/{ticketId}/archive:
    parameters:
      - schema:
          type: string
          format: uuid
        name: ticketId
        in: path
        required: true
        description: チケットのUUID
    post:
      summary: チケットをアーカイブ
      tags:
        - チケット
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TicketDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: archiveTicket
      description: |-
        チケットをアーカイブします。チケットのステータスがアーカイブステータスに変わりますが、引き続きUIやAPIでチケットにはアクセス可能です。

        注意：チケットをアーカイブ可能なユーザーはチケットのステータスによって異なります。詳しくは[ヘルプ](https://support.kickflow.com/hc/ja/articles/360058324973)をご覧ください。
  /v1/tickets/{ticketId}/links:
    parameters:
      - schema:
          type: string
          format: uuid
        name: ticketId
        in: path
        required: true
        description: チケットのUUID
    get:
      summary: チケットの関連チケットを取得する
      tags:
        - チケット
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Ticket'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: listTicketLinks
      description: 指定したチケットの関連チケットを取得します。
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: ページ
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          in: query
          name: perPage
          description: 1ページあたりの件数
  /v1/tickets/{ticketId}/viewers:
    parameters:
      - schema:
          type: string
          format: uuid
        name: ticketId
        in: path
        required: true
        description: チケットのUUID
    get:
      summary: 共有ユーザーの一覧を取得
      tags:
        - チケット
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TicketViewer'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: listViewers
      description: チケットの共有ユーザー一覧を取得します。
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: ページ
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          in: query
          name: perPage
          description: 1ページあたりの件数
        - schema:
            type: string
            pattern: ^(createdAt)(-asc|-desc)?$
          in: query
          name: sortBy
          description: 'ソート対象のフィールドと順序。指定可能なフィールド: createdAt'
    post:
      summary: 共有ユーザーを追加
      tags:
        - チケット
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: createViewer
      description: チケットに共有ユーザーを追加します。
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                userId:
                  anyOf:
                    - type: string
                      format: uuid
                    - type: array
                      items:
                        type: string
                        format: uuid
                    - type: 'null'
                  description: ユーザーのUUID。userIdとteamIdは片方のみ必須です。
                teamId:
                  anyOf:
                    - type: string
                      format: uuid
                    - type: array
                      items:
                        type: string
                        format: uuid
                    - type: 'null'
                  description: チームのUUID。userIdとteamIdは片方のみ必須です。
                gradeId:
                  type:
                    - string
                    - 'null'
                  format: uuid
                  description: 役職のUUID。teamId指定時のみ、任意で指定できます。
                descendants:
                  type:
                    - boolean
                    - 'null'
                  description: 下位のチームを含めるかどうかをteamId指定時のみ指定できます。未指定時はfalse扱いです。
  /v1/tickets/{ticketId}/viewers/{viewerId}:
    parameters:
      - schema:
          type: string
          format: uuid
        name: ticketId
        in: path
        required: true
        description: チケットのUUID
      - schema:
          type: string
          format: uuid
        name: viewerId
        in: path
        required: true
        description: 共有ユーザーのUUID
    delete:
      summary: 共有ユーザーを削除
      tags:
        - チケット
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: deleteViewer
      description: チケットの共有ユーザーを削除します。
  /v1/tickets/{ticketId}/comments:
    parameters:
      - schema:
          type: string
          format: uuid
        name: ticketId
        in: path
        required: true
        description: チケットのUUID
    get:
      summary: コメントの一覧を取得
      tags:
        - コメント
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Comment'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: listComments
      description: チケットのコメント一覧を取得します。
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: ページ
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          in: query
          name: perPage
          description: 1ページあたりの件数
        - schema:
            type: string
            pattern: ^(createdAt)(-asc|-desc)?$
          in: query
          name: sortBy
          description: 'ソート対象のフィールドと順序。指定可能なフィールド: createdAt'
    post:
      summary: コメントを投稿
      tags:
        - コメント
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Comment'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: createComment
      description: チケットにコメントを投稿します。
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                body:
                  type: string
                  description: 本文
                files:
                  type:
                    - array
                    - 'null'
                  description: 添付ファイルの署名済みID
                  items:
                    type: string
              required:
                - body
  /v1/tickets/{ticketId}/comments/{commentId}:
    parameters:
      - schema:
          type: string
          format: uuid
        name: ticketId
        in: path
        required: true
        description: チケットのUUID
      - schema:
          type: string
          format: uuid
        name: commentId
        in: path
        required: true
        description: コメントのUUID
    get:
      summary: コメントを取得
      tags:
        - コメント
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Comment'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: getComment
      description: チケットのコメントを取得します。
    patch:
      summary: コメントを更新
      tags:
        - コメント
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Comment'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: updateComment
      description: チケットのコメントを更新します。添付ファイルは更新できません。
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                body:
                  type: string
                  description: 本文
              required:
                - body
    delete:
      summary: コメントを削除
      tags:
        - コメント
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: deleteComment
      description: チケットのコメントを削除します。
  /v1/user:
    get:
      summary: 現在のユーザーを取得
      tags:
        - ユーザー
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: getCurrentUser
      description: 現在のユーザーを取得します。
  /v1/users:
    get:
      summary: ユーザー一覧を取得
      tags:
        - ユーザー
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/User'
          headers:
            Link:
              schema:
                type: string
              description: Link header (RFC-5988)
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: listUsers
      parameters:
        - schema:
            type: integer
            default: 1
            minimum: 1
          in: query
          name: page
          description: ページ
        - schema:
            type: integer
            default: 25
            minimum: 1
            maximum: 100
          in: query
          name: perPage
          description: 1ページあたりの件数
        - schema:
            type: array
            items:
              type: string
              enum:
                - invited
                - activated
                - suspended
                - deactivated
          in: query
          name: status
          description: ステータスによる絞り込み
        - schema:
            type: string
            pattern: ^(email|code)(-asc|-desc)?$
          in: query
          name: sortBy
          description: 'ソート対象のフィールドと順序。指定可能なフィールド: email, code'
      description: ユーザー一覧を取得します。
    post:
      summary: ユーザーを作成（招待）
      operationId: createUser
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      description: |-
        ユーザーを作成します。
        作成されたユーザーは招待済みステータスとなり、招待メールが送信されます。

        このAPIの実行には、ユーザーの管理権限が必要です。
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  format: email
                  description: メールアドレス
                code:
                  type: string
                  description: コード。未指定の場合、ランダムな英数字が自動的に設定されます。
                  maxLength: 100
                firstName:
                  type: string
                  description: 名
                  maxLength: 255
                lastName:
                  type: string
                  description: 姓
                  maxLength: 255
                sendEmail:
                  type: boolean
                  description: 招待メールを送信する場合true（デフォルト）、送信しない場合false
                employeeId:
                  type:
                    - string
                    - 'null'
                  description: 社員番号
                  maxLength: 30
                memberships:
                  type: array
                  description: 招待時に作成する所属の配列（最大5件）
                  maxItems: 5
                  items:
                    $ref: '#/components/schemas/InviteMembershipBody'
              required:
                - email
                - code
                - firstName
                - lastName
      tags:
        - ユーザー
  /v1/users/{userId}:
    parameters:
      - schema:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
        name: userId
        in: path
        required: true
        description: ユーザーのUUIDまたはコード
    get:
      summary: ユーザーを取得
      tags:
        - ユーザー
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: getUser
      description: ユーザーを一件取得します。
    delete:
      summary: ユーザーを削除
      tags:
        - ユーザー
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: deleteUser
      description: |-
        ユーザーを削除します（論理削除）。
        削除されたユーザーは削除済ステータスとなりますが、引き続きユーザー情報にアクセス可能です。

        このAPIの実行には、ユーザーの管理権限が必要です。
    patch:
      summary: ユーザーを更新
      operationId: updateUser
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  format: email
                  description: メールアドレス
                  maxLength: 254
                code:
                  type: string
                  description: コード
                  maxLength: 100
                firstName:
                  type: string
                  description: 名
                  maxLength: 255
                lastName:
                  type: string
                  description: 姓
                  maxLength: 255
                employeeId:
                  type:
                    - string
                    - 'null'
                  description: 社員番号
                  maxLength: 30
      tags:
        - ユーザー
      description: |-
        ユーザーを更新します。

        このAPIの実行には、ユーザーの管理権限が必要です。
  /v1/users/lookupByEmail:
    get:
      summary: メールアドレスからユーザーを取得
      tags:
        - ユーザー
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: lookupUserByEmail
      parameters:
        - schema:
            type: string
          in: query
          name: email
          description: メールアドレス（URLエンコードを行ったもの）
          required: true
      description: |-
        メールアドレスからユーザーを取得します（完全一致）
        ※メールアドレスはURLエンコードしたものを送ってください。
  /v1/users/{userId}/reinvite:
    parameters:
      - schema:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
        name: userId
        in: path
        required: true
        description: ユーザーのUUIDまたはコード
    post:
      summary: ユーザーを再招待
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: reinviteUser
      description: |-
        削除されたユーザーを再び招待します。

        このAPIの実行には、ユーザーの管理権限が必要です。
      tags:
        - ユーザー
  /v1/users/{userId}/suspend:
    parameters:
      - schema:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
        name: userId
        in: path
        required: true
        description: ユーザーのUUIDまたはコード
    post:
      summary: ユーザーを一時停止
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: suspendUser
      description: |-
        有効なユーザーを一時停止します。

        このAPIの実行には、ユーザーの管理権限が必要です。
      tags:
        - ユーザー
  /v1/users/{userId}/reactivate:
    parameters:
      - schema:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
        name: userId
        in: path
        required: true
        description: ユーザーのUUIDまたはコード
    post:
      summary: ユーザーを再有効化
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: reactivateUser
      description: |-
        一時停止中のユーザーを有効化します。

        このAPIの実行には、ユーザーの管理権限が必要です。
      tags:
        - ユーザー
  /v1/users/{userId}/teams:
    parameters:
      - schema:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
        name: userId
        in: path
        required: true
        description: ユーザーのUUIDまたはコード
    get:
      summary: ユーザーの所属チーム一覧を取得
      operationId: listUserTeams
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Team'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      tags:
        - ユーザー
      description: |-
        ユーザーの所属チーム一覧を取得します。

        このAPIの実行には、チームの管理権限が必要です。
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: ページ
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          in: query
          name: perPage
          description: 1ページあたりの件数
        - schema:
            type: boolean
          in: query
          name: submittable
          description: trueの場合、申請可能なチームのみ返す。デフォルトはfalse（すべてのチームを返す）
  /v1/users/{userId}/roles:
    parameters:
      - schema:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
        name: userId
        in: path
        required: true
        description: ユーザーのUUIDまたはコード
    get:
      summary: ユーザーの管理者ロール一覧を取得
      operationId: listUserRoles
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Role'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      tags:
        - ユーザー
      description: |-
        ユーザーの管理者ロール一覧を取得します。

        このAPIの実行には、ロールの管理権限が必要です。
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: ページ
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          in: query
          name: perPage
          description: 1ページあたりの件数
  /v1/routes:
    get:
      summary: 経路一覧を取得
      tags:
        - 経路
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Route'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: listRoutes
      description: 経路の一覧を取得します。ステータスやフォルダによる絞り込みが可能です。
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: ページ。1が最初のページ。
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          in: query
          name: perPage
          description: 1ページあたりの件数
        - schema:
            type: string
            pattern: ^(createdAt|folderId)(-asc|-desc)?$
          in: query
          name: sortBy
          description: 'ソート対象のフィールドと順序。指定可能なフィールド: createdAt, folderId'
        - schema:
            type: array
            items:
              type: string
              enum:
                - visible
                - error
          in: query
          name: status
          description: ステータス
        - schema:
            type: string
            format: uuid
          in: query
          name: folderId
          description: フォルダのUUID
  /v1/routes/{routeId}:
    parameters:
      - schema:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
        name: routeId
        in: path
        required: true
        description: 経路のUUIDまたはコード
    get:
      summary: 経路を取得
      tags:
        - 経路
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RouteDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: getRoute
      description: 指定した経路を取得します。
  /v1/workflows:
    get:
      summary: ワークフロー一覧を取得
      tags:
        - ワークフロー
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Workflow'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: listWorkflows
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: ページ。1が最初のページ。
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          in: query
          name: perPage
          description: 1ページあたりの件数
        - schema:
            type: string
            pattern: ^(createdAt|updatedAt|name|status)(-asc|-desc)?$
          in: query
          name: sortBy
          description: 'ソート対象のフィールドと順序。指定可能なフィールド: createdAt, updatedAt, name, status'
        - schema:
            type: array
            items:
              type: string
              enum:
                - visible
                - invisible
          in: query
          name: status
          description: ステータス
      description: ワークフローの一覧を取得します。ステータスによる絞り込みが可能です。
  /v1/workflows/{workflowId}:
    parameters:
      - schema:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
        name: workflowId
        in: path
        description: ワークフローのUUIDまたはコード
        required: true
    get:
      summary: ワークフローを取得
      tags:
        - ワークフロー
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowDetail'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: getWorkflow
      description: 指定したIDのワークフローを取得します。
  /v1/proxyApplicants:
    get:
      summary: 代理申請一覧を取得
      tags:
        - 代理申請
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: ページ
        - schema:
            type: integer
            default: 25
            minimum: 1
            maximum: 100
          in: query
          name: perPage
          description: 1ページあたりの件数
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ProxyApplicant'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: listProxyApplicants
      description: |-
        テナント内の代理申請の一覧を取得します。

        このAPIの実行には、ユーザーの管理権限が必要です。
    post:
      summary: 代理申請を作成
      tags:
        - 代理申請
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProxyApplicant'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: createProxyApplicant
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                userId:
                  type: string
                  format: uuid
                  description: 代理されるユーザーID
                proxyUserId:
                  type: string
                  format: uuid
                  description: 代理するユーザーID
                startsOn:
                  type:
                    - string
                    - 'null'
                  description: 開始日。nullの場合、すでに開始しているものとして扱います。
                  format: date
                endsOn:
                  type:
                    - string
                    - 'null'
                  description: 終了日。nullの場合、無期限のものとして扱います。
                  format: date
                workflowIds:
                  type: array
                  description: 対象ワークフローのID
                  items:
                    type: string
                    format: uuid
              required:
                - userId
                - proxyUserId
      description: |-
        代理申請を新規作成します。

        このAPIの実行には、ユーザーの管理権限が必要です。ただし、自分の代理申請の設定をすべてのユーザーに許可している場合、管理権限は不要です。
  /v1/proxyApplicants/{proxyApplicantId}:
    parameters:
      - schema:
          type: string
          format: uuid
        name: proxyApplicantId
        in: path
        required: true
        description: 代理申請のUUID
    delete:
      summary: 代理申請を削除
      tags:
        - 代理申請
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: deleteProxyApplicant
      description: |-
        指定した代理申請を削除します。

        このAPIの実行には、ユーザーの管理権限が必要です。ただし、自分の代理申請の設定をすべてのユーザーに許可している場合、管理権限は不要です。
  /v1/proxyApprovers:
    get:
      summary: 代理承認一覧を取得
      tags:
        - 代理承認
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: ページ
        - schema:
            type: integer
            default: 25
            minimum: 1
            maximum: 100
          in: query
          name: perPage
          description: 1ページあたりの件数
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ProxyApprover'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: listProxyApprovers
      description: |-
        テナント内の代理承認の一覧を取得します。

        このAPIの実行には、ユーザーの管理権限が必要です。
    post:
      summary: 代理承認を作成
      tags:
        - 代理承認
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProxyApprover'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: createProxyApprover
      description: |-
        代理承認を新規作成します。

        このAPIの実行には、ユーザーの管理権限が必要です。ただし、自分の代理承認の設定をすべてのユーザーに許可している場合、管理権限は不要です。
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                userId:
                  type: string
                  format: uuid
                  description: 代理されるユーザーID
                proxyUserId:
                  type: string
                  format: uuid
                  description: 代理するユーザーID
                startsOn:
                  type:
                    - string
                    - 'null'
                  format: date
                  description: 開始日。nullの場合、すでに始まっているものとして扱います。
                endsOn:
                  type:
                    - string
                    - 'null'
                  format: date
                  description: 終了日。nullの場合、無期限として扱います。
                workflowIds:
                  type: array
                  description: 対象ワークフローのID
                  items:
                    type: string
                    format: uuid
              required:
                - userId
                - proxyUserId
  /v1/proxyApprovers/{proxyApproverId}:
    parameters:
      - schema:
          type: string
          format: uuid
        name: proxyApproverId
        in: path
        required: true
        description: 代理承認のUUID
    delete:
      summary: 代理承認を削除
      tags:
        - 代理承認
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: deleteProxyApprover
      description: |-
        指定した代理承認を削除します。

        このAPIの実行には、ユーザーの管理権限が必要です。ただし、自分の代理承認の設定をすべてのユーザーに許可している場合、管理権限は不要です。
  /v1/files:
    post:
      summary: 添付ファイルをアップロード
      tags:
        - ファイル
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  signedId:
                    type: string
                    description: 添付ファイルの署名済みID
                required:
                  - signedId
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: uploadFile
      description: |-
        添付ファイルをアップロードします。最大50MBまでのファイルをアップロード可能です。

        注意：このAPIはエンタープライズプランのお客様のみ利用可能です。

        注意：アップロードしたファイルはすみやかにチケット作成などで使用してください。チケットなどから参照されていないファイルは最短24時間経過後に自動的に削除されます。
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: 添付ファイル
        description: ''
  /v1/files/{signedId}:
    parameters:
      - schema:
          type: string
        name: signedId
        in: path
        required: true
        description: 添付ファイルの署名済みID
    get:
      summary: 添付ファイルの情報を取得
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    format: uri
                    description: Amazon S3のURL
                  filename:
                    type: string
                    description: ファイル名
                  checksum:
                    type: string
                    description: チェックサム
                  byteSize:
                    type: integer
                    description: バイト数
                  contentType:
                    type: string
                    description: Content-Type
                  createdAt:
                    type: string
                    format: date-time
                    description: 作成日時
                required:
                  - url
                  - filename
                  - checksum
                  - byteSize
                  - contentType
                  - createdAt
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: getFile
      description: |-
        添付ファイルのAmazon S3上のURLを含む情報を取得します。

        注意: このAPIが返すURLは、5分間で失効します。

        注意: チケットに添付されていないファイルはURLを取得できません。先にチケットに添付してください。
      tags:
        - ファイル
  /v1/auditLogs:
    get:
      summary: 監査ログ一覧を取得
      tags:
        - 監査ログ
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AuditLog'
        '400':
          description: Bad Request
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Unauthorized
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Content
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          description: Internal Server Error
          $ref: '#/components/responses/InternalServerError'
        '504':
          description: Gateway Timeout
          $ref: '#/components/responses/GatewayTimeout'
      operationId: listAuditLogs
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: ページ
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          in: query
          name: perPage
          description: 1ページあたりの件数
        - schema:
            type: string
            pattern: ^(createdAt)(-asc|-desc)?$
          in: query
          name: sortBy
          description: ソート対象のフィールドと順序。フィールドは createdAt のみ指定可能。
        - schema:
            type: string
          in: query
          name: createdAtStart
          description: 作成日時の起点
        - schema:
            type: string
          in: query
          name: createdAtEnd
          description: 作成日時の終点
        - schema:
            type: string
            format: uuid
          in: query
          name: userId
          description: ユーザーID
      description: 監査ログの一覧を取得します。
webhooks:
  ping:
    post:
      operationId: webhookPing
      summary: pingイベント
      description: WebhookのPingイベントを送信します。
      parameters:
        - name: X-Kickflow-Delivery
          in: header
          description: イベント固有のUUID
          required: true
          schema:
            type: string
            format: uuid
        - name: X-Kickflow-Signature
          in: header
          description: ペイロード検証用の署名
          required: true
          schema:
            type: string
      requestBody:
        description: Webhookのリクエストボディ
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookRequestBodyPing'
      responses:
        '200':
          description: 成功
  ticket:
    post:
      operationId: webhookTicket
      summary: ticket_*イベント
      description: Webhookのチケット系イベントを送信します。
      parameters:
        - name: X-Kickflow-Delivery
          in: header
          description: イベント固有のUUID
          required: true
          schema:
            type: string
            format: uuid
        - name: X-Kickflow-Signature
          in: header
          description: ペイロード検証用の署名
          required: true
          schema:
            type: string
      requestBody:
        description: Webhookのリクエストボディ
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookRequestBodyTicket'
      responses:
        '200':
          description: 成功
  comment:
    post:
      operationId: webhookComment
      summary: comment_*イベント
      description: Webhookのコメント系イベントを送信します。
      parameters:
        - name: X-Kickflow-Delivery
          in: header
          description: イベント固有のUUID
          required: true
          schema:
            type: string
            format: uuid
        - name: X-Kickflow-Signature
          in: header
          description: ペイロード検証用の署名
          required: true
          schema:
            type: string
      requestBody:
        description: Webhookのリクエストボディ
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookRequestBodyComment'
      responses:
        '200':
          description: 成功
components:
  schemas:
    ErrorResponse:
      title: ErrorResponse
      description: エラーレスポンス
      type: object
      properties:
        code:
          type: string
          description: エラーコード
          example: validation_failed
        message:
          type: string
          description: エラーメッセージ
          example: hoge must not be empty
      required:
        - code
        - message
    Grade:
      title: Grade
      type: object
      x-tags:
        - grades
      description: 役職
      properties:
        id:
          type: string
          description: UUID
          format: uuid
        name:
          type: string
          description: 名前
          maxLength: 300
        level:
          type: integer
          description: レベル
          minimum: 0
          maximum: 255
        code:
          type:
            - string
            - 'null'
          description: コード
          maxLength: 100
        isDefault:
          type: boolean
          description: デフォルトの役職かどうか
          default: false
        createdAt:
          type: string
          description: 作成日時
          format: date-time
        updatedAt:
          type: string
          description: 更新日時
          format: date-time
      required:
        - id
        - name
        - level
        - code
        - isDefault
        - createdAt
        - updatedAt
    GradeCreateBody:
      title: GradeCreateBody
      type: object
      x-tags:
        - grades
      description: 役職を作成するときのrequest body
      properties:
        name:
          type: string
          description: 名前
          maxLength: 300
        level:
          type: integer
          description: レベル
          minimum: 0
          maximum: 255
        code:
          type: string
          maxLength: 100
          description: コード。未指定の場合、ランダムな英数字が自動的に設定されます。
      required:
        - name
        - level
    GradeUpdateBody:
      title: GradeUpdateBody
      type: object
      x-tags:
        - grades
      description: 役職を更新するときのrequest body
      properties:
        name:
          type: string
          maxLength: 300
          description: 名前
        level:
          type: integer
          minimum: 0
          maximum: 255
          description: レベル
        code:
          type: string
          maxLength: 100
          description: コード。未指定の場合、ランダムな英数字が自動的に設定されます。
    User:
      title: User
      type: object
      x-tags:
        - users
      description: ユーザー
      properties:
        id:
          type: string
          format: uuid
          description: UUID
        email:
          type: string
          description: メールアドレス
          format: email
          maxLength: 254
        code:
          type: string
          description: コード
          maxLength: 100
        firstName:
          type: string
          description: 名
          maxLength: 255
        lastName:
          type: string
          description: 姓
          maxLength: 255
        fullName:
          type: string
          description: フルネーム
          maxLength: 255
        employeeId:
          type:
            - string
            - 'null'
          description: 社員番号
          maxLength: 30
        image:
          type: object
          description: ユーザー画像のURL。サイズごとに複数のURLを返します。
          required:
            - 100x100
            - 64x64
            - 32x32
          properties:
            100x100:
              type:
                - string
                - 'null'
            64x64:
              type:
                - string
                - 'null'
            32x32:
              type:
                - string
                - 'null'
        status:
          type: string
          enum:
            - invited
            - activated
            - suspended
            - deactivated
          description: ステータス
        locale:
          type: string
          description: ロケール（jaまたはen）
        createdAt:
          type: string
          format: date-time
          description: 作成日時
        updatedAt:
          type: string
          format: date-time
          description: 更新日時
        deactivatedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: 削除日時
      required:
        - id
        - email
        - code
        - firstName
        - lastName
        - fullName
        - image
        - status
        - locale
        - createdAt
        - updatedAt
    UserDetail:
      title: UserDetail
      x-tags:
        - users
      description: ユーザー詳細
      allOf:
        - $ref: '#/components/schemas/User'
    ProxyApplicant:
      title: ProxyApplicant
      type: object
      x-tags:
        - users
      description: 代理申請
      properties:
        id:
          type: string
          format: uuid
          description: UUID
        createdAt:
          type: string
          format: date-time
          description: 作成日時
        updatedAt:
          type: string
          format: date-time
          description: 更新日時
        user:
          $ref: '#/components/schemas/User'
        proxyUser:
          $ref: '#/components/schemas/User'
        startsOn:
          type:
            - string
            - 'null'
          format: date
          description: 開始日
        endsOn:
          type:
            - string
            - 'null'
          format: date
          description: 終了日
        workflows:
          type: array
          description: 対象ワークフロー
          items:
            $ref: '#/components/schemas/Workflow'
      required:
        - id
        - createdAt
        - updatedAt
        - user
        - proxyUser
        - startsOn
        - endsOn
        - workflows
    ProxyApprover:
      title: ProxyApprover
      type: object
      x-tags:
        - users
      description: 代理承認
      properties:
        id:
          type: string
          format: uuid
          description: UUID
        createdAt:
          type: string
          format: date-time
          description: 作成日時
        updatedAt:
          type: string
          format: date-time
          description: 更新日時
        user:
          $ref: '#/components/schemas/User'
        proxyUser:
          $ref: '#/components/schemas/User'
        startsOn:
          type:
            - string
            - 'null'
          format: date
          description: 開始日
        endsOn:
          type:
            - string
            - 'null'
          format: date
          description: 終了日
        workflows:
          type: array
          description: 対象ワークフロー
          items:
            $ref: '#/components/schemas/Workflow'
      required:
        - id
        - createdAt
        - updatedAt
        - user
        - proxyUser
        - startsOn
        - endsOn
        - workflows
    Team:
      title: Team
      type: object
      x-tags:
        - teams
      description: チーム
      properties:
        id:
          type: string
          format: uuid
          description: UUID
        name:
          type: string
          description: 名前
          maxLength: 300
        fullName:
          type: string
          description: 上位組織を含む名前
        code:
          type: string
          description: コード
          maxLength: 100
        notes:
          type:
            - string
            - 'null'
          description: 管理用メモ
          maxLength: 10000
        approveOnly:
          type: boolean
          description: 承認専用チームかどうか
        usersCount:
          type: integer
          description: ユーザー数
          minimum: 0
        createdAt:
          type: string
          format: date-time
          description: 作成日時
        updatedAt:
          type: string
          format: date-time
          description: 更新日時
      required:
        - id
        - name
        - fullName
        - code
        - approveOnly
        - usersCount
        - createdAt
        - updatedAt
    TeamDetail:
      title: TeamDetail
      x-tags:
        - teams
      description: チームの詳細
      allOf:
        - $ref: '#/components/schemas/Team'
        - type: object
          properties:
            parent:
              description: 親チーム
              anyOf:
                - $ref: '#/components/schemas/Team'
                - type: 'null'
            children:
              type: array
              description: 子チーム
              items:
                $ref: '#/components/schemas/Team'
            users:
              type: array
              description: |-
                メンバーの配列。

                注意：パフォーマンス上の理由から、100件を超えるメンバーを返すことはできません。101件以上のメンバーをすべて取得したい場合は、別途メンバー取得APIを呼び出してください。
              items:
                $ref: '#/components/schemas/MemberUser'
          required:
            - children
            - users
    TeamCreateBody:
      title: TeamCreateBody
      type: object
      x-tags:
        - teams
      description: チームを作成するときのrequest body
      properties:
        name:
          type: string
          description: 名前
        code:
          type: string
          description: コード。未指定の場合、ランダムな英数字が自動的に設定されます。
        notes:
          type:
            - string
            - 'null'
          description: 管理用メモ
        parentId:
          type: string
          format: uuid
          description: 親チームのUUID。nullの場合、作成したチームはルートになります。
        approveOnly:
          type: boolean
          description: 承認専用チームかどうか
      required:
        - name
    TeamUpdateBody:
      title: TeamUpdateBody
      type: object
      x-tags:
        - teams
      description: チームを更新するときのrequest body
      x-examples: {}
      properties:
        name:
          type: string
          description: 名前
        code:
          type: string
          description: コード。未指定の場合、ランダムな英数字が自動的に設定されます。
        notes:
          type: string
          description: 管理用メモ
        parentId:
          type: string
          description: 親チームのID
          format: uuid
        approveOnly:
          type: boolean
          description: 承認専用チームかどうか
    OrganizationChart:
      title: OrganizationChart
      type: object
      x-tags:
        - organizationCharts
      description: 組織図
      properties:
        id:
          type: string
          format: uuid
          description: UUID
        name:
          type: string
          description: 名前
          maxLength: 300
        current:
          type: boolean
          description: 現在有効な組織図かどうか
        teamsCount:
          type: integer
          description: チーム数
        membershipsCount:
          type: integer
          description: 所属数
        createdAt:
          type: string
          format: date-time
          description: 作成日時
        updatedAt:
          type: string
          format: date-time
          description: 更新日時
        activationPlan:
          type:
            - object
            - 'null'
          description: 有効化の予定
          required:
            - id
            - dueOn
            - createdAt
            - updatedAt
          properties:
            id:
              type: string
              description: UUID
            dueOn:
              type: string
              format: date
              description: 有効化の予定日
            createdAt:
              type: string
              format: date-time
              description: 作成日時
            updatedAt:
              type: string
              format: date-time
              description: 更新日時
      required:
        - id
        - name
        - current
        - teamsCount
        - membershipsCount
        - createdAt
        - updatedAt
        - activationPlan
    OrganizationChartDetail:
      title: OrganizationChartDetail
      x-tags:
        - organizationCharts
      description: 組織図の詳細
      allOf:
        - $ref: '#/components/schemas/OrganizationChart'
    OrganizationChartBody:
      title: OrganizationChartBody
      type: object
      x-tags:
        - organizationCharts
      description: 組織図を作成・更新するときのrequest body
      properties:
        name:
          type: string
          description: 名前
      required:
        - name
    MemberUser:
      title: MemberUser
      x-tags:
        - teams
      description: チームの所属メンバー
      allOf:
        - type: object
          properties:
            grades:
              type: array
              description: 役職
              minItems: 1
              items:
                $ref: '#/components/schemas/Grade'
            leader:
              type: boolean
              description: 上長かどうか
          required:
            - grades
            - leader
        - $ref: '#/components/schemas/User'
    Role:
      title: Role
      type: object
      x-tags:
        - roles
      description: 管理者ロール
      properties:
        id:
          type: string
          format: uuid
          description: UUID
        name:
          type: string
          description: 名前
          maxLength: 300
        editable:
          type: boolean
          description: 編集可能かどうか。「すべての管理者」のときだけfalseになります。
        usersCount:
          type: integer
          description: この管理者ロールに所属するユーザー数
          minimum: 0
        createdAt:
          type: string
          format: date-time
          description: 作成日時
        updatedAt:
          type: string
          format: date-time
          description: 更新日時
      required:
        - id
        - name
        - editable
        - usersCount
        - createdAt
        - updatedAt
    RoleDetail:
      title: RoleDetail
      x-tags:
        - roles
      allOf:
        - $ref: '#/components/schemas/Role'
        - type: object
          properties:
            permissionList:
              type: array
              description: 権限のリスト
              items:
                type: object
                properties:
                  permission:
                    type: string
                    enum:
                      - tenant
                      - billing
                      - integration
                      - security
                      - audit
                      - stats
                      - workflow
                      - route
                      - pipeline
                      - workflow_misc
                      - user
                      - team
                      - role
                      - master
                      - ticket_read
                      - ticket_write
                      - label
                      - automation
                    description: 権限タイプ
                  restricted:
                    type: boolean
                    description: 管理対象が制限されている場合true
                  folders:
                    type: array
                    description: 管理対象のフォルダ
                    items:
                      $ref: '#/components/schemas/Folder'
                  generalMasters:
                    type: array
                    description: 管理対象の汎用マスタ
                    items:
                      $ref: '#/components/schemas/GeneralMaster'
                  teams:
                    type: array
                    description: 管理対象のチーム
                    items:
                      $ref: '#/components/schemas/Team'
                required:
                  - permission
                  - restricted
                  - folders
                  - generalMasters
                  - teams
          required:
            - permissionList
      description: 管理者ロールの詳細
    RoleCreateBody:
      title: RoleCreateBody
      type: object
      x-tags:
        - roles
      description: 管理者ロールを作成するときのrequest body
      properties:
        name:
          type: string
          description: 名前
        permissionList:
          type: array
          description: 権限リスト
          items:
            type: object
            properties:
              permission:
                type: string
                description: 権限タイプ
                enum:
                  - tenant
                  - billing
                  - integration
                  - security
                  - audit
                  - stats
                  - workflow
                  - route
                  - pipeline
                  - workflow_misc
                  - user
                  - team
                  - role
                  - master
                  - ticket_read
                  - ticket_write
                  - label
                  - automation
              restricted:
                type: boolean
                description: 管理対象を制限する場合true
              folderIds:
                type: array
                description: 管理対象のフォルダID
                items:
                  type: string
                  format: uuid
              generalMasterIds:
                type: array
                description: 管理対象の汎用マスタID
                items:
                  type: string
                  format: uuid
              teamIds:
                type: array
                description: 管理対象のチームID
                items:
                  type: string
                  format: uuid
            required:
              - permission
              - restricted
      required:
        - name
        - permissionList
    RoleUpdateBody:
      title: RoleUpdateBody
      type: object
      x-tags:
        - roles
      description: 管理者ロールを更新するときのrequest body
      properties:
        name:
          type: string
          description: 名前
        permissionList:
          type: array
          description: 権限リスト
          items:
            type: object
            properties:
              permission:
                type: string
                description: 権限タイプ
                enum:
                  - tenant
                  - billing
                  - integration
                  - security
                  - audit
                  - stats
                  - workflow
                  - route
                  - pipeline
                  - workflow_misc
                  - user
                  - team
                  - role
                  - master
                  - ticket_read
                  - ticket_write
                  - label
                  - automation
              restricted:
                type: boolean
                description: 管理対象を制限する場合true
              folderIds:
                type: array
                description: 管理対象のフォルダID
                items:
                  type: string
                  format: uuid
              generalMasterIds:
                type: array
                description: 管理対象の汎用マスタID
                items:
                  type: string
                  format: uuid
              teamIds:
                type: array
                description: 管理対象のチームID
                items:
                  type: string
                  format: uuid
            required:
              - permission
              - restricted
    Category:
      title: Category
      type: object
      x-tags:
        - categories
      description: カテゴリ
      properties:
        id:
          type: string
          format: uuid
          description: UUID
        name:
          type: string
          description: 名前
          maxLength: 100
        createdAt:
          type: string
          format: date-time
          description: 作成日時
        updatedAt:
          type: string
          format: date-time
          description: 更新日時
      required:
        - id
        - name
        - createdAt
        - updatedAt
    Folder:
      title: Folder
      type: object
      x-tags:
        - folders
      description: フォルダ
      properties:
        id:
          type: string
          format: uuid
          description: UUID
        name:
          type: string
          description: 名前
          maxLength: 300
        code:
          type: string
          description: コード
          maxLength: 100
        description:
          type:
            - string
            - 'null'
          description: 説明
        workflowsCount:
          type: integer
          description: フォルダ内のワークフロー数
          minimum: 0
        routesCount:
          type: integer
          description: フォルダ内の経路数
          minimum: 0
        pipelinesCount:
          type: integer
          description: フォルダ内のパイプライン数
          minimum: 0
        createdAt:
          type: string
          format: date-time
          description: 作成日時
        updatedAt:
          type: string
          format: date-time
          description: 更新日時
      required:
        - id
        - name
        - code
        - workflowsCount
        - routesCount
        - pipelinesCount
        - createdAt
        - updatedAt
    FolderDetail:
      title: FolderDetail
      x-tags:
        - folders
      allOf:
        - $ref: '#/components/schemas/Folder'
        - type: object
          properties:
            ancestors:
              description: 親フォルダからルートフォルダまでの配列
              type: array
              items:
                $ref: '#/components/schemas/Folder'
            children:
              description: 子フォルダ
              type: array
              items:
                $ref: '#/components/schemas/Folder'
      description: フォルダの詳細
    InviteMembershipBody:
      title: InviteMembershipBody
      description: 招待時に作成する所属
      type: object
      properties:
        teamCode:
          type: string
          description: 所属先チームのコード
        gradeCodes:
          type: array
          items:
            type: string
          description: 役職コードの配列
        leader:
          type: boolean
          description: '上長フラグ（デフォルト: false）'
      required:
        - teamCode
    GeneralMaster:
      title: GeneralMaster
      type: object
      x-tags:
        - generalMasters
      description: 汎用マスタ
      properties:
        id:
          type: string
          description: UUID
          format: uuid
        code:
          type: string
          description: コード
          maxLength: 100
        name:
          type: string
          description: 名前
          maxLength: 300
        description:
          type:
            - string
            - 'null'
          description: 説明
        defaultSortBy:
          type: string
          enum:
            - name
            - code
          description: アイテム一覧のデフォルト並び順
        createdAt:
          type: string
          description: 作成日時
          format: date-time
        updatedAt:
          type: string
          description: 更新日時
          format: date-time
        fields:
          type: array
          description: カスタムフィールドの配列
          items:
            $ref: '#/components/schemas/GeneralMasterField'
      required:
        - id
        - code
        - name
        - description
        - createdAt
        - updatedAt
        - defaultSortBy
        - fields
    GeneralMasterItem:
      title: GeneralMasterItem
      type: object
      x-tags:
        - generalMasters
      description: 汎用マスタのアイテム
      properties:
        id:
          type: string
          format: uuid
          description: UUID
        code:
          type: string
          description: コード
          maxLength: 100
        name:
          type: string
          description: 名前
          maxLength: 100
        description:
          type:
            - string
            - 'null'
          description: 説明
        createdAt:
          type: string
          format: date-time
          description: 作成日時
        updatedAt:
          type: string
          format: date-time
          description: 更新日時
        startsOn:
          type:
            - string
            - 'null'
          description: 有効期限の開始日
          format: date
        endsOn:
          type:
            - string
            - 'null'
          description: 有効期限の終了日
          format: date
        inputs:
          type: array
          description: カスタムフィールドの入力の配列
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
                description: UUID
              value:
                description: 入力値
                anyOf:
                  - type:
                      - string
                      - 'null'
                  - type: array
                    items:
                      type: string
              createdAt:
                type: string
                format: date-time
                description: 作成日時
              updatedAt:
                type: string
                format: date-time
                description: 更新日時
              field:
                $ref: '#/components/schemas/GeneralMasterField'
            required:
              - id
              - value
              - createdAt
              - updatedAt
              - field
      required:
        - id
        - code
        - name
        - description
        - createdAt
        - updatedAt
        - startsOn
        - endsOn
        - inputs
    GeneralMasterField:
      title: GeneralMasterField
      type: object
      x-tags:
        - generalMasters
      description: 汎用マスタのカスタムフィールド
      properties:
        id:
          type: string
          format: uuid
          description: UUID
        title:
          type: string
          description: フィールド名
          maxLength: 300
        description:
          type:
            - string
            - 'null'
          description: フィールドの説明
        code:
          type: string
          description: フィールドのコード
          maxLength: 100
        fieldType:
          type: string
          enum:
            - text
            - text_long
            - number
            - integer
            - checkbox
            - pull_down
            - date
          description: フィールドの型
        required:
          type: boolean
          description: 必須項目かどうか
        visible:
          type: boolean
          description: 管理者以外も閲覧可能な場合true
        options:
          type:
            - array
            - 'null'
          description: 選択肢。fieldTypeがcheckboxまたはpull_downのときのみ。
          items:
            type: string
        createdAt:
          type: string
          format: date-time
          description: 作成日時
        updatedAt:
          type: string
          format: date-time
          description: 更新日時
      required:
        - id
        - title
        - description
        - code
        - fieldType
        - required
        - visible
        - options
        - createdAt
        - updatedAt
    Workflow:
      title: Workflow
      type: object
      x-tags:
        - workflows
      description: ワークフロー
      properties:
        id:
          type: string
          description: UUID
        code:
          type: string
          description: コード
          pattern: ^[a-zA-Z0-9_-]+$
        versionId:
          type: string
          description: バージョンのUUID
        versionNumber:
          type: integer
          description: バージョン番号
        name:
          type: string
          description: 名前
        description:
          type: string
          description: 説明
        status:
          type: string
          description: ステータス。visibleは有効、invisibleは無効、deletedは削除済み。
          enum:
            - visible
            - invisible
            - deleted
        publicTicket:
          type: boolean
          description: チケットがテナント全体に共有される場合true
          default: false
        visibleToManager:
          type: string
          description: 申請者の上長を共有ユーザーに追加するか。noneは追加しない、directは直属の上長のみ、allはすべての上長を表す。
          enum:
            - none
            - direct
            - all
        visibleToTeamMembers:
          type: boolean
          description: 申請チームのメンバーが共有ユーザーに追加される場合true
          default: false
        titleDescription:
          type:
            - string
            - 'null'
          description: タイトルの説明
        ticketNumberFormat:
          type:
            - string
            - 'null'
          description: チケット番号のフォーマット
        overwritable:
          type: boolean
          description: 承認者による上書きが可能な場合true
        createdAt:
          type: string
          description: 作成日時
        updatedAt:
          type: string
          description: 更新日時
        titleInputMode:
          type: string
          description: タイトル入力モード
          enum:
            - none
            - input
            - calculate
        titleFormula:
          type:
            - string
            - 'null'
          description: タイトルの計算式
        allowEditingOfViewers:
          type: boolean
          description: 共有ユーザーの編集が可能な場合true
          default: true
        author:
          anyOf:
            - $ref: '#/components/schemas/User'
            - type: 'null'
          description: 作成者
        versionAuthor:
          anyOf:
            - $ref: '#/components/schemas/User'
            - type: 'null'
          description: バージョン作成者
        folder:
          anyOf:
            - $ref: '#/components/schemas/Folder'
          description: フォルダ
        categories:
          type: array
          description: カテゴリの配列
          items:
            $ref: '#/components/schemas/Category'
      required:
        - id
        - code
        - versionId
        - versionNumber
        - name
        - description
        - status
        - publicTicket
        - visibleToManager
        - visibleToTeamMembers
        - titleDescription
        - ticketNumberFormat
        - overwritable
        - createdAt
        - updatedAt
        - titleInputMode
        - titleFormula
        - author
        - versionAuthor
        - folder
        - categories
    WorkflowInTicket:
      title: WorkflowInTicket
      x-tags:
        - workflows
      description: チケットに含まれるワークフロー。セクション情報と共有ユーザー情報を含みます。
      allOf:
        - $ref: '#/components/schemas/Workflow'
        - type: object
          properties:
            sectionList:
              type: array
              description: セクション・明細を表すオブジェクトを画面に表示される順に格納した配列。
              items:
                $ref: '#/components/schemas/SectionListItem'
            ticketViewers:
              type: array
              description: ワークフロー単位のチケット共有ユーザー
              items:
                $ref: '#/components/schemas/WorkflowTicketViewer'
            cloudSignSetting:
              description: クラウドサイン連携設定
              anyOf:
                - type: object
                  properties:
                    required:
                      type: boolean
                      description: 書類の添付が必須な場合true
                  required:
                    - required
                - type: 'null'
          required:
            - ticketViewers
            - cloudSignSetting
    WorkflowDetail:
      title: WorkflowDetail
      x-tags:
        - workflows
      description: ワークフローの詳細
      allOf:
        - $ref: '#/components/schemas/WorkflowInTicket'
        - type: object
          properties:
            routeConditions:
              type: array
              description: 経路分岐
              items:
                $ref: '#/components/schemas/WorkflowRouteCondition'
          required:
            - routeConditions
    SectionListItem:
      title: SectionListItem
      type: object
      x-tags:
        - workflows
      description: 明細セクションまたはフォームセクション
      properties:
        sectionType:
          type: string
          enum:
            - form
            - slip
        title:
          type:
            - string
            - 'null'
          description: タイトル
        description:
          type:
            - string
            - 'null'
          description: 説明
        id:
          type: string
          format: uuid
          description: フォームセクションのID（UUID）。明細セクションには含まれません。
        formFields:
          type: array
          description: フォームフィールド。明細セクションには含まれません。
          items:
            $ref: '#/components/schemas/FormFieldDetail'
        conditional:
          type: boolean
          description: 表示条件があるかどうか。明細セクションには含まれません。
        combinationType:
          type: string
          description: 条件の組み合わせタイプ。all=すべて、any=いずれか、custom=高度な条件式。明細セクションには含まれません。
          enum:
            - all
            - any
            - custom
        combinationExpression:
          type:
            - string
            - 'null'
          description: 高度な条件式
        slipFields:
          type: array
          description: 明細フィールド。フォームセクションには含まれません。
          items:
            $ref: '#/components/schemas/SlipFieldDetail'
      required:
        - sectionType
        - title
        - description
    FormField:
      title: FormField
      type: object
      x-tags:
        - workflows
      description: フォームフィールド
      properties:
        id:
          type: string
          description: UUID
          format: uuid
        title:
          type: string
          description: 説明
          maxLength: 300
        description:
          type:
            - string
            - 'null'
          description: 説明
        fieldType:
          type: string
          description: フィールドの型
          enum:
            - text
            - text_long
            - number
            - integer
            - checkbox
            - pull_down
            - date
            - file
            - master
            - user
            - team
            - ticket
            - calculation
            - button_api
            - button_kintone
        required:
          type: boolean
          description: 必須項目かどうか
        approver:
          type: boolean
          description: 承認者が編集可能かどうか
        author:
          type: boolean
          description: 申請者が編集可能かどうか
        options:
          type:
            - array
            - 'null'
          description: 選択肢のリスト。型がcheckboxまたはpull_downのときのみ値が入ります。
          items:
            type: string
        code:
          type: string
          description: コード
          maxLength: 100
        size:
          type: string
          description: フォームサイズ。fullの場合全幅、halfの場合1/2になります。
          enum:
            - full
            - half
        regexpFormat:
          type:
            - string
            - 'null'
          description: 正規表現フォーマット
        formula:
          type:
            - string
            - 'null'
          description: |-
            計算式。
            型がcalculationのときのみ値が入ります。
        defaultValue:
          type:
            - string
            - 'null'
          description: 初期値
        minValue:
          type:
            - number
            - 'null'
          description: 最小値
        maxValue:
          type:
            - number
            - 'null'
          description: 最大値
        minLength:
          type:
            - number
            - 'null'
          description: 最小文字数
          minimum: 0
        maxLength:
          type:
            - number
            - 'null'
          description: 最大文字数
          minimum: 0
        decimalDigit:
          type:
            - integer
            - 'null'
          description: 小数の桁数
          minimum: 0
        delimited:
          type:
            - boolean
            - 'null'
          description: |-
            カンマ区切りで表示する場合true。
            整数、数値、自動計算フィールド以外ではnullが入ります。
        prefix:
          type:
            - string
            - 'null'
          description: 単位（接頭辞）
        suffix:
          type:
            - string
            - 'null'
          description: 単位（接尾辞）
        hidden:
          type:
            - boolean
            - 'null'
          description: 隠しフィールドである場合true
        readonlyOnUi:
          type:
            - boolean
            - 'null'
          description: |-
            trueの時、申請者・承認者が画面上から値を入力することを禁止します。
            外部API連携（ボタン）による代入や、REST API経由での入力はこのオプションの対象外です。
      required:
        - id
        - title
        - description
        - fieldType
        - required
        - approver
        - options
        - code
        - size
        - regexpFormat
        - formula
        - defaultValue
        - minValue
        - maxValue
        - minLength
        - maxLength
        - decimalDigit
        - delimited
        - prefix
        - suffix
    FormFieldDetail:
      title: FormFieldDetail
      x-tags:
        - workflows
      description: フォームフィールドの詳細
      allOf:
        - $ref: '#/components/schemas/FormField'
        - type: object
          properties:
            generalMaster:
              anyOf:
                - $ref: '#/components/schemas/GeneralMaster'
                - type: 'null'
              description: 汎用マスタ（汎用マスタフィールドの場合）
            defaultGeneralMasterItem:
              anyOf:
                - $ref: '#/components/schemas/GeneralMasterItem'
                - type: 'null'
              description: 初期値（汎用マスタフィールドの場合）
            externalApiSetting:
              anyOf:
                - $ref: '#/components/schemas/ExternalApiSetting'
                - type: 'null'
              description: 外部API設定。fieldTypeがbutton_apiのときのみ値が入ります。
            kintoneAppSetting:
              anyOf:
                - $ref: '#/components/schemas/KintoneAppSetting'
                - type: 'null'
              description: 外部API設定。fieldTypeがbutton_kintoneのときのみ値が入ります。
            climberCloudSetting:
              anyOf:
                - $ref: '#/components/schemas/ClimberCloudSetting'
                - type: 'null'
              description: ClimberCloud連携設定。fieldTypeがfileのときのみ値が入ります。
            generalMasterSearchFilters:
              type:
                - array
                - 'null'
              items:
                $ref: '#/components/schemas/GeneralMasterSearchFilter'
              description: 汎用マスタ型フィールドの自動絞り込みの設定
    ExternalApiSetting:
      title: ExternalApiSetting
      type: object
      x-tags:
        - workflows
      description: 外部API設定
      properties:
        id:
          type: string
          format: uuid
          description: UUID
        httpMethod:
          type: string
          enum:
            - get
            - post
            - put
            - delete
            - patch
          description: HTTPメソッド
        url:
          type: string
          format: uri
          description: URL
        headers:
          type: array
          description: リクエストヘッダー
          items:
            type: object
            properties:
              key:
                type: string
                description: ヘッダーのキー
              value:
                type: string
                description: ヘッダーの値
            required:
              - key
              - value
        responseArray:
          type: boolean
          description: レスポンスが複数レコードを含む場合true
        arrayJsonPath:
          type:
            - string
            - 'null'
          description: 複数レコードを含む場合の配列へのJSONPath
        mappings:
          type: array
          description: フィールドへのマッピング設定
          items:
            type: object
            properties:
              formField:
                $ref: '#/components/schemas/FormField'
              jsonPath:
                type: string
                description: 値抽出用のJSONPath
              displayInTable:
                type: boolean
                description: 選択用テーブルで表示する場合true
              title:
                type:
                  - string
                  - 'null'
                description: 選択用テーブルでのタイトル
            required:
              - formField
              - jsonPath
              - displayInTable
              - title
      required:
        - id
        - httpMethod
        - url
        - headers
        - responseArray
        - arrayJsonPath
        - mappings
    ClimberCloudSetting:
      title: ClimberCloudSetting
      type: object
      x-tags:
        - workflows
      description: ClimberCloud連携設定
      properties:
        id:
          type: string
          format: uuid
          description: UUID
        contentsId:
          type: string
          description: ファイル付きリストID
        formField:
          $ref: '#/components/schemas/FormField'
        mappings:
          type: array
          description: ClimberCloudのカラムとのマッピング設定
          items:
            type: object
            properties:
              formField:
                $ref: '#/components/schemas/FormField'
              order:
                type: integer
                description: 表示順（1から始まります）
            required:
              - formField
              - order
      required:
        - id
        - contentsId
        - formField
        - mappings
    SlipField:
      title: SlipField
      type: object
      x-tags:
        - workflows
      description: 明細フィールド
      properties:
        id:
          type: string
          format: uuid
          description: UUID
        fieldType:
          type: string
          description: フィールドの型
          enum:
            - text
            - number
            - integer
            - calculation
            - pull_down
            - checkbox
            - date
            - file
            - master
            - user
            - team
            - ticket
        code:
          type: string
          description: フィールドのコード
        title:
          type: string
          description: タイトル
        required:
          type: boolean
          description: 入力必須の場合true
        showTotal:
          type: boolean
          description: 列の合計を表示する場合true
        options:
          type: array
          description: 選択肢。プルダウンまたはチェックボックスのときのみ値が入ります。
          items:
            type: string
        regexpFormat:
          type:
            - string
            - 'null'
          description: 正規表現フォーマット
        formula:
          type:
            - string
            - 'null'
          description: 計算式。型が自動計算のときのみ値が入ります。
        maxValue:
          type:
            - number
            - 'null'
          description: 最大値
        minValue:
          type:
            - number
            - 'null'
          description: 最小値
        defaultValue:
          type:
            - string
            - 'null'
          description: 初期値
        decimalDigit:
          type:
            - integer
            - 'null'
          description: 小数の桁数
        delimited:
          type:
            - boolean
            - 'null'
          description: |-
            カンマ区切りで表示する場合true。
            整数、数値、自動計算フィールド以外ではnullが入ります。
        allowedExtensions:
          type: array
          description: 添付可能な拡張子リスト
          items:
            type: string
        prefix:
          type:
            - string
            - 'null'
          description: 単位（接頭辞）
        suffix:
          type:
            - string
            - 'null'
          description: 単位（接尾辞）
        approver:
          type: boolean
          description: 承認者が編集可能かどうか
        author:
          type: boolean
          description: 申請者が編集可能かどうか
        hidden:
          type:
            - boolean
            - 'null'
          description: 隠しフィールドである場合true
        readonlyOnUi:
          type:
            - boolean
            - 'null'
          description: |-
            trueの時、申請者・承認者が画面上から値を入力することを禁止します。
            外部API連携（ボタン）による代入や、REST API経由での入力はこのオプションの対象外です。
      required:
        - id
        - fieldType
        - code
        - title
        - required
        - showTotal
        - options
        - regexpFormat
        - formula
        - maxValue
        - minValue
        - defaultValue
        - decimalDigit
        - delimited
        - allowedExtensions
        - prefix
        - suffix
        - approver
    SlipFieldDetail:
      title: SlipFieldDetail
      x-tags:
        - workflows
      description: 明細フィールドの詳細
      allOf:
        - $ref: '#/components/schemas/SlipField'
        - type: object
          properties:
            generalMaster:
              anyOf:
                - $ref: '#/components/schemas/GeneralMaster'
                - type: 'null'
              description: 汎用マスタ。型が汎用マスタのときのみ値が入ります。
            defaultGeneralMasterItem:
              anyOf:
                - $ref: '#/components/schemas/GeneralMasterItem'
                - type: 'null'
              description: 汎用マスタアイテムの初期値
    WorkflowRouteCondition:
      title: WorkflowRouteCondition
      type: object
      x-tags:
        - workflows
      description: ワークフローの経路分岐
      properties:
        id:
          type: string
          description: UUID
        conditionType:
          type: string
          description: 経路分岐タイプ
          enum:
            - always
            - field
            - field_otherwise
        combinationType:
          type: string
          description: 条件の組み合わせタイプ
          enum:
            - all
            - any
            - custom
        combinationExpression:
          type: string
          description: 高度な条件式
        route:
          anyOf:
            - $ref: '#/components/schemas/Route'
            - type: 'null'
          description: 経路。routeまたはerrorMessageは片方のみ値が入ります。
        conditionFields:
          type: array
          description: 条件
          items:
            $ref: '#/components/schemas/WorkflowRouteConditionField'
        errorMessage:
          type:
            - string
            - 'null'
          description: 申請拒否時のエラーメッセージ。routeまたはerrorMessageは片方のみ値が入ります。
      required:
        - id
        - conditionType
        - combinationType
        - combinationExpression
        - route
        - conditionFields
        - errorMessage
    WorkflowRouteConditionField:
      title: WorkflowRouteConditionField
      type: object
      x-tags:
        - workflows
      description: ワークフロー経路分岐の条件
      properties:
        id:
          type: string
          description: UUID
        symbol:
          type: string
          description: 演算子
          enum:
            - equal
            - not_equal
            - greater_than
            - greater_than_or_equal
            - less_than
            - less_than_or_equal
            - include
            - exclude
            - is_empty
            - is_not_empty
            - descendants_or_equal
        value:
          type:
            - string
            - 'null'
          description: しきい値
        formField:
          description: 対象のフォームフィールド
          anyOf:
            - $ref: '#/components/schemas/FormField'
        grade:
          anyOf:
            - $ref: '#/components/schemas/Grade'
            - type: 'null'
          description: しきい値として使う役職
        team:
          anyOf:
            - $ref: '#/components/schemas/Team'
            - type: 'null'
          description: しきい値として使うチーム
        generalMasterItem:
          anyOf:
            - $ref: '#/components/schemas/GeneralMasterItem'
            - type: 'null'
          description: しきい値として使う汎用マスタアイテム
      required:
        - id
        - symbol
        - value
        - formField
        - grade
        - team
        - generalMasterItem
    WorkflowTicketViewer:
      title: WorkflowTicketViewer
      type: object
      x-tags:
        - workflows
      description: ワークフロー単位で設定された共有ユーザー
      properties:
        id:
          type: string
          description: UUID
        user:
          anyOf:
            - $ref: '#/components/schemas/User'
            - type: 'null'
          description: ユーザー。ユーザーとチームは片方のみ値が入ります。
        team:
          anyOf:
            - $ref: '#/components/schemas/Team'
            - type: 'null'
          description: チーム。ユーザーとチームは片方のみ値が入ります。
        grade:
          anyOf:
            - $ref: '#/components/schemas/Grade'
            - type: 'null'
          description: 役職。チーム指定で役職も指定する場合のみ値が入ります。
      required:
        - id
        - user
        - team
        - grade
    Route:
      title: Route
      type: object
      x-tags:
        - routes
      description: 経路
      properties:
        id:
          type: string
          description: UUID
        code:
          type: string
          description: コード
        status:
          type: string
          description: ステータス
          enum:
            - visible
            - deleted
            - error
        versionId:
          type: string
          description: バージョンのID
        versionNumber:
          type: integer
          description: バージョン番号
        name:
          type: string
          description: 名前
        description:
          type: string
          description: 説明
        createdAt:
          type: string
          description: 作成日時
        updatedAt:
          type: string
          description: 更新日時
        author:
          description: 作成者
          anyOf:
            - $ref: '#/components/schemas/User'
            - type: 'null'
        versionAuthor:
          anyOf:
            - $ref: '#/components/schemas/User'
            - type: 'null'
        folder:
          description: フォルダ
          anyOf:
            - $ref: '#/components/schemas/Folder'
      required:
        - id
        - code
        - status
        - versionId
        - versionNumber
        - name
        - description
        - createdAt
        - updatedAt
        - folder
    RouteDetail:
      title: RouteDetail
      x-tags:
        - routes
      description: 経路の詳細情報
      allOf:
        - $ref: '#/components/schemas/Route'
        - type: object
          properties:
            steps:
              type: array
              description: 経路ステップ
              items:
                $ref: '#/components/schemas/RouteStep'
          required:
            - steps
    RouteStep:
      title: RouteStep
      type: object
      x-tags:
        - routes
      description: 経路ステップ
      properties:
        id:
          type: string
          description: UUID
        stepOrder:
          type: integer
          description: ステップ順序（1から始まります）
        stepType:
          type: string
          description: ステップのタイプ
          enum:
            - author
            - manager
            - team
            - user
            - author_customizable
            - assignee_customizable
            - dynamic_team
            - dynamic_user
        title:
          type: string
          description: タイトル
        actionType:
          type: string
          description: アクションタイプ。承認/差し戻しの場合approve、回覧（確認あり）の場合confirm、回覧（確認なし）の場合noneになります。
          enum:
            - approve
            - confirm
            - none
        instruction:
          type:
            - string
            - 'null'
          description: 承認者への指示
        requiredApprovalsNumber:
          type: integer
          description: 必要な承認人数
        requiredApprovalsPercent:
          type: integer
          description: 必要な承認割合（%）
        fallbackType:
          description: フォールバックのタイプ
          anyOf:
            - type: string
              enum:
                - direct_manager
                - higher_manager
                - skip
                - no_fallback
                - higher_team
            - type: 'null'
        allowSelfApproval:
          type: boolean
          description: 自己承認を許可するか
        minCustomAssignees:
          type:
            - integer
            - 'null'
          description: 最小指名人数。「申請者が指名」ステップのみ設定可能。
          minimum: 0
        approverAssignmentInstruction:
          type:
            - string
            - 'null'
          description: 承認者の選び方
        users:
          type: array
          items:
            $ref: '#/components/schemas/User'
          description: 承認者の指定に使うユーザーの配列
        targets:
          type: array
          description: 承認者の指定に使うチームと役職の条件
          items:
            $ref: '#/components/schemas/RouteStepTarget'
        routeStepCondition:
          anyOf:
            - $ref: '#/components/schemas/RouteStepCondition'
            - type: 'null'
        code:
          type: string
          description: コード
      required:
        - id
        - stepOrder
        - stepType
        - title
        - actionType
        - instruction
        - requiredApprovalsNumber
        - requiredApprovalsPercent
        - fallbackType
        - allowSelfApproval
        - minCustomAssignees
        - approverAssignmentInstruction
        - users
        - code
    RouteStepTarget:
      title: RouteStepTarget
      type: object
      properties:
        team:
          $ref: '#/components/schemas/Team'
        descendants:
          type: boolean
          description: 'stepType=author_customizableまたはstepType=assignee_customizableの場合に、指定したチームの下位チームのメンバーも承認者候補に含めるかどうか（true: 含める、false: 含めない）'
        gradeSymbol:
          anyOf:
            - type: string
              enum:
                - equal
                - greater_than
                - greater_than_or_equal
                - less_than
                - less_than_or_equal
                - any_of
            - type: 'null'
          description: 役職の比較条件。役職が指定されているときのみ値が入ります。
        grades:
          type: array
          description: 承認者の指定に使う役職の配列
          items:
            $ref: '#/components/schemas/Grade'
        variable:
          type:
            - string
            - 'null'
          description: 承認者タイプ「チームを動的に指定」または「ユーザーを動的に指定」で指定する変数名が入ります。
    RouteStepCondition:
      title: RouteStepCondition
      type: object
      description: ステップごとに設定できる実行条件
      properties:
        id:
          type: string
          description: UUID
          format: uuid
        conditionType:
          type: string
          description: 実行タイプ
          enum:
            - always
            - conditional
            - conditional_skip
        combinationType:
          type: string
          description: 条件の組み合わせタイプ
          enum:
            - all
            - any
        routeStepConditionFields:
          type: array
          items:
            $ref: '#/components/schemas/RouteStepConditionField'
    RouteStepConditionField:
      title: RouteStepConditionField
      type: object
      description: ステップごとに設定できる実行条件の詳細
      properties:
        id:
          type: string
          description: UUID
          format: uuid
        variable:
          type: string
          description: 変数
        fieldKey:
          type: string
          description: 変数のフィールド
          enum:
            - author_grade
            - author_team
            - text_variable
            - number_variable
            - checkbox_variable
            - general_master_variable
            - other_variable
        symbol:
          type: string
          description: 演算子
          enum:
            - equal
            - not_equal
            - greater_than
            - greater_than_or_equal
            - less_than
            - less_than_or_equal
            - include
            - exclude
            - is_empty
            - is_not_empty
            - descendants_or_equal
            - not_descendants_or_equal
        value:
          type: string
          description: しきい値
        grade:
          anyOf:
            - $ref: '#/components/schemas/Grade'
          description: しきい値として使う役職
        team:
          anyOf:
            - $ref: '#/components/schemas/Team'
          description: しきい値として使うチーム
        generalMasterItem:
          anyOf:
            - $ref: '#/components/schemas/GeneralMasterItem'
          description: しきい値として使う汎用マスタアイテム
    Ticket:
      title: Ticket
      type: object
      x-tags:
        - tickets
      description: チケット
      properties:
        id:
          type: string
          description: UUID
          format: uuid
        ticketNumber:
          type:
            - string
            - 'null'
          description: チケット番号
        title:
          type:
            - string
            - 'null'
          description: タイトル
        status:
          type: string
          description: ステータス
          enum:
            - draft
            - in_progress
            - completed
            - rejected
            - archived
            - denied
            - permanently_deleted
        subStatus:
          description: サブステータス。処理中のみ値が入ります。
          anyOf:
            - $ref: '#/components/schemas/SubStatus'
            - type: 'null'
        currentStep:
          type: number
          description: 現在のステップ。0が起票者、1が最初の承認ステップ。
          minimum: 0
        author:
          description: 申請者。代理申請の場合、代理人が入ります。外部ゲストの場合はnullになります。
          anyOf:
            - $ref: '#/components/schemas/User'
            - type: 'null'
        proxyClientUser:
          description: 代理申請を依頼したユーザー。代理申請の場合のみ値が入ります。
          anyOf:
            - $ref: '#/components/schemas/User'
            - type: 'null'
        createdAt:
          type: string
          description: 作成日時
          format: date-time
        openedAt:
          type:
            - string
            - 'null'
          description: 申請日時
          format: date-time
        completedAt:
          type:
            - string
            - 'null'
          description: 完了日時
          format: date-time
        archivedAt:
          type:
            - string
            - 'null'
          description: アーカイブ日時
          format: date-time
        updatedAt:
          type: string
          description: 更新日時
          format: date-time
        publicStatus:
          type: boolean
          description: チケットがテナント全体に共有の場合true
        forcedPublicType:
          type: string
          description: チケットの共有範囲の上書き設定
          enum:
            - follow_workflow
            - forced_public
            - forced_private
        workflow:
          description: このチケットのワークフロー情報。チケットを一件だけ取得した場合のみ、セクションや共有ユーザーを含むより詳細なワークフロー情報が入ります。
          anyOf:
            - $ref: '#/components/schemas/Workflow'
            - $ref: '#/components/schemas/WorkflowInTicket'
        labels:
          type: array
          description: チケットのラベルの配列
          uniqueItems: true
          items:
            $ref: '#/components/schemas/Label'
      required:
        - id
        - ticketNumber
        - status
        - currentStep
        - author
        - proxyClientUser
        - createdAt
        - openedAt
        - completedAt
        - archivedAt
        - updatedAt
        - publicStatus
        - forcedPublicType
        - workflow
        - labels
    TicketWithStep:
      allOf:
        - $ref: '#/components/schemas/Ticket'
        - type: object
          properties:
            steps:
              type: array
              description: ステップの配列
              items:
                $ref: '#/components/schemas/TicketStep'
          required:
            - steps
    TicketDetail:
      title: TicketDetail
      x-tags:
        - tickets
      description: チケットの詳細
      allOf:
        - $ref: '#/components/schemas/Ticket'
        - type: object
          properties:
            authorTeam:
              description: 申請者の所属チーム. 外部ゲストの場合はnullになります。
              anyOf:
                - $ref: '#/components/schemas/Team'
                - type: 'null'
            route:
              description: このチケットの承認経路。申請拒否状態の場合、nullになります。
              anyOf:
                - $ref: '#/components/schemas/RouteDetail'
                - type: 'null'
            triggerTicket:
              description: 元のチケット（パイプラインで作成されたときのみ値が入ります）
              anyOf:
                - $ref: '#/components/schemas/Ticket'
                - type: 'null'
            nextTickets:
              description: 次のチケット（パイプラインで次のチケットを作成したときのみ値が入ります）
              type: array
              items:
                $ref: '#/components/schemas/Ticket'
            slipItems:
              description: 明細の入力
              type: array
              items:
                $ref: '#/components/schemas/SlipItem'
            ticketSections:
              type: array
              description: セクションの配列
              items:
                $ref: '#/components/schemas/TicketSection'
            inputs:
              description: フォームの入力
              type: array
              items:
                $ref: '#/components/schemas/TicketInput'
            cloudSignDocument:
              description: 添付されたクラウドサインの書類
              anyOf:
                - type: 'null'
                - type: object
                  properties:
                    id:
                      type: string
                      description: UUID
                      format: uuid
                    documentId:
                      type: string
                      description: クラウドサイン書類のID
                    documentTitle:
                      type: string
                      description: クラウドサイン書類のタイトル
                    status:
                      type: string
                      description: クラウドサイン書類のステータス
                      enum:
                        - draft
                        - in_progress
                        - rejected
                        - template
                        - imported
                        - completed
                    sandbox:
                      type: boolean
                      description: クラウドサインがサンドボックス環境の場合true
                    createdAt:
                      type: string
                      format: date-time
                      description: 作成日時
                    updatedAt:
                      type: string
                      format: date-time
                      description: 更新日時
                    url:
                      type: string
                      description: クラウドサイン書類のURL
                      format: uri
                  required:
                    - id
                    - documentId
                    - documentTitle
                    - status
                    - sandbox
                    - createdAt
                    - updatedAt
                    - url
            steps:
              description: チケットのステップ
              type: array
              items:
                $ref: '#/components/schemas/TicketStep'
          required:
            - authorTeam
            - route
            - slipItems
            - ticketSections
            - inputs
            - cloudSignDocument
            - steps
    TicketInput:
      title: TicketInput
      type: object
      x-tags:
        - tickets
      description: チケットのフォーム入力
      properties:
        id:
          type: string
          description: UUID
        value:
          description: |-
            入力値
            フィールドの型が汎用マスタアイテム、ユーザー、チーム、チケットの場合、JSON Arrayがキャッシュとして保存されます。
          anyOf:
            - type:
                - string
                - 'null'
            - type:
                - array
                - 'null'
              items: {}
            - type:
                - number
                - 'null'
            - type:
                - integer
                - 'null'
        formField:
          $ref: '#/components/schemas/FormField'
        generalMasterItems:
          type: array
          description: '入力値: 汎用マスタアイテム'
          items:
            $ref: '#/components/schemas/GeneralMasterItem'
        users:
          type: array
          description: '入力値: ユーザー'
          items:
            $ref: '#/components/schemas/User'
        teams:
          type: array
          description: '入力値: チーム'
          items:
            $ref: '#/components/schemas/Team'
        inputTickets:
          type: array
          description: '入力値: チケット'
          items:
            $ref: '#/components/schemas/Ticket'
        attachments:
          type: array
          description: 添付ファイル
          items:
            $ref: '#/components/schemas/Attachment'
      required:
        - id
        - value
    TicketSection:
      title: TicketSection
      type: object
      x-tags:
        - tickets
      description: チケットのセクション
      properties:
        sectionId:
          type: string
          description: ワークフローのセクションID
          format: uuid
        visible:
          type: boolean
          description: セクションの表示状態
        inputs:
          type: array
          description: このセクションの入力の配列
          items:
            $ref: '#/components/schemas/TicketInput'
      required:
        - sectionId
        - visible
        - inputs
    TicketStep:
      title: TicketStep
      type: object
      x-tags:
        - tickets
      description: チケット承認ステップ
      properties:
        id:
          type: string
          description: UUID
        routeStepId:
          type:
            - string
            - 'null'
          description: 経路ステップのUUID。カスタムステップの場合、nullになります。
        title:
          type:
            - string
            - 'null'
          description: ステップのタイトル
        actionType:
          type: string
          description: アクションタイプ。承認/差し戻しの場合approve、回覧（確認あり）の場合confirm、回覧（確認なし）の場合noneになります。
          enum:
            - approve
            - confirm
            - none
        requiredApprovalsNumber:
          type: integer
          description: 必要な承認人数
        requiredApprovalsPercent:
          type: integer
          description: 必要な承認割合%
        stepOrder:
          type: integer
          description: ステップの順序。最初の承認ステップが1。
        skip:
          description: スキップ可能な場合true
          type: boolean
        fallback:
          description: フォールバックした場合true
          type: boolean
        fallbackResult:
          description: フォールバックの結果
          anyOf:
            - type: string
              enum:
                - direct_manager
                - higher_manager
                - skip
                - no_fallback
                - higher_team
            - type: 'null'
        author:
          description: 承認ステップの作成者。カスタムステップの場合のみ、値が入ります。
          anyOf:
            - $ref: '#/components/schemas/User'
            - type: 'null'
        assignees:
          type: array
          description: 承認者
          items:
            $ref: '#/components/schemas/TicketAssignee'
        completed:
          type: boolean
          description: ステップが完了している場合true
        completedAt:
          type:
            - string
            - 'null'
          description: ステップが完了した日時。過去のデータではnullを返します。
          format: date-time
      required:
        - id
        - routeStepId
        - title
        - actionType
        - requiredApprovalsNumber
        - requiredApprovalsPercent
        - stepOrder
        - skip
        - fallback
        - fallbackResult
        - author
        - assignees
        - completed
        - completedAt
    TicketAssignee:
      title: TicketAssignee
      type: object
      x-tags:
        - tickets
      description: チケット承認者
      properties:
        id:
          type: string
          description: UUID
        stepOrder:
          type: integer
          description: ステップ番号。1が最初の承認ステップ。
        current:
          type: boolean
          description: 現在の承認ステップの場合true
        completed:
          type: boolean
          description: 承認済みの場合true
        completedAt:
          type:
            - string
            - 'null'
          description: 承認日時。古いデータではnullを返します。
          format: date-time
        pending:
          type: boolean
          description: 承認を保留中の場合true
        user:
          $ref: '#/components/schemas/User'
      required:
        - id
        - stepOrder
        - current
        - completed
        - completedAt
        - pending
        - user
    Attachment:
      title: Attachment
      type: object
      x-tags:
        - tickets
      description: 添付ファイル
      properties:
        signedId:
          type: string
          description: 署名済みID
        filename:
          type: string
          description: ファイル名
        url:
          type: string
          description: ファイルURL
          format: uri
        byteSize:
          type: integer
          description: バイト数
        contentType:
          type: string
          description: Content-Type
      required:
        - signedId
        - filename
        - url
        - byteSize
        - contentType
    SlipItem:
      title: SlipItem
      type: object
      x-tags:
        - tickets
      description: 明細アイテム
      properties:
        id:
          type: string
          description: UUID
          format: uuid
        inputs:
          type: array
          description: 明細アイテムの入力の配列
          items:
            $ref: '#/components/schemas/SlipItemInput'
        createdAt:
          type: string
          format: date-time
          description: 作成日時
        updatedAt:
          type: string
          format: date-time
          description: 更新日時
        slipSectionId:
          type: string
          format: uuid
          description: 明細セクションのUUID
      required:
        - id
        - inputs
        - createdAt
        - updatedAt
        - slipSectionId
    SlipItemInput:
      title: SlipItemInput
      type: object
      x-tags:
        - tickets
      description: 明細アイテム入力
      properties:
        id:
          type: string
          description: UUID
          format: uuid
        slipFieldId:
          type: string
          description: 明細フィールドのUUID
          format: uuid
        createdAt:
          type: string
          format: date-time
          description: 作成日時
        updatedAt:
          type: string
          format: date-time
          description: 更新日時
        value:
          description: |-
            入力値

            フィールドの型が汎用マスタアイテムの場合、JSON Arrayがキャッシュとして保存されます。
          anyOf:
            - type: string
            - type: array
              items: {}
            - type: number
            - type: integer
            - type: 'null'
        generalMasterItems:
          type: array
          description: '入力値: 汎用マスタアイテム'
          items:
            $ref: '#/components/schemas/GeneralMasterItem'
        users:
          type: array
          description: '入力値: ユーザー'
          items:
            $ref: '#/components/schemas/User'
        teams:
          type: array
          description: '入力値: チーム'
          items:
            $ref: '#/components/schemas/Team'
        inputTickets:
          type: array
          description: '入力値: チケット'
          items:
            $ref: '#/components/schemas/Ticket'
        attachments:
          type: array
          description: 添付ファイル
          items:
            $ref: '#/components/schemas/Attachment'
      required:
        - id
        - slipFieldId
        - createdAt
        - updatedAt
        - value
        - generalMasterItems
        - attachments
    Label:
      title: Label
      type: object
      x-tags:
        - tickets
      description: ラベル
      properties:
        id:
          type: string
          description: UUID
          format: uuid
        name:
          type: string
          description: 名前
        description:
          type:
            - string
            - 'null'
          description: 説明
        color:
          type: string
          description: 'ラベルの色。#なしHEXコード（例: ff0000）'
          pattern: ^[a-f0-9]{6}$
          minLength: 6
          maxLength: 6
        createdAt:
          type: string
          description: 作成日時
          format: date-time
        updatedAt:
          type: string
          description: 更新日時
          format: date-time
      required:
        - id
        - name
        - description
        - color
        - createdAt
        - updatedAt
    SubStatus:
      title: SubStatus
      type: object
      x-tags:
        - tickets
      description: サブステータス
      properties:
        id:
          type: string
          description: UUID
          format: uuid
        code:
          type: string
          description: コード
        name:
          type: string
          description: 名前
        notes:
          type:
            - string
            - 'null'
          description: 説明
        createdAt:
          type: string
          description: 作成日時
          format: date-time
        updatedAt:
          type: string
          description: 更新日時
          format: date-time
      required:
        - id
        - code
        - name
        - notes
        - createdAt
        - updatedAt
    TicketViewer:
      title: TicketViewer
      type: object
      x-tags:
        - tickets
      description: チケットの共有ユーザー
      properties:
        id:
          type: string
          description: UUID
          format: uuid
        user:
          anyOf:
            - $ref: '#/components/schemas/User'
            - type: 'null'
        team:
          anyOf:
            - $ref: '#/components/schemas/Team'
            - type: 'null'
        grade:
          anyOf:
            - $ref: '#/components/schemas/Grade'
            - type: 'null'
        descendants:
          type: boolean
          description: 下位のチームを含めるかどうか
      required:
        - id
        - user
        - team
        - grade
        - descendants
    Comment:
      title: Comment
      x-stoplight:
        id: 6g3gvt99gzwt2
      x-tags:
        - コメント
      type: object
      description: コメント
      properties:
        id:
          type: string
          description: UUID
          format: uuid
        body:
          type: string
          description: 本文
        attachments:
          type: array
          description: 添付ファイル
          items:
            $ref: '#/components/schemas/Attachment'
        createdAt:
          type: string
          description: 作成日時
          format: date-time
        updatedAt:
          type: string
          description: 更新日時
          format: date-time
        deletedAt:
          type:
            - string
            - 'null'
          description: 削除日時
          format: date-time
        user:
          anyOf:
            - $ref: '#/components/schemas/User'
        mentionedUsers:
          type: array
          description: メンションしたユーザーの配列
          items:
            $ref: '#/components/schemas/User'
      required:
        - id
        - body
        - attachments
        - createdAt
        - updatedAt
        - deletedAt
        - user
        - mentionedUsers
    AuditLog:
      title: AuditLog
      type: object
      x-tags:
        - 監査ログ
      description: 監査ログ
      properties:
        id:
          type: string
          format: uuid
          description: UUID
        user:
          description: 操作ユーザー。システムによる操作の場合はnull。
          anyOf:
            - $ref: '#/components/schemas/User'
            - type: 'null'
        action:
          type: string
          description: 操作種別
        data:
          type:
            - object
            - 'null'
          description: 操作データ
        remoteIp:
          type:
            - string
            - 'null'
          description: リモートIPアドレス
        systemType:
          type:
            - string
            - 'null'
          description: システムによる操作種別
          enum:
            - automation
            - null
        createdAt:
          type: string
          format: date-time
          description: 作成日時
        updatedAt:
          type: string
          format: date-time
          description: 更新日時
      required:
        - id
        - user
        - action
        - data
        - remoteIp
        - systemType
        - createdAt
        - updatedAt
    WebhookRequestBodyPing:
      title: WebhookRequestBodyPing
      description: Webhookのリクエストボディ（ping）
      x-tags:
        - webhook
      type: object
      properties:
        eventType:
          type: string
          description: イベントの種類
        tenant:
          $ref: '#/components/schemas/WebhookTenant'
        user:
          $ref: '#/components/schemas/User'
        data:
          type: object
          properties:
            message:
              type: string
              description: メッセージ。eventTypeがpingの場合に使用されます。
    WebhookRequestBodyTicket:
      title: WebhookRequestBodyTicket
      description: Webhookのリクエストボディ（ticket_*）
      x-tags:
        - webhook
      type: object
      properties:
        eventType:
          type: string
          description: イベントの種類
        tenant:
          $ref: '#/components/schemas/WebhookTenant'
        user:
          $ref: '#/components/schemas/User'
        data:
          type: object
          properties:
            ticket:
              $ref: '#/components/schemas/TicketDetail'
    WebhookRequestBodyComment:
      title: WebhookRequestBodyComment
      description: Webhookのリクエストボディ（comment_*）
      x-tags:
        - webhook
      type: object
      properties:
        eventType:
          type: string
          description: イベントの種類
        tenant:
          $ref: '#/components/schemas/WebhookTenant'
        user:
          $ref: '#/components/schemas/User'
        data:
          type: object
          properties:
            ticket:
              $ref: '#/components/schemas/TicketWithStep'
            comment:
              $ref: '#/components/schemas/Comment'
    WebhookTenant:
      title: WebhookTenant
      description: Webhookのテナント情報
      x-tags:
        - webhook
      type: object
      properties:
        id:
          type: string
          description: テナントのUUID
          format: uuid
        publicId:
          type: string
          description: テナントのパブリックID（サブドメイン）
        name:
          type: string
          description: テナント名
    KintoneApp:
      title: KintoneApp
      type: object
      description: kintone連携
      properties:
        id:
          type: string
          format: uuid
          description: UUID
        name:
          type: string
          description: kintoneアプリ名
        domain:
          type: string
          description: kintoneドメイン
        appId:
          type: string
          description: kintoneアプリID
      required:
        - id
        - name
        - domain
        - appId
    KintoneAppSetting:
      title: KintoneAppSetting
      type: object
      x-tags:
        - workflows
      description: kintone連携設定
      properties:
        id:
          type: string
          format: uuid
          description: UUID
        formField:
          $ref: '#/components/schemas/FormField'
        kintoneApp:
          $ref: '#/components/schemas/KintoneApp'
        mappings:
          type: array
          description: フィールドへのマッピング設定
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
                description: UUID
              displayInTable:
                type: boolean
                description: 選択用テーブルで表示する場合true
              kintoneFieldCode:
                type: string
                description: kintoneフィールドコード
              kintoneFieldName:
                type: string
                description: kintoneフィールドコード
              kintoneFieldType:
                type: string
                description: kintoneフィールドコード
              formField:
                $ref: '#/components/schemas/FormField'
            required:
              - id
              - displayInTable
              - kintoneFieldCode
              - kintoneFieldType
              - kintoneFieldName
              - formField
      required:
        - id
        - formField
        - kintoneApp
        - mappings
    GeneralMasterSearchFilter:
      title: GeneralMasterSearchFilter
      x-tags:
        - workflows
      type: object
      required:
        - id
        - filterFormFieldId
        - fieldType
        - generalMasterFieldId
      properties:
        id:
          type: string
          format: uuid
          description: UUID
        filterFormFieldId:
          type: string
          format: uuid
          description: 絞り込みに使う汎用フィールドのID（UUID）
        fieldType:
          type: string
          enum:
            - free_word
            - name
            - code
            - description
            - custom_field
          description: 絞り込み先のフィールドのタイプ
        generalMasterFieldId:
          type:
            - string
            - 'null'
          format: uuid
          description: fieldType=custom_fieldの場合に絞り込み先の汎用マスタのカスタムフィールドのID（UUID）
  securitySchemes:
    PersonalAccessTokenAuth:
      type: http
      scheme: bearer
      description: Personal Access Tokenによる認証。AuthorizationヘッダーにBearerトークンを指定します。
    ServiceAccountTokenAuth:
      type: http
      scheme: bearer
      description: Service Account Tokenによる認証。AuthorizationヘッダーにBearerトークンを指定し、さらにX-Caller-IdヘッダーにユーザーUUIDを指定する必要があります。
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    UnprocessableContent:
      description: Unprocessable Content
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/ErrorResponse'
              - type: object
                properties:
                  errors:
                    type: object
                    description: バリデーションエラーの詳細
                    additionalProperties:
                      type: array
                      items:
                        type: string
                    example:
                      name:
                        - can't be blank
                      email:
                        - is invalid
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    GatewayTimeout:
      description: Gateway Timeout
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
