カスタムテンプレート API

November 27, 2026

カスタムテンプレート API

編集設定をテンプレートとして保存し、AI クリッピング または クリップ書き出し に custom_template_id を渡すと、設定一式を一度に適用できます。

テンプレートには、画角とレイアウト、字幕スタイル、絵文字、B-roll、AI Hook、音声強調、フィラー語の除去、無音の除去、イントロ、アウトロ、ロゴを含められます。

テンプレートは、ウェブサイトの My Template と同じデータです。ウェブサイトで作ったテンプレートはここで一覧でき、ここで作ったテンプレートはウェブサイトにも表示されます。

プランの上限

プラン保存できるテンプレート数
Free利用不可
Starter1
Pro3
Scale10。2 件以上購入すると上限は 20 になります。

ロゴ、イントロ、アウトロのアップロードにも有料プランが必要で、ストレージ容量を使います。サブスクリプションプランを参照してください。

手順

  1. テンプレートにロゴ、イントロ、アウトロが必要なときだけ素材をアップロードします。字幕、画角、その他の設定にはアップロードは不要です。
  2. テンプレートを作成します。ロゴ、イントロ、アウトロの位置は、指定した配置からプラットフォームが決めます。座標は送らないでください。
  3. 現在の設定が必要なときは、テンプレートを一覧または取得します。
  4. POST /api/v2/clips または POST /api/v2/clips/export に custom_template_id を渡して適用します。
  5. 更新はテンプレート全体を置き換えます。リクエストにない機能は削除されます。先に現在のテンプレートを読み、編集した全体を送信してください。
  6. 不要になったテンプレートを削除します。

エンドポイント

メソッドパス説明
POST/api/v2/upload/single-fileロゴ、イントロ、アウトロのアップロード URL を取得
POST/api/v2/upload/statusファイルが使えるまでポーリング
POST/api/v2/custom-templatesテンプレートを作成
GET/api/v2/custom-templatesテンプレート一覧
GET/api/v2/custom-templates/{id}テンプレートを 1 件取得
PUT/api/v2/custom-templates/{id}テンプレートを置き換え
DELETE/api/v2/custom-templates/{id}テンプレートを削除

すべてのリクエストに次のヘッダーが必要です。

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
x-wayinvideo-api-version: v2

GET と DELETE に Content-Type は不要です。


ロゴ、イントロ、アウトロをアップロード

署名付き URL を取得し、その URL にファイルを PUT してから、status が DONE になるまでポーリングします。返却された identity をテンプレートの resource.identify に入れます。

ロゴ、イントロ、アウトロを使わないテンプレートでは、この手順を省略します。通常の動画アップロードは アップロード API を参照してください。

POST https://wayinvideo-api.wayin.ai/api/v2/upload/single-file

リクエストボディ

パラメータ型必須説明
namestringはい拡張子付きのファイル名。拡張子で形式を確認します。
sizeintegerいいえファイルサイズ(バイト)。サイズ上限とストレージ枠の確認に使います。
resource_typestringテンプレート素材では必須ファイルの用途。下表を参照。省略すると通常の動画として扱われ、テンプレートでは使えません。
resource_type用途形式サイズ上限長さの上限
BRAND_KIT_LOGOlogo.jpg、.jpeg、.png、.webp10 MB—
BRAND_KIT_VIDEOintro、outro.mp4、.mov、.webm、.avi5 GB60 分

リクエスト例

curl -X POST https://wayinvideo-api.wayin.ai/api/v2/upload/single-file \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-wayinvideo-api-version: v2" \
  -d '{
    "name": "brand-logo.png",
    "size": 204800,
    "resource_type": "BRAND_KIT_LOGO"
  }'

レスポンス

{
  "data": {
    "upload_url": "https://storage.example.com/upload/presigned-url...",
    "identity": "EF_up_06wguq1afbwg1"
  }
}
フィールド型説明
upload_urlstring署名付きアップロード URL。期限があるため、取得後すぐにアップロードしてください。
identitystringファイル ID。テンプレートの作成または更新時に resource.identify へ入れます。

ファイルをアップロード

curl -X PUT "https://storage.example.com/upload/presigned-url..." \
  --upload-file ./brand-logo.png

HTTP 200 はファイルを受け取ったことを示します。その後プラットフォームが処理します。処理が終わるまでステータスをポーリングしてください。

アップロード状態を確認

