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

# watermark 埋め込み注文を作成

> watermark 埋め込み注文を作成します。
- 画像1枚あたり最大10個の watermark テキスト
- 注文あたり最大100ファイル
- 対応画像形式（IMG）: jpg, jpeg, png, webp, bmp, tiff
- 対応文書形式（DOCUMENT）: pdf

## 入力モード（アップロード / URL / 混合）
入力モードは、各ファイルオブジェクトに `originalFileUrl` が含まれるかどうかで決定されます:
- **アップロードモード**（`originalFileUrl` なし）: プリサインドURLを発行 → クライアントがS3にアップロード → 処理が自動的に開始
- **URLモード**（`originalFileUrl` を指定）: URLから画像をダウンロードして即座に処理
- **混合モード**: 一部のファイルはアップロードモード、残りはURLモードで同時に処理

### 動作
| 条件 | 注文ステータス | Confirmの必要性 |
|-----------|-------------|-----------------|
| すべてのファイルに `originalFileUrl` がある | `pending` | 不要（サーバーのダウンロード完了後に自動開始） |
| `originalFileUrl` がないファイルが含まれる | `pending` | 不要（アップロード完了後に自動開始） |

<Note>Anti-AIやAI Detectionと異なり、Watermark Embedでは別途confirmステップは不要です。ファイルアップロードが完了すると処理が自動的に開始されます。</Note>



## OpenAPI

````yaml ja/api-reference/openapi.yaml POST /api/v2/orders/wtr-embed
openapi: 3.0.0
info:
  title: BIZ MORI API
  version: 2.0.0
  description: >-
    BIZ MORI API は、デジタルコンテンツ保護のための4つのコアサービスを提供します:

    - **Anti-AI**: 画像をAI学習から保護

    - **Watermark Embed**: 画像に不可視のデジタル watermark を埋め込み

    - **Watermark Extract**: 画像から watermark を抽出・検証

    - **AI Detection**: 画像がAI生成かどうかを検知

    - **テストAPIキー**: `sk_test_`
    プレフィックスのキーは同じBearer認証を使用し、実際の処理サービスの実行やクレジットの消費なしに注文ライフサイクルを検証できます。テストアップロードの内容は破棄され、結果ファイルは作成されません
  contact:
    name: BIZ MORI サポート
    email: support@bizmori.com
servers:
  - url: https://api.bizmori.com
    description: 本番環境
security: []
tags:
  - name: Anti-AI
    description: Anti-AI画像保護の注文
  - name: Watermark Embed
    description: watermark 埋め込みの注文
  - name: Watermark Extract
    description: watermark 抽出の注文
  - name: AI Detection
    description: AI生成画像検知の注文
  - name: Orders
    description: 注文の照会と管理
  - name: Webhooks
    description: Webhookの設定とイベント
