> ## 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 埋め込み注文を作成

> 画像と PDF に不可視 watermark を埋め込む注文を作成します。

- 注文あたりファイル最大 100 件、ファイルあたりテキスト 1〜10 件、テキストあたり 1〜1,000 文字
- テキストごとに `outputs[]` に別の結果ファイルが作成され、1 クレジットを使用します
- 対応拡張子: `jpg`, `jpeg`, `png`, `webp`, `bmp`, `tif`, `tiff`, `pdf`。BMP は無圧縮 24 ビット RGB または 1・8 ビットのグレースケール、TIFF は単一ページの 8 ビット RGB または 1・8 ビットのグレースケール(アルファなし)のみ処理できます
- この範囲外の BMP・TIFF(複数ページ、16 ビット、パレット、アルファ、CMYK など)は、公開 `errorCode` とともに注文が `failed` になり、クレジットは戻ります
- `originalFileUrl` のないファイルは `files[].uploadUrl`(900 秒有効)へ `PUT` でアップロードします
- すべてのファイルのアップロードが終わると処理が自動で始まります。confirm の呼び出しはありません
- 12 時間以内にアップロードされない注文は `failed` になります
- [`GET /api/v3/orders/{orderId}`](/ja/api-reference/orders/get-order-v3) で `status` が `complete` になるまで照会してから、ダウンロード API を呼び出してください




## OpenAPI

````yaml ja/api-reference/openapi.yaml POST /api/v3/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
  license:
    name: Proprietary
    url: https://docs.bizmori.com/legal/terms
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の設定とイベント
  - name: Reports
    description: watermark 抽出・AI Detection 注文の PDF 分析レポート