3〜5 秒ごとにポーリングし、status が DONE または ERROR になるまで待ちます。テンプレートに使えるのは status が DONE のファイルだけです。

POST https://wayinvideo-api.wayin.ai/api/v2/upload/status
パラメータ型必須説明
identifystringはいアップロード URL のリクエストが返した identity。
curl -X POST https://wayinvideo-api.wayin.ai/api/v2/upload/status \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-wayinvideo-api-version: v2" \
  -d '{
    "identify": "EF_up_06wguq1afbwg1"
  }'
{
  "data": {
    "status": "DONE",
    "file_name": "brand-logo.png",
    "url": "https://cdn.example.com/user/brand-logo.png"
  }
}
フィールド型説明
statusstringSTART:ファイルが届いていません。PUT が成功したか確認してください。UPLOADED:ファイルは届き、処理中です。DONE:使用できます。ERROR:処理に失敗しました。再アップロードしてください。
file_namestringファイル名。
urlstringファイル URL。

テンプレートを作成

POST https://wayinvideo-api.wayin.ai/api/v2/custom-templates

リクエストボディ

パラメータ型必須説明
namestringはいテンプレート名。空にはできません。
configobjectはい保存する機能。各キーが 1 つの機能です。設定フィールドを参照。{} は可、null は不可。他の機能を送る場合は reframe が必須です。

config にある機能は、適用時に AI クリッピング の対応するパラメータを上書きします。config にない機能は、そのクリッピングまたは書き出しリクエストの値を使います。

リクエスト例

curl -X POST https://wayinvideo-api.wayin.ai/api/v2/custom-templates \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-wayinvideo-api-version: v2" \
  -d '{
    "name": "Brand A - Shorts",
    "config": {
      "reframe": {
        "ratio": "RATIO_9_16",
        "layout_type": "Fit",
        "auto_reframe": true
      },
      "caption_style": {
        "mode": "on",
        "template_id": "word-focus"
      },
      "emoji": { "operation": "add" },
      "broll": {
        "operation": "add",
        "resource_type": "RESOURCE_VIDEO_STOCK_BROLL"
      },
      "ai_hook": {
        "operation": "add",
        "template_id": "preset-1",
        "script_style": "casual",
        "position": "beginning"
      },
      "speech_enhance": { "operation": "clean" },
      "remove_filter": { "operation": "remove" },
      "remove_silence": {
        "operation": "remove",
        "silence_duration_ms": 500
      },
      "intro": {
        "operation": "add",
        "resource": { "identify": "EF_up_06wgintro0001" }
      },
      "outro": {
        "operation": "add",
        "resource": { "identify": "EF_up_06wgoutro0001" }
      },
      "logo": {
        "operation": "add",
        "items": [
          {
            "resource": { "identify": "EF_up_06wguq1afbwg1" },
            "position": "top_right"
          }
        ]
      }
    }
  }'

レスポンス

保存されたテンプレートです。形は テンプレートを取得 と同じです。

{
  "data": {
    "id": "uctmpl06yf2m0m1b0pv",
    "name": "Brand A - Shorts",
    "config": {
      "reframe": {
        "ratio": "RATIO_9_16",
        "layout_type": "Fit",
        "auto_reframe": true
      }
    },
    "created": 1764057600000,
    "last_modified": 1764057600000
  }
}

テンプレート一覧

現在のアカウントまたはワークスペースのテンプレートを、新しい順に返します。テンプレートがないとき data は [] です。

GET https://wayinvideo-api.wayin.ai/api/v2/custom-templates

リクエスト例

curl -X GET https://wayinvideo-api.wayin.ai/api/v2/custom-templates \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-wayinvideo-api-version: v2"

レスポンス例

{
  "data": [
    {
      "id": "uctmpl06yf2m0m1b0pv",
      "name": "Brand A - Shorts",
      "config": {
        "reframe": {
          "ratio": "RATIO_9_16",
          "layout_type": "Fit",
          "auto_reframe": true
        }
      },
      "created": 1764057600000,
      "last_modified": 1764144000000
    }
  ]
}
フィールド型説明
idstringテンプレート ID。uctmpl で始まります。
namestringテンプレート名。
configobject保存された設定。テンプレートを取得を参照。
createdinteger作成時刻。ミリ秒の Unix タイムスタンプ。
last_modifiedinteger最終更新時刻。ミリ秒の Unix タイムスタンプ。

テンプレートを取得

GET https://wayinvideo-api.wayin.ai/api/v2/custom-templates/{id}