paths:
  /api/v2/orders/wtr-embed:
    post:
      tags:
        - Watermark Embed
      summary: watermark 埋め込み注文を作成
      description: >-
        watermark 埋め込み注文を作成します。

        - 画像1枚あたり最大10個の watermark テキスト

        - 注文あたり最大100ファイル

        - 対応画像形式（IMG）: jpg, jpeg, png, webp, bmp, tiff

        - 対応文書形式（DOCUMENT）: pdf


        ## 入力モード（アップロード / URL / 混合）

        入力モードは、各ファイルオブジェクトに `originalFileUrl` が含まれるかどうかで決定されます:

        - **アップロードモード**（`originalFileUrl` なし）: プリサインドURLを発行 → クライアントがS3にアップロード →
        処理が自動的に開始

        - **URLモード**（`originalFileUrl` を指定）: URLから画像をダウンロードして即座に処理

        - **混合モード**: 一部のファイルはアップロードモード、残りはURLモードで同時に処理


        ### 動作

        | 条件 | 注文ステータス | Confirmの必要性 |

        |-----------|-------------|-----------------|

        | すべてのファイルに `originalFileUrl` がある | `pending` | 不要（サーバーのダウンロード完了後に自動開始）
        |

        | `originalFileUrl` がないファイルが含まれる | `pending` | 不要（アップロード完了後に自動開始） |


        <Note>Anti-AIやAI Detectionと異なり、Watermark
        Embedでは別途confirmステップは不要です。ファイルアップロードが完了すると処理が自動的に開始されます。</Note>
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - idempotencyKey
                - files
              properties:
                idempotencyKey:
                  type: string
                  description: 冪等性キー
                files:
                  type: array
                  minItems: 1
                  maxItems: 100
                  items:
                    type: object
                    required:
                      - fileName
                      - watermarks
                    properties:
                      fileName:
                        type: string
                        description: ファイル名
                        example: image.jpg
                      originalFileUrl:
                        type: string
                        format: uri
                        description: |-
                          元画像URL（任意）
                          - 指定した場合: URLモード（プリサインドURLは発行されず、即座に処理）
                          - 指定しない場合: アップロードモード（プリサインドURLを発行）
                        example: https://example.com/image.jpg
                      watermarks:
                        type: array
                        minItems: 1
                        maxItems: 10
                        items:
                          type: object
                          required:
                            - text
                          properties:
                            text:
                              type: string
                              maxLength: 1000
                              description: watermark テキスト
            examples:
              uploadMode:
                summary: アップロードモード（従来型）
                value:
                  idempotencyKey: 5e9c7a3b-b4d2-4f18-83e6-8b1a2d5f7c93
                  files:
                    - fileName: image1.jpg
                      watermarks:
                        - text: MORI_WATERMARK
                    - fileName: image2.png
                      watermarks:
                        - text: MORI_WATERMARK
              urlMode:
                summary: URLモード（即座に処理）
                value:
                  idempotencyKey: 6a4d2f80-c9e7-45b1-8a3d-2c5f7e9b1d64
                  files:
                    - fileName: image1.jpg
                      originalFileUrl: https://example.com/image1.jpg
                      watermarks:
                        - text: MORI_WATERMARK
                    - fileName: image2.png
                      originalFileUrl: https://example.com/image2.png
                      watermarks:
                        - text: MORI_WATERMARK
              mixedMode:
                summary: 混合モード
                value:
                  idempotencyKey: 7d2a8c4e-5f91-4b63-a7d0-9e1c3f6b8a25
                  files:
                    - fileName: upload-file.jpg
                      watermarks:
                        - text: MORI_WATERMARK
                    - fileName: url-file.png
                      originalFileUrl: https://example.com/image.png
                      watermarks:
                        - text: MORI_WATERMARK
      responses:
        '200':
          description: 注文が正常に作成されました
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      orderName:
                        type: string
                      orderId:
                        type: string
                      status:
                        type: string
                        enum:
                          - pending
                        description: |-
                          注文ステータス
                          - `pending`: 入力モードに関わらず常に返却
                      files:
                        type: array
                        items:
                          type: object
                          description: >-
                            ファイル情報（モードによってフィールドが異なります）

                            - アップロードモード: fileId, fileName, uploadUrl, fileKey,
                            fileFormat, fileType

                            - URLモード: fileId, fileName, originalFileUrl,
                            fileKey, fileFormat, fileType
                          properties:
                            fileId:
                              type: integer
                            fileName:
                              type: string
                            uploadUrl:
                              type: string
                              format: uri
                              description: プリサインドアップロードURL。アップロードモードでのみ返却されます。
                            originalFileUrl:
                              type: string
                              format: uri
                              description: リクエストで指定された公開画像URL。URLモードでのみ返却されます。
                            fileKey:
                              type: string
                              description: ファイルのS3オブジェクトキー。
                            fileFormat:
                              type: string
                              description: ファイル形式。
                              enum:
                                - JPG
                                - PNG
                                - WEBP
                                - BMP
                                - TIFF
                                - PDF
                            fileType:
                              type: string
                              description: ファイルタイプの分類。
                              enum:
                                - IMG
                                - DOCUMENT
              examples:
                uploadModeResponse:
                  summary: アップロードモードのレスポンス
                  value:
                    data:
                      orderName: wtr_embed_20260318120000.000
                      orderId: '424706541233094656'
                      status: pending
                      files:
                        - fileId: 2469
                          fileName: image.jpg
                          uploadUrl: >-
                            https://s3.ap-northeast-2.amazonaws.com/...?X-Amz-Algorithm=AWS4-HMAC-SHA256&...
                          fileKey: wtr-embed/424706541233094656/images/1/image.jpg
                          fileFormat: JPG
                          fileType: IMG
                        - fileId: 2470
                          fileName: document.pdf
                          uploadUrl: >-
                            https://s3.ap-northeast-2.amazonaws.com/...?X-Amz-Algorithm=AWS4-HMAC-SHA256&...
                          fileKey: >-
                            wtr-embed/424706541233094656/documents/2/document.pdf
                          fileFormat: PDF
                          fileType: DOCUMENT
                urlModeResponse:
                  summary: URLモードのレスポンス
                  value:
                    data:
                      orderName: wtr_embed_20260318120000.000
                      orderId: '424707536709206016'
                      status: pending
                      files:
                        - fileId: 2490
                          fileName: image.png
                          originalFileUrl: https://example.com/image.jpg
                          fileKey: wtr-embed/424707536709206016/images/1/image.png
                          fileFormat: PNG
                          fileType: IMG
                mixedModeResponse:
                  summary: 混合モードのレスポンス
                  value:
                    data:
                      orderName: wtr_embed_20260318120000.000
                      orderId: '424707536709206016'
                      status: pending
                      files:
                        - fileId: 2490
                          fileName: image.png
                          originalFileUrl: https://example.com/image.jpg
                          fileKey: wtr-embed/424707536709206016/images/1/image.png
                          fileFormat: PNG
                          fileType: IMG
                        - fileId: 2491
                          fileName: photo.jpeg
                          uploadUrl: >-
                            https://s3.ap-northeast-2.amazonaws.com/...?X-Amz-Algorithm=AWS4-HMAC-SHA256&...
                          fileKey: wtr-embed/424707536709206016/images/2/photo.jpeg
                          fileFormat: JPG
                          fileType: IMG
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/UsageLimitExceeded'
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST https://api.bizmori.com/api/v2/orders/wtr-embed \
              -H "Authorization: Bearer YOUR_API_TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
                "idempotencyKey": "5e9c7a3b-b4d2-4f18-83e6-8b1a2d5f7c93",
                "files": [
                  {
                    "fileName": "image.jpg",
                    "watermarks": [{"text": "MORI_WATERMARK"}]
                  }
                ]
              }'
        - lang: javascript
          label: JavaScript
          source: >-
            const response = await
            fetch('https://api.bizmori.com/api/v2/orders/wtr-embed', {
              method: 'POST',
              headers: {
                'Authorization': 'Bearer YOUR_API_TOKEN',
                'Content-Type': 'application/json'
              },
              body: JSON.stringify({
                idempotencyKey: '5e9c7a3b-b4d2-4f18-83e6-8b1a2d5f7c93',
                files: [
                  {
                    fileName: 'image.jpg',
                    watermarks: [{ text: 'MORI_WATERMARK' }]
                  }
                ]
              })
            });

            const data = await response.json();
        - lang: python
          label: Python
          source: |-
            import requests

            response = requests.post(
                'https://api.bizmori.com/api/v2/orders/wtr-embed',
                headers={'Authorization': 'Bearer YOUR_API_TOKEN'},
                json={
                    'idempotencyKey': '5e9c7a3b-b4d2-4f18-83e6-8b1a2d5f7c93',
                    'files': [
                        {
                            'fileName': 'image.jpg',
                            'watermarks': [{'text': 'MORI_WATERMARK'}]
                        }
                    ]
                }
            )
            data = response.json()
components:
  responses:
    BadRequest:
      description: 不正なリクエスト
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: VALIDATION_FAILED
    Unauthorized:
      description: 認証失敗
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: AUTH_NOT_AUTHENTICATED
    UsageLimitExceeded:
      description: 使用量上限を超過
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: USAGE_LIMIT_EXCEEDED
  schemas:
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: エラーコード
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        外部クライアントアクセス用のBearer APIキー。本番キーは `sk_` プレフィックスを使用し、テストキーは `sk_test_`
        プレフィックスを使用して、処理やクレジット消費なしに注文ライフサイクルを検証します。

````