paths:
  /api/v3/orders/wtr-embed:
    post:
      tags:
        - Watermark Embed
      summary: watermark 埋め込み注文を作成
      description: >
        画像と PDF に不可視 watermark を埋め込む注文を作成します。


        - 注文あたりファイル最大 100 件、ファイルあたりテキスト 1〜10 件、テキストあたり 1〜1,000 文字

        - テキストごとに `outputs[]` に別の結果ファイルが作成され、1 クレジットを使用します

        - 対応拡張子: `jpg`, `jpeg`, `png`, `webp`, `bmp`, `tif`, `tiff`, `pdf`。BMP
        は無圧縮 24 ビット RGB または 1・8 ビットのグレースケール、TIFF は単一ページの 8 ビット RGB または 1・8
        ビットのグレースケール(アルファなし)のみ処理できます

        - この範囲外の BMP・TIFF(複数ページ、16 ビット、パレット、アルファ、CMYK など)は、公開 `errorCode`
        とともに注文が `failed` になり、クレジットは戻ります

        - `originalFileUrl` のないファイルは `files[].uploadUrl`(900 秒有効)へ `PUT`
        でアップロードします

        - すべてのファイルのアップロードが終わると処理が自動で始まります。confirm の呼び出しはありません

        - 12 時間以内にアップロードされない注文は `failed` になります

        - [`GET
        /api/v3/orders/{orderId}`](/ja/api-reference/orders/get-order-v3) で
        `status` が `complete` になるまで照会してから、ダウンロード API を呼び出してください
      operationId: createWatermarkV1EmbedOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - idempotencyKey
                - files
              properties:
                idempotencyKey:
                  type: string
                  maxLength: 255
                  description: >-
                    冪等性キー。新しい注文ごとに新しい UUIDv4
                    を使い、同じリクエストを再試行するときだけ再利用します。同じキーは既存の注文を返し、同じキーで異なるリクエストボディを送ると
                    `409 WATERMARK_V2_CONFLICT` を返します。
                files:
                  type: array
                  minItems: 1
                  maxItems: 100
                  description: 1 つの注文に画像と PDF を混在できます。
                  items:
                    type: object
                    required:
                      - fileName
                      - watermarks
                    properties:
                      fileName:
                        type: string
                        maxLength: 255
                        description: >-
                          拡張子を含むファイル名。対応形式: `jpg`, `jpeg`, `png`, `webp`, `bmp`,
                          `tif`, `tiff`, `pdf`
                      originalFileUrl:
                        type: string
                        format: uri
                        description: >-
                          元ファイルの公開 HTTPS URL(任意)。指定すると BIZ MORI がファイルをダウンロードし(最大
                          32 MiB、リダイレクト非対応)、そのファイルの `uploadUrl` は発行しません。
                      watermarks:
                        type: array
                        minItems: 1
                        maxItems: 10
                        description: >-
                          埋め込む watermark テキスト。テキストごとに別の結果ファイルが作成され、1
                          クレジットを使用します。
                        items:
                          type: object
                          required:
                            - text
                          properties:
                            text:
                              type: string
                              minLength: 1
                              maxLength: 1000
            example:
              idempotencyKey: f47ac10b-58cc-4372-a567-0e02b2c3d479
              files:
                - fileName: campaign.png
                  watermarks:
                    - text: MORI-2026-001
                - fileName: contract.pdf
                  originalFileUrl: https://example.com/contract.pdf
                  watermarks:
                    - text: PARTNER-A
                    - text: PARTNER-B
      responses:
        '200':
          description: 注文を作成、または同じ `idempotencyKey` の既存注文を返却
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WatermarkV1OrderResponse'
              example:
                data:
                  orderId: '1234567890'
                  status: pending
                  processingDelayed: false
                  expiresAt: '2026-10-08T03:00:00.000Z'
                  files:
                    - fileId: '501'
                      uploadUrl: https://s3.ap-northeast-2.amazonaws.com/...
                    - fileId: '502'
                      uploadUrl: null
                  outputs:
                    - fileId: 501-1
                      inputFileId: '501'
                      outputIndex: 0
                      watermarkText: MORI-2026-001
                      status: pending
                      mediaKind: image
                    - fileId: 502-1
                      inputFileId: '502'
                      outputIndex: 0
                      watermarkText: PARTNER-A
                      status: pending
                      mediaKind: pdf
                    - fileId: 502-2
                      inputFileId: '502'
                      outputIndex: 1
                      watermarkText: PARTNER-B
                      status: pending
                      mediaKind: pdf
                  result: null
                  reports: []
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '409':
          description: 同じ `idempotencyKey` で異なるリクエストボディを送信
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: WATERMARK_V2_CONFLICT
        '429':
          description: リクエスト回数の超過
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: RATE_LIMIT_EXCEEDED
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          description: watermark 処理を一時的に利用できない
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: WATERMARK_V2_UNAVAILABLE
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |
            curl -X POST https://api.bizmori.com/api/v3/orders/wtr-embed \
              -H "Authorization: Bearer YOUR_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
              "idempotencyKey": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
              "files": [
                {
                  "fileName": "campaign.png",
                  "watermarks": [
                    {
                      "text": "MORI-2026-001"
                    }
                  ]
                },
                {
                  "fileName": "contract.pdf",
                  "originalFileUrl": "https://example.com/contract.pdf",
                  "watermarks": [
                    {
                      "text": "PARTNER-A"
                    },
                    {
                      "text": "PARTNER-B"
                    }
                  ]
                }
              ]
            }'
        - lang: javascript
          label: JavaScript
          source: >
            const response = await
            fetch(`https://api.bizmori.com/api/v3/orders/wtr-embed`, {
              method: 'POST',
              headers: {
                'Authorization': 'Bearer YOUR_API_KEY',
                'Content-Type': 'application/json'
              },
              body: JSON.stringify({
                "idempotencyKey": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
                "files": [
                  {
                    "fileName": "campaign.png",
                    "watermarks": [
                      {
                        "text": "MORI-2026-001"
                      }
                    ]
                  },
                  {
                    "fileName": "contract.pdf",
                    "originalFileUrl": "https://example.com/contract.pdf",
                    "watermarks": [
                      {
                        "text": "PARTNER-A"
                      },
                      {
                        "text": "PARTNER-B"
                      }
                    ]
                  }
                ]
              })
            });

            const { data } = await response.json();

            // 各ファイルを presigned URL へ PUT でアップロードします (files[] はリクエスト順)

            // await fetch(data.files[0].uploadUrl, { method: 'PUT', body: file
            });
        - lang: python
          label: Python
          source: >
            import requests


            response = requests.post(
                f'https://api.bizmori.com/api/v3/orders/wtr-embed',
                headers={'Authorization': 'Bearer YOUR_API_KEY'},
                json={
                  "idempotencyKey": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
                  "files": [
                    {
                      "fileName": "campaign.png",
                      "watermarks": [
                        {
                          "text": "MORI-2026-001"
                        }
                      ]
                    },
                    {
                      "fileName": "contract.pdf",
                      "originalFileUrl": "https://example.com/contract.pdf",
                      "watermarks": [
                        {
                          "text": "PARTNER-A"
                        },
                        {
                          "text": "PARTNER-B"
                        }
                      ]
                    }
                  ]
                }
            )

            data = response.json()['data']

            # 各ファイルを presigned URL へ PUT でアップロードします (files[] はリクエスト順)

            # requests.put(data['files'][0]['uploadUrl'],
            data=open('campaign.png', 'rb'))