パスパラメータ

パラメータ型必須説明
idstringはい作成または一覧で返ったテンプレート ID。

リクエスト例

curl -X GET https://wayinvideo-api.wayin.ai/api/v2/custom-templates/uctmpl06yf2m0m1b0pv \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-wayinvideo-api-version: v2"

レスポンス例

{
  "data": {
    "id": "uctmpl06yf2m0m1b0pv",
    "name": "Brand A - Shorts",
    "config": {
      "reframe": {
        "ratio": "RATIO_9_16",
        "layout_type": "Fit",
        "auto_reframe": true
      },
      "caption_style": {
        "mode": "on",
        "template_id": "word-focus"
      },
      "intro": {
        "operation": "add",
        "resource": {
          "identify": "EF_up_06wgintro0001",
          "url": "https://cdn.example.com/user/intro.mp4",
          "name": "intro"
        }
      },
      "logo": {
        "operation": "add",
        "items": [
          {
            "resource": {
              "identify": "EF_up_06wguq1afbwg1",
              "url": "https://cdn.example.com/user/brand-logo.png",
              "name": "brand-logo"
            },
            "position": "top_right"
          }
        ]
      }
    },
    "created": 1764057600000,
    "last_modified": 1764144000000
  }
}
フィールド型説明
idstringテンプレート ID。
namestringテンプレート名。
configobjectテンプレート設定。このページのフィールド以外に、transform、operation、extra などの内部フィールドが含まれることがあります。更新時はそのまま戻せます。戻した transform はそのまま再利用されます。ロゴ項目に position もある場合、その項目の transform は捨てられ、position から配置が作り直されます。素材オブジェクトには url と name が付くことがあります。プラットフォームが読むのは identify だけです。
createdinteger作成時刻。ミリ秒の Unix タイムスタンプ。
last_modifiedinteger最終更新時刻。ミリ秒の Unix タイムスタンプ。

ウェブサイトでドラッグして置いたロゴには position がありません。その項目にあるのは transform だけです。そのまま戻すと配置は維持されます。position を足すと、新しい位置に置き直されます。


テンプレートを更新

テンプレート全体の name と config を置き換えます。config にない機能は削除されます。部分更新ではありません。ロゴ、イントロ、アウトロの配置は新しい設定から再計算されます。

テンプレートを取得 で現在のオブジェクトを読み、編集してから完全なボディを送信してください。

PUT https://wayinvideo-api.wayin.ai/api/v2/custom-templates/{id}

ボディは テンプレートを作成 と同じです。name と config はどちらも必須です。

リクエスト例

この例は画角、字幕、ロゴを残し、ロゴを右下へ移します。以前保存されていたイントロはこのボディにないため削除されます。

curl -X PUT https://wayinvideo-api.wayin.ai/api/v2/custom-templates/uctmpl06yf2m0m1b0pv \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-wayinvideo-api-version: v2" \
  -d '{
    "name": "Brand A - Shorts v2",
    "config": {
      "reframe": {
        "ratio": "RATIO_9_16",
        "layout_type": "Fit",
        "auto_reframe": true
      },
      "caption_style": {
        "mode": "on",
        "template_id": "word-focus"
      },
      "logo": {
        "operation": "add",
        "items": [
          {
            "resource": { "identify": "EF_up_06wguq1afbwg1" },
            "position": "bottom_right"
          }
        ]
      }
    }
  }'

レスポンス

更新後のテンプレートです。形は テンプレートを取得 と同じです。


テンプレートを削除

DELETE https://wayinvideo-api.wayin.ai/api/v2/custom-templates/{id}

削除は取り消せません。この ID で後から取得または適用すると、テンプレートが存在しないため失敗します。すでにこのテンプレートで生成または書き出したクリップは変わりません。テンプレートが参照するファイルは削除されません。

リクエスト例

curl -X DELETE https://wayinvideo-api.wayin.ai/api/v2/custom-templates/uctmpl06yf2m0m1b0pv \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-wayinvideo-api-version: v2"

レスポンス

{
  "data": null
}

テンプレートを適用

JSON ボディに custom_template_id を追加します。

AI クリッピング では、enable_export が true のときだけ custom_template_id が使われます。クリップ書き出し では、書き出しリクエスト自体がレンダリングなので、ID を送れば適用されます。

{
  "video_url": "https://www.youtube.com/watch?v=example",
  "target_lang": "en",
  "enable_export": true,
  "custom_template_id": "uctmpl06yf2m0m1b0pv"
}
場合結果
テンプレートとリクエストが同じ機能を設定しているテンプレートが優先されます。たとえばテンプレートの caption_style は、リクエストの cc_style_tpl を上書きします。
リクエストが、テンプレートにない機能を設定しているリクエストの値が使われます。
テンプレートが、リクエストにない機能を設定しているテンプレートの値が使われます。

テンプレートはタスク送信時に読み取られます。その後の編集や削除は、すでに送信されたタスクには影響しません。


設定フィールド

各キーは 1 つの機能です。保存しない機能は書かないでください。reframe は必須です。

reframe

フィールド型必須説明
ratiostringはいRATIO_16_9、RATIO_1_1、RATIO_4_5、RATIO_9_16。
layout_typestringはいレイアウト。許可される値は ratio によって変わります。空白を含めて名前を正確に送ってください。
auto_reframebooleanいいえAI による被写体追従を有効にします。
ratio許可される layout_type
RATIO_16_9Auto、Full、Fit、Grid 4、Split 2、Trio、PiP、OTS、Screen First
RATIO_9_16Auto、Full、Fit、Grid 4、Split 2、Trio、PiP、Screen First、Gameplay A、Gameplay B
RATIO_4_5Auto、Full、Fit、Grid 4、Split 2、Trio、PiP、Screen First、Gameplay A、Gameplay B
RATIO_1_1Auto、Full、Fit、Grid 4、Trio

caption_style

フィールド型必須説明
modestringはいon は字幕を表示します。off は字幕を隠し、inherit は字幕をクリッピングまたは書き出しリクエストに任せます。
template_idstringmode が on のとき必須システムテンプレート ID。字幕スタイルを参照。

emoji

フィールド型必須説明
operationstringはいadd は絵文字を自動で入れます。remove は絵文字を入れません。

broll

フィールド型必須説明
operationstringはいadd は B-roll を入れます。remove は B-roll を入れず、書き出し時に既存の B-roll も外します。
resource_typestringいいえRESOURCE_VIDEO_AI_BROLL は AI 生成です。RESOURCE_VIDEO_STOCK_BROLL はストック素材です。

ai_hook

フィールド型必須説明
operationstringはいadd は AI Hook を入れます。remove は入れず、書き出し時に既存の Hook も外します。remove のときは他のフィールドは不要です。
template_idstringoperation が add のとき必須システムテンプレート ID。フックテキストスタイルを参照。
script_stylestringいいえ文案のスタイル。既定値は serious。指定できる値:serious、casual、informative、conversational、humorous、parody、inspirational、dramatic、empathetic、persuasive、neutral、excited、calm。
positionstringいいえbeginning または end。既定値は beginning。
keywordsstringいいえHook が沿うキーワード。
text_durationintegerいいえHook の文字を画面に出す時間(ミリ秒)。

speech_enhance

フィールド型必須説明
operationstringはいclean は音声強調とノイズ低減を有効にします。restore は元の音声を残します。

remove_filter

フィールド型必須説明
operationstringはいremove は "um" や "uh" などのフィラーを切ります。restore は残します。

remove_silence

フィールド型必須説明
operationstringはいremove は無音区間を切ります。restore は残します。
silence_duration_msintegerいいえ切る無音の最短時間(ミリ秒)。既定値は 500。

intro と outro

両方のオブジェクトは同じフィールドです。イントロは各クリップの先頭、アウトロは末尾に付き、テンプレートの画角に合わせて配置されます。

フィールド型必須説明
operationstringはいadd は素材を入れます。remove は適用時に既存のイントロまたはアウトロを外します。remove のときは他のフィールドは不要です。
resource.identifystringoperation が add のとき必須アップロードで返った identity。アップロード時の resource_type は BRAND_KIT_VIDEO である必要があります。
フィールド型必須説明
operationstringはいadd はロゴを入れます。remove は適用時に既存のロゴを外します。remove のとき items は不要です。
itemsarrayoperation が add のとき必須ロゴの一覧。1 件以上。
items[].resource.identifystringoperation が add のとき必須アップロードで返った identity。アップロード時の resource_type は BRAND_KIT_LOGO である必要があります。
items[].positionstringはいtop_left、top_right、center、bottom_left、bottom_right。更新時に詳細の transform を戻す場合、position は省略でき、以前の配置が維持されます。position を送るとロゴは置き直されます。

ロゴのサイズと余白はプラットフォームの既定値です。