components:
  schemas:
    WatermarkV1OrderResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/WatermarkV1Order'
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: エラーコード
    WatermarkV1Order:
      type: object
      description: v3 API で作成した不可視 watermark 注文
      required:
        - orderId
        - status
        - processingDelayed
        - files
        - outputs
        - result
        - reports
      properties:
        orderId:
          type: string
          description: 注文 ID
        status:
          type: string
          enum:
            - pending
            - inProgress
            - complete
            - failed
            - expired
          description: |
            注文の処理ステータス

            * `pending` - ファイルのアップロード待ち
            * `inProgress` - 処理中
            * `complete` - 処理完了。抽出注文は `result` で結果を確認します
            * `failed` - 処理失敗、または 12 時間以内にアップロードされなかった
            * `expired` - 保管期限を過ぎ、ファイルが削除された
        processingDelayed:
          type: boolean
          description: 自動再試行をすべて使い切り、手動復旧を待っている場合は `true`。注文は `inProgress` のままです
        expiresAt:
          type: string
          format: date-time
          nullable: true
          description: 注文ファイルが削除される日時。以降のダウンロードとレポートは `ORDER_EXPIRED` を返します
        files:
          type: array
          description: リクエスト順の入力ファイル。抽出注文は元ファイル、検査ファイルの順です
          items:
            $ref: '#/components/schemas/WatermarkV1UploadFile'
        outputs:
          type: array
          description: 埋め込み結果。watermark テキストごとに 1 件で、抽出注文では空の配列です
          items:
            $ref: '#/components/schemas/WatermarkV1Output'
        result:
          $ref: '#/components/schemas/WatermarkV1DetectionResult'
        reports:
          type: array
          description: この注文でリクエストしたレポート
          items:
            type: object
            required:
              - locale
              - status
            properties:
              locale:
                type: string
                enum:
                  - ko-KR
                  - en-US
                  - ja-JP
              status:
                type: string
                enum:
                  - queued
                  - processing
                  - completed
                  - failed
    WatermarkV1UploadFile:
      type: object
      required:
        - fileId
        - uploadUrl
      properties:
        fileId:
          type: string
          description: 入力ファイル ID
        uploadUrl:
          type: string
          format: uri
          nullable: true
          description: >
            ファイルアップロード用の presigned `PUT` URL(900 秒有効)。注文の `status` が `pending`
            で保管期限前、かつアップロード待ちのファイルにだけ発行します。

            `originalFileUrl` で指定したファイル、アップロード済みのファイル、12 時間のアップロード期限を過ぎて
            `failed` になった注文、保管期限を過ぎた注文は `null` です。
    WatermarkV1Output:
      type: object
      required:
        - fileId
        - inputFileId
        - outputIndex
        - watermarkText
        - status
        - mediaKind
      properties:
        fileId:
          type: string
          description: '`{inputFileId}-{連番}` 形式の結果ファイル ID(`outputs[].fileId`)'
        inputFileId:
          type: string
          description: この結果を作成した入力ファイル ID
        outputIndex:
          type: integer
          minimum: 0
          description: 入力ファイルの `watermarks` 内でのテキストの位置
        watermarkText:
          type: string
          description: 埋め込んだ watermark テキスト
        status:
          type: string
          enum:
            - pending
            - queued
            - processing
            - completed
            - failed
            - retry_required
          description: この結果ファイルの処理ステータス
        mediaKind:
          type: string
          enum:
            - image
            - pdf
    WatermarkV1DetectionResult:
      type: object
      nullable: true
      description: 抽出結果の概要。埋め込み注文と、結果が出る前は `null` で、以下のフィールドだけを含みます
      required:
        - detectionStatus
        - reportSupported
        - watermarkText
      additionalProperties: false
      properties:
        detectionStatus:
          type: string
          enum:
            - detected
            - not_detected
            - inconclusive
            - unsupported
            - error
          description: |
            * `detected` - watermark を検出
            * `not_detected` - 最後まで検査したが watermark なし
            * `inconclusive` - 候補はあるが確信度の基準に満たず判定不可
            * `unsupported` - 処理できない入力 (クレジット返金)
            * `error` - 検出処理の失敗。watermark なしとは異なる (クレジット返金)
        reportSupported:
          type: boolean
          description: この結果からレポートを作成できるかどうか。PDF からキャプチャした画像は `false`
        watermarkText:
          type: string
          nullable: true
          description: >
            検出された watermark の埋め込みテキスト。`detectionStatus` が `detected`
            で、呼び出し元のアカウントが埋め込み、発行記録がちょうど 1 件のときだけ返します。

            別のアカウントが埋め込んだ watermark など、それ以外は `null` です。
  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
    InternalError:
      description: 内部サーバーエラー
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: SERVER_INTERNAL_ERROR
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        外部クライアントアクセス用のBearer APIキー。本番キーは `sk_` プレフィックスを使用し、テストキーは `sk_test_`
        プレフィックスを使用して、処理やクレジット消費なしに注文ライフサイクルを検証します。

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.