{"openapi":"3.1.0","info":{"title":"OKAERI Public API","version":"v1","description":"OKAERI の公開API（v1）。管理画面と同じ `/api/v1` の同じハンドラを APIキーで叩く。\n\n- 認証は `Authorization: Bearer okr_live_…`（クエリ文字列でのキーは受け付けない）\n- 各操作に必要なスコープは `x-okaeri-scopes`。不足は 403 `permission_error` / `scope_insufficient`\n- 連絡先（電話・メール）は常にマスクして返す（`090-****-1234` / `us***@example.com`）\n- エラーは単一形式 `{\"error\": {\"type\", \"code\", \"message\", \"param\", \"request_id\"}}`\n- 日時は ISO 8601・UTC・`Z` 付き。一覧は cursor 方式（`limit` 最大200・`next_cursor`）\n- POST は `Idempotency-Key` ヘッダで再送を1回にまとめられる（24時間）\n- 応答ヘッダ `X-RateLimit-Limit` / `X-RateLimit-Remaining` / `X-RateLimit-Reset`\n  （UNIX 秒＝次に1枠空く時刻）を常に返す。429 は レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する\n- `enum` を持つ項目の値は今後増えることがある（増やすのは非破壊の変更として扱う）。\n  未知の値を受けても処理が止まらないように実装する（表示は「その他」等にまとめる）\n- エラーは `type` と `code` で分岐する（HTTP ステータスだけで分岐しない）。各操作の `responses` に\n  401 / 403 / 404 / 409 / 422 / 429 / 5xx のうち起こりうるものを載せている\n- **テストキー（`okr_test_…`）の書き込み（POST / PUT / PATCH / DELETE）はドライラン**。\n  検証・上限判定・エラー応答は本番キーと同じに行い、応答も同じ形で返すが、**何も保存しない**\n  （監査ログ・`Idempotency-Key` の記録も残らない）。外部への反映（タグ設定の配信等）もしない。\n  応答ヘッダ `OKAERI-Dry-Run: true` が付く。作成の応答に含まれる `id` は仮の値で、\n  その資源は存在しない（続けて取得・更新すると 404）。読み取りはテストキーでも本番データを返す。\n  レート制限はテストキーの要求も同じ枠で数える\n- **APIキーでできないのは状態変更とテスト送信だけで、それ以外は管理画面と同じ**。\n  キャンペーン・シナリオの `status` の変更（有効化・停止・アーカイブ）は 403 `session_required`\n  （管理画面で行う）。キャンペーンは APIキーで作ると必ず `paused`（`status` は省略か `paused`。\n  それ以外は 422 `api_key_draft_only`）、シナリオは必ず `draft`（`status` は省略か `draft`。\n  それ以外は 422 `api_key_draft_only`）。一度も稼働していない `paused` のキャンペーン（下書き）は\n  タグに配られない（収集もしない）。稼働中・停止中のキャンペーン（URL ルール・フォーム項目を\n  含む）・シナリオ（ステップを含む）・文面の編集と削除は、管理画面と同じ検証・結果になる\n  （稼働中のシナリオの削除や使用中の文面の削除は 409 など）。テスト送信（`POST /test_sends`）と\n  メール本文 HTML の直接入力（`body_html`）は APIキーでは使えない\n- キャンペーンの作成・更新・URL ルールの置換の応答には `warnings`（配列・既定は空）が付く。\n  保存で、稼働中（`active`）のキャンペーンが直近30日に担当していたページを別のキャンペーンの\n  URL ルールが奪うようになった時（横取り）に `code: url_takeover` を載せる（奪われた側・奪った側・\n  件数・ページの例・奪ったルール）。**保存は止めない**（成立している）。owner・admin にメールで\n  通知し監査ログに残す。テストキーのドライランでも `warnings` は同じに返す（メールは送らない）\n- 除外リストは一覧・1件登録・削除まで。本人の配信停止（`opt_out`）・苦情（`complaint`）由来の\n  除外は削除できない（409 `suppression_not_deletable`）。CSV 一括登録は管理画面だけ\n- `POST /messages/estimate`（SMS の文字数・課金通数の見積）は保存しない読み取り扱い\n  （`messages:read`）。POST なのでテストキーでは `OKAERI-Dry-Run: true` が付く\n- Outbound Webhook の送信先（`/webhook_endpoints`）は `webhooks:write` で一覧・作成・取得・削除・\n  送信ログの閲覧（`/{id}/deliveries`・新しい順・cursor）・再送\n  （`POST /webhook_deliveries/{id}/redeliver`・202＝同じ payload で積み直す・停止中の送信先は\n  409 `webhook_endpoint_disabled`）。\n  **署名鍵 `secret`（`whsec_…`）は作成の応答にだけ載り、再表示できない**（一覧・取得には出ない）。\n  URL は https のみ（内部宛は 422 `invalid_webhook_url`）・イベントは定義済みのものだけ\n  （422 `unknown_event`）。送信先の本数はプラン上限（超過・Free は 403 `plan_limit_exceeded`）。\n  送られる本文に連絡先は含まない（ID・件数・状態だけ）。テストキーで作成した送信先は保存されない\n  （応答の `id`・`secret` は使い捨て）。送られる本文の形・受け方・署名の検証手順は\n  スキーマ `WebhookEvent` に書いている\n\nここに載っていないエンドポイント（`/api/v1/admin/**`・`/api/v1/views/**` を含む）は契約外。\n","termsOfService":"https://okaeri.tech/terms/","contact":{"name":"OKAERI（株式会社OTEGAMI）","url":"https://okaeri.tech/contact/"},"x-logo":{"url":"https://okaeri.tech/favicon.svg","altText":"OKAERI"}},"servers":[{"url":"https://api.okaeri.tech","description":"本番"}],"externalDocs":{"description":"開発者向けドキュメント","url":"https://okaeri.tech/developers/"},"paths":{"/api/v1/sites":{"get":{"tags":["sites"],"summary":"サイトの一覧","operationId":"listSites","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteListOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["sites:read"],"security":[{"apiKey":[]}]}},"/api/v1/sites/{site_id}":{"get":{"tags":["sites"],"summary":"サイトの取得（設置コードつき）","operationId":"getSite","parameters":[{"name":"site_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Site Id"}},{"name":"nonce","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Nonce"},"description":"`true` にすると、設置コード（`snippets`）の `<script>` に `nonce=\"__CSP_NONCE__\"` を付けて返す。自サイトの CSP（`script-src 'nonce-…'`）でタグを許可する時に使う。`__CSP_NONCE__` は自サイトがリクエストごとに発行する nonce の値へ置き換えて出力する（固定値にすると CSP が効かない）"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteDetailOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["sites:read"],"security":[{"apiKey":[]}]}},"/api/v1/sites/{site_id}/url-rules/test":{"post":{"tags":["sites"],"summary":"URL がどのキャンペーンに当たるかのテスト","description":"URL のマッチテスト。**評価するのは配信中のタグ設定そのもの**。\n\nタグが実際に使う設定と同じ判定で、どのキャンペーンのどの役割に当たるかを返す（書き込みなし）。","operationId":"testSiteUrlRules","parameters":[{"name":"site_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Site Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchTestIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchTestOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"状態の衝突（`invalid_request`）。`idempotency_key_in_progress`（同じ `Idempotency-Key` の要求が処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["campaigns:read"],"security":[{"apiKey":[]}]}},"/api/v1/sites/{site_id}/tag-config":{"get":{"tags":["sites"],"summary":"タグに配る設定の取得","operationId":"getSiteTagConfig","parameters":[{"name":"site_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Site Id"}}],"responses":{"200":{"description":"タグに配る設定。画面表示用。形は契約外（予告なく変わる）＝この中の項目に依存した処理を組まない","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"GetSiteTagConfigResponse","description":"画面表示用。形は契約外（予告なく変わる）＝この中の項目に依存した処理を組まない"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["sites:read"],"security":[{"apiKey":[]}]}},"/api/v1/sites/{site_id}/pp-checks":{"get":{"tags":["sites"],"summary":"プライバシーポリシー確認の結果の一覧","operationId":"listSitePpChecks","parameters":[{"name":"site_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Site Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":20,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PpCheckListOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["sites:read"],"security":[{"apiKey":[]}]}},"/api/v1/sites/{site_id}/pp-checks/{check_id}":{"get":{"tags":["sites"],"summary":"プライバシーポリシー確認の結果の取得","operationId":"getSitePpCheck","parameters":[{"name":"site_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Site Id"}},{"name":"check_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Check Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PpCheckOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["sites:read"],"security":[{"apiKey":[]}]}},"/api/v1/consent_settings":{"get":{"tags":["consent_settings"],"summary":"同意の設定の取得","operationId":"getConsentSettings","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentSettingsOut"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["sites:read"],"security":[{"apiKey":[]}]}},"/api/v1/campaigns":{"get":{"tags":["campaigns"],"summary":"キャンペーンの一覧","operationId":"listCampaigns","parameters":[{"name":"site_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Site Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["active","paused","archived"]},{"type":"null"}],"title":"Status"},"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignListOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["campaigns:read"],"security":[{"apiKey":[]}]},"post":{"tags":["campaigns"],"summary":"キャンペーンの作成","description":"作った時点でサイトの設置コードに並ぶ（サイト詳細がキャンペーン別のコードを出す）。","operationId":"createCampaign","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignDetailOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`site_id` のサイトが見つからない（`not_found`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"状態の衝突（`invalid_request`）。`campaign_key_taken`（同じ `key` のキャンペーンがある）／`idempotency_key_in_progress`（同じ `Idempotency-Key` の要求が処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["campaigns:write"],"security":[{"apiKey":[]}]}},"/api/v1/campaigns/{campaign_id}":{"get":{"tags":["campaigns"],"summary":"キャンペーンの取得","operationId":"getCampaign","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignDetailOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["campaigns:read"],"security":[{"apiKey":[]}]},"patch":{"tags":["campaigns"],"summary":"キャンペーンの更新","operationId":"updateCampaign","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignDetailOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["campaigns:write"],"security":[{"apiKey":[]}]}},"/api/v1/campaigns/{campaign_id}/url-rules":{"put":{"tags":["campaigns"],"summary":"キャンペーンの URL ルールの置き換え","description":"一括置換。**1件でも不正なら 422 で全体を保存しない**。","operationId":"replaceCampaignUrlRules","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UrlRulesIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignDetailOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["campaigns:write"],"security":[{"apiKey":[]}]}},"/api/v1/campaigns/{campaign_id}/form-profile":{"put":{"tags":["campaigns"],"summary":"キャンペーンのフォーム項目の置き換え","description":"フォーム項目の手動セレクタ。**空配列を送ると自動検出へ戻る**。","operationId":"replaceCampaignFormProfile","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormProfileIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignDetailOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["campaigns:write"],"security":[{"apiKey":[]}]}},"/api/v1/campaigns/{campaign_id}/duplicate":{"post":{"tags":["campaigns"],"summary":"キャンペーンの複製","description":"複製。**必ず一度も稼働していない停止中（タグ設定に載らない）で作る**。\n\n配下のシナリオ（下書きで）とメッセージ（実体コピー）も作る＝3つの書き込みスコープが要る。","operationId":"duplicateCampaign","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignDuplicateIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignDetailOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"状態の衝突（`invalid_request`）。`campaign_key_taken`（同じ `key` のキャンペーンがある）／`idempotency_key_in_progress`（同じ `Idempotency-Key` の要求が処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["campaigns:write","messages:write","scenarios:write"],"security":[{"apiKey":[]}]}},"/api/v1/campaigns/{campaign_id}/scenarios":{"get":{"tags":["scenarios"],"summary":"キャンペーンのシナリオの一覧","operationId":"listCampaignScenarios","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioListOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["scenarios:read"],"security":[{"apiKey":[]}]},"post":{"tags":["scenarios"],"summary":"シナリオの作成","operationId":"createCampaignScenario","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"状態の衝突（`invalid_request`）。`idempotency_key_in_progress`（同じ `Idempotency-Key` の要求が処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["scenarios:write"],"security":[{"apiKey":[]}]}},"/api/v1/scenarios/{scenario_id}":{"get":{"tags":["scenarios"],"summary":"シナリオの取得","operationId":"getScenario","parameters":[{"name":"scenario_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Scenario Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["scenarios:read"],"security":[{"apiKey":[]}]},"patch":{"tags":["scenarios"],"summary":"シナリオの更新","description":"`status: active` は検証を全部通った時だけ（理由は 422 の message・先頭の param）。","operationId":"updateScenario","parameters":[{"name":"scenario_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Scenario Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["scenarios:write"],"security":[{"apiKey":[]}]},"delete":{"tags":["scenarios"],"summary":"シナリオの削除","operationId":"deleteScenario","parameters":[{"name":"scenario_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Scenario Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"状態の衝突（`invalid_request`）。`scenario_active`（稼働中のシナリオ）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["scenarios:write"],"security":[{"apiKey":[]}]}},"/api/v1/scenarios/{scenario_id}/steps":{"put":{"tags":["scenarios"],"summary":"シナリオのステップの置き換え","description":"一括置換。**1件でも不正なら 422 で全体を保存しない**。","operationId":"replaceScenarioSteps","parameters":[{"name":"scenario_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Scenario Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StepsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["scenarios:write"],"security":[{"apiKey":[]}]}},"/api/v1/scenario_presets":{"get":{"tags":["scenarios"],"summary":"シナリオのテンプレートの一覧","description":"`available` はテナントの実効上限（1シナリオのステップ数）で決まる。","operationId":"listScenarioPresets","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioPresetListOut"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["scenarios:read"],"security":[{"apiKey":[]}]}},"/api/v1/campaigns/{campaign_id}/scenarios/from_preset":{"post":{"tags":["scenarios"],"summary":"テンプレートからシナリオを作成","description":"メッセージも作る＝`messages:write` も要る。上限超過は 403・途中で失敗したら何も残さない。","operationId":"createCampaignScenarioFromPreset","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FromPresetIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"状態の衝突（`invalid_request`）。`idempotency_key_in_progress`（同じ `Idempotency-Key` の要求が処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["messages:write","scenarios:write"],"security":[{"apiKey":[]}]}},"/api/v1/scenarios/{scenario_id}/duplicate":{"post":{"tags":["scenarios"],"summary":"シナリオの複製","description":"複製。**必ず draft で作る**。メッセージも実体コピー＝`messages:write` も要る。\n\n他キャンペーン（同じテナント）へも複製できる。他テナントの指定は 404。","operationId":"duplicateScenario","parameters":[{"name":"scenario_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Scenario Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioDuplicateIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"状態の衝突（`invalid_request`）。`idempotency_key_in_progress`（同じ `Idempotency-Key` の要求が処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["messages:write","scenarios:write"],"security":[{"apiKey":[]}]}},"/api/v1/messages":{"get":{"tags":["messages"],"summary":"文面の一覧","operationId":"listMessages","parameters":[{"name":"channel","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["sms","email"]},{"type":"null"}],"title":"Channel"},"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageListOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["messages:read"],"security":[{"apiKey":[]}]},"post":{"tags":["messages"],"summary":"文面の作成","operationId":"createMessage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"状態の衝突（`invalid_request`）。`idempotency_key_in_progress`（同じ `Idempotency-Key` の要求が処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["messages:write"],"security":[{"apiKey":[]}]}},"/api/v1/messages/{message_id}":{"get":{"tags":["messages"],"summary":"文面の取得","operationId":"getMessage","parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["messages:read"],"security":[{"apiKey":[]}]},"patch":{"tags":["messages"],"summary":"文面の更新","operationId":"updateMessage","parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagePatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["messages:write"],"security":[{"apiKey":[]}]},"delete":{"tags":["messages"],"summary":"文面の削除","operationId":"deleteMessage","parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"状態の衝突（`invalid_request`）。`message_in_use`（ステップが使っている文面）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["messages:write"],"security":[{"apiKey":[]}]}},"/api/v1/messages/{message_id}/duplicate":{"post":{"tags":["messages"],"summary":"文面の複製","description":"複製（実体コピー）。作成と同じ検証・権限（`body_html` の直書きは owner / admin だけ）。","operationId":"duplicateMessage","parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"状態の衝突（`invalid_request`）。`idempotency_key_in_progress`（同じ `Idempotency-Key` の要求が処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["messages:write"],"security":[{"apiKey":[]}]}},"/api/v1/message_variables":{"get":{"tags":["messages"],"summary":"文面で使える変数の一覧","operationId":"listMessageVariables","parameters":[{"name":"campaign_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageVariablesOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`campaign_id` のキャンペーンが見つからない（`not_found`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["messages:read"],"security":[{"apiKey":[]}]}},"/api/v1/message_examples":{"get":{"tags":["messages"],"summary":"文面の例文の一覧","description":"全プランで使える。プランの上限（1シナリオのステップ数）は、作った文面をステップに置く時に見る。\n\nSMS の【ショップ名】は置き場。店名に書き換えないままでは、そのシナリオを有効化できない。","operationId":"listMessageExamples","parameters":[{"name":"channel","in":"query","required":false,"schema":{"anyOf":[{"enum":["sms","email"],"type":"string"},{"type":"null"}],"title":"Channel"},"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageExampleListOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["messages:read"],"security":[{"apiKey":[]}]}},"/api/v1/message_previews":{"post":{"tags":["messages"],"summary":"文面のプレビュー","operationId":"previewMessage","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagePreviewIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagePreviewOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`campaign_id` のキャンペーンが見つからない（`not_found`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"状態の衝突（`invalid_request`）。`idempotency_key_in_progress`（同じ `Idempotency-Key` の要求が処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["messages:read"],"security":[{"apiKey":[]}]}},"/api/v1/messages/estimate":{"post":{"tags":["messages"],"summary":"SMS の文字数と課金通数の見積","description":"SMS 本文から文字数と課金通数の目安を返す。保存しない（読み取りスコープ `messages:read`）。数え方は文面の保存時に入る通数の目安（`sms_segments`）と同じ。\n\n- **目安である**：URL の変数は送信時と同じ長さで展開するが、**商品名（`{{product_name}}`）は字面（16文字）のまま数える**。実際の商品名の長さは使うキャンペーンで変わるので、送信時の通数とはずれうる（実績は配信の `segments`）\n- キャリアが分からないのでワーストケース（docomo の刻み）で数える\n- 本文が上限（URL 展開後で660文字）を超えると 422 `sms_body_too_long`\n- POST なのでテストキーでは `OKAERI-Dry-Run: true` が付くが、そもそも何も保存しない","operationId":"estimateSmsSegments","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsEstimateIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsEstimateOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"状態の衝突（`invalid_request`）。`idempotency_key_in_progress`（同じ `Idempotency-Key` の要求が処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["messages:read"],"security":[{"apiKey":[]}]}},"/api/v1/leads":{"get":{"tags":["leads"],"summary":"リードの一覧","operationId":"listLeads","parameters":[{"name":"site_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Site Id"}},{"name":"campaign_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Campaign Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["started","captured","abandoned","queued","sent","converted","suppressed"]},{"type":"null"}],"title":"Status"},"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},{"name":"date_field","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["created_at","captured_at","abandoned_at","converted_at"]},{"type":"null"}],"title":"Date Field"},"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadListOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["leads:read"],"security":[{"apiKey":[]}]}},"/api/v1/leads/{lead_id}":{"get":{"tags":["leads"],"summary":"リードの取得（流入元・時系列つき）","description":"1件の詳細。**通常の閲覧スコープ**＝連絡先はマスクのまま返す。","operationId":"getLead","parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Lead Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadDetailOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["leads:read"],"security":[{"apiKey":[]}]}},"/api/v1/deliveries":{"get":{"tags":["deliveries"],"summary":"配信の一覧","operationId":"listDeliveries","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["scheduled","sending","sent","delivered","failed","cancelled","suppressed"]},{"type":"null"}],"title":"Status"},"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},{"name":"campaign_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Campaign Id"}},{"name":"scenario_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Scenario Id"}},{"name":"date_field","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["created_at","scheduled_at","sent_at"]},{"type":"null"}],"title":"Date Field"},"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryListOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["deliveries:read"],"security":[{"apiKey":[]}]}},"/api/v1/deliveries/{delivery_id}":{"get":{"tags":["deliveries"],"summary":"配信の取得","operationId":"getDelivery","parameters":[{"name":"delivery_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Delivery Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["deliveries:read"],"security":[{"apiKey":[]}]}},"/api/v1/delivery_status":{"get":{"tags":["delivery_status"],"summary":"配信スイッチの状態の取得","operationId":"getDeliveryStatus","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryStatusOut"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["scenarios:read"],"security":[{"apiKey":[]}]}},"/api/v1/suppressions":{"get":{"tags":["suppressions"],"summary":"除外リストの一覧","operationId":"listSuppressions","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["email","tel"]},{"type":"null"}],"title":"Kind"},"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},{"name":"reason","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["opt_out","manual","bounce","complaint","undeliverable"]},{"type":"null"}],"title":"Reason"},"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},{"name":"scope","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["tenant","campaign"]},{"type":"null"}],"title":"Scope"},"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},{"name":"campaign_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Campaign Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuppressionListOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["suppressions:read"],"security":[{"apiKey":[]}]},"post":{"tags":["suppressions"],"summary":"除外リストへの登録（1件）","operationId":"createSuppression","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuppressionIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuppressionCreatedOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`campaign_id` のキャンペーンが見つからない（`not_found`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"状態の衝突（`invalid_request`）。`suppression_exists`（同じ範囲の有効な除外がある）／`idempotency_key_in_progress`（同じ `Idempotency-Key` の要求が処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["suppressions:write"],"security":[{"apiKey":[]}]}},"/api/v1/suppressions/{suppression_id}":{"delete":{"tags":["suppressions"],"summary":"除外リストからの削除","operationId":"deleteSuppression","parameters":[{"name":"suppression_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Suppression Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"状態の衝突（`invalid_request`）。`suppression_not_deletable`（本人の配信停止 `opt_out`・苦情 `complaint` 由来の除外）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["suppressions:write"],"security":[{"apiKey":[]}]}},"/api/v1/reports/funnel":{"get":{"tags":["reports"],"summary":"ファネルと指標のレポート","description":"期間は**半開区間 [from, to)**。日時はオフセット付き ISO 8601 のみ受け付ける。","operationId":"getFunnelReport","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","title":"From"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","title":"To"}},{"name":"site_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Site Id"}},{"name":"campaign_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Campaign Id"}},{"name":"group_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group By"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunnelReportOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["reports:read"],"security":[{"apiKey":[]}]}},"/api/v1/reports/daily":{"get":{"tags":["reports"],"summary":"日次推移のレポート","description":"期間は **JST の日付の半開区間 [from, to)**（`YYYY-MM-DD`）。","operationId":"getDailyReport","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","title":"From"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","title":"To"}},{"name":"site_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Site Id"}},{"name":"campaign_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Campaign Id"}},{"name":"scenario_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Scenario Id"}},{"name":"group_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group By"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyReportOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["reports:read"],"security":[{"apiKey":[]}]}},"/api/v1/webhook_endpoints":{"get":{"tags":["webhooks"],"summary":"Webhook 送信先の一覧","operationId":"listWebhookEndpoints","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointListOut"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["webhooks:write"],"security":[{"apiKey":[]}]},"post":{"tags":["webhooks"],"summary":"Webhook 送信先の作成","operationId":"createWebhookEndpoint","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreatedOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"状態の衝突（`invalid_request`）。`idempotency_key_in_progress`（同じ `Idempotency-Key` の要求が処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["webhooks:write"],"security":[{"apiKey":[]}]}},"/api/v1/webhook_endpoints/{endpoint_id}":{"get":{"tags":["webhooks"],"summary":"Webhook 送信先の取得","operationId":"getWebhookEndpoint","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["webhooks:write"],"security":[{"apiKey":[]}]},"delete":{"tags":["webhooks"],"summary":"Webhook 送信先の削除","operationId":"deleteWebhookEndpoint","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["webhooks:write"],"security":[{"apiKey":[]}]}},"/api/v1/webhook_endpoints/{endpoint_id}/deliveries":{"get":{"tags":["webhooks"],"summary":"Webhook の送信ログの一覧","operationId":"listWebhookEndpointDeliveries","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryListOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["webhooks:write"],"security":[{"apiKey":[]}]}},"/api/v1/webhook_deliveries/{delivery_id}/redeliver":{"post":{"tags":["webhooks"],"summary":"Webhook の再送","description":"同じ payload の送信を新しく積み直す（受け付けただけで送信は後から行うので 202）。\n\n応答は新しく積んだ送信記録（`status: pending`）。","operationId":"redeliverWebhookDelivery","parameters":[{"name":"delivery_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Delivery Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryOut"}}}},"422":{"description":"パラメータ不正（`invalid_request`）。`param` に対象の項目名、`message` に理由（日本語）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"APIキーが無効・失効（`authentication_error`）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"スコープ不足（`permission_error` / `scope_insufficient`）・プランの上限（`plan_limit_exceeded`）・APIキーではできない操作（`session_required` 等）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"サーバ側の失敗（`api_error`）。`request_id` を添えて問い合わせてください。時間をおいた再試行で解消することがある（POST は同じ `Idempotency-Key` を付けて再試行する）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"レート制限の超過（`rate_limit_error`）。上限はテナント単位（テナント内の全キーの合計）の直近60秒の回数で、プラン別に Free 60 / Starter 60 / Growth 300 / Pro 1,000 回。個別の設定がある場合は応答ヘッダ `X-RateLimit-Limit` の値が正。`Retry-After`（秒）の後に再試行する","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"対象が見つからない（`not_found`）。他のテナントの ID を指した時も同じ 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"状態の衝突（`invalid_request`）。`webhook_endpoint_disabled`（停止中の送信先）／`idempotency_key_in_progress`（同じ `Idempotency-Key` の要求が処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-okaeri-scopes":["webhooks:write"],"security":[{"apiKey":[]}]}}},"components":{"schemas":{"CampaignDetailOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"site_id":{"type":"string","format":"uuid","title":"Site Id"},"key":{"type":"string","title":"Key"},"name":{"type":"string","title":"Name"},"product_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Name"},"status":{"type":"string","title":"Status","enum":["active","paused","archived"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"abandon_wait_minutes":{"type":"integer","title":"Abandon Wait Minutes"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"site":{"additionalProperties":true,"type":"object","title":"Site"},"url_rules":{"items":{"$ref":"#/components/schemas/UrlRuleOut"},"type":"array","title":"Url Rules"},"form_profile":{"anyOf":[{"$ref":"#/components/schemas/FormProfileOut"},{"type":"null"}]},"warnings":{"items":{"$ref":"#/components/schemas/TakeoverWarningOut"},"type":"array","title":"Warnings","description":"保存で稼働中キャンペーンのページを別キャンペーンが奪った時の警告。保存は成立している"}},"type":"object","required":["id","site_id","key","name","product_name","status","abandon_wait_minutes","created_at","updated_at","site","url_rules","form_profile"],"title":"CampaignDetailOut"},"CampaignDuplicateIn":{"properties":{"key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","title":"CampaignDuplicateIn","description":"複製の指定。省略＝識別子は `<元>-copy`（空いている番号）・名前は「〇〇のコピー」。"},"CampaignIn":{"properties":{"site_id":{"type":"string","format":"uuid","title":"Site Id"},"key":{"type":"string","title":"Key"},"name":{"type":"string","title":"Name"},"product_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Name"},"status":{"anyOf":[{"type":"string","enum":["active","paused","archived"]},{"type":"null"}],"title":"Status","description":"省略時はセッション=active・APIキー=paused。APIキーは paused のみ指定可\n\n値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"abandon_wait_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Abandon Wait Minutes"}},"type":"object","required":["site_id","key","name"],"title":"CampaignIn"},"CampaignListItemOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"site_id":{"type":"string","format":"uuid","title":"Site Id"},"key":{"type":"string","title":"Key"},"name":{"type":"string","title":"Name"},"product_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Name"},"status":{"type":"string","title":"Status","enum":["active","paused","archived"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"abandon_wait_minutes":{"type":"integer","title":"Abandon Wait Minutes"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"scenario_count":{"type":"integer","title":"Scenario Count","description":"未削除のシナリオ数"},"active_scenario_count":{"type":"integer","title":"Active Scenario Count","description":"有効（active）なシナリオ数（0 か 1）。0 なら稼働中でも送られない"}},"type":"object","required":["id","site_id","key","name","product_name","status","abandon_wait_minutes","created_at","updated_at","scenario_count","active_scenario_count"],"title":"CampaignListItemOut","description":"一覧の1行。「稼働中だが有効なシナリオが無く送られない」を一覧で見分けられる。"},"CampaignListOut":{"properties":{"data":{"items":{"$ref":"#/components/schemas/CampaignListItemOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["data","next_cursor","has_more"],"title":"CampaignListOut","description":"キャンペーンの一覧（cursor 方式）。URL ルール・フォーム項目は詳細だけに載る。"},"CampaignPatch":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"product_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Name"},"status":{"anyOf":[{"type":"string","enum":["active","paused","archived"]},{"type":"null"}],"title":"Status","description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"abandon_wait_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Abandon Wait Minutes"}},"type":"object","title":"CampaignPatch","description":"未送信＝現状維持。`key` と `site_id` は受け付けない（送られても黙って無視する）。"},"CampaignRefOut":{"properties":{"id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Id"},"key":{"type":"string","title":"Key"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["id","key","name"],"title":"CampaignRefOut"},"CaptureCountsOut":{"properties":{"captured":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Captured"},"abandoned":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Abandoned"}},"type":"object","required":["captured","abandoned"],"title":"CaptureCountsOut"},"ConsentSettingsOut":{"properties":{"consent_checkbox_enabled":{"type":"boolean","title":"Consent Checkbox Enabled"},"consent_default_checked":{"type":"boolean","title":"Consent Default Checked"},"consent_template_key":{"anyOf":[{"type":"string","enum":["concise","formal","standard"]},{"type":"null"}],"title":"Consent Template Key","description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"template":{"$ref":"#/components/schemas/ConsentTemplateOut"},"templates":{"items":{"$ref":"#/components/schemas/ConsentTemplateOut"},"type":"array","title":"Templates"},"consent_optout_link_enabled":{"type":"boolean","title":"Consent Optout Link Enabled"},"consent_mode":{"type":"string","title":"Consent Mode","enum":["none","notice_optout","explicit"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"optout_text":{"$ref":"#/components/schemas/OptoutTextOut"},"publish_failed":{"items":{"type":"string"},"type":"array","title":"Publish Failed","default":[]}},"type":"object","required":["consent_checkbox_enabled","consent_default_checked","consent_template_key","template","templates","consent_optout_link_enabled","consent_mode","optout_text"],"title":"ConsentSettingsOut"},"ConsentTemplateOut":{"properties":{"key":{"type":"string","title":"Key","enum":["concise","formal","standard"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"main":{"type":"string","title":"Main"},"note":{"type":"string","title":"Note"}},"type":"object","required":["key","main","note"],"title":"ConsentTemplateOut"},"ConversionCountsOut":{"properties":{"abandoned":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Abandoned"},"converted":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Converted"}},"type":"object","required":["abandoned","converted"],"title":"ConversionCountsOut"},"ConversionDetectedData":{"type":"object","required":["lead_id","campaign_id","site_id","conversion_source","converted_at"],"properties":{"lead_id":{"type":"string","format":"uuid","description":"リードの ID（連絡先は `GET /leads/{lead_id}` で取得する）"},"campaign_id":{"type":"string","format":"uuid","description":"キャンペーンの ID"},"site_id":{"type":"string","format":"uuid","description":"サイトの ID"},"conversion_source":{"type":"string","enum":["tag","tag_visitor","hash_match","cart_api","manual"],"description":"CV の検知のしかた。成果の指標に数えるのは `tag`（サンクスページのタグ）だけ。`tag_visitor`＝同じ訪問者の別のキャンペーンの CV から止めた・`hash_match`＝同じ連絡先の CV から止めた\n\n値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"converted_at":{"type":"string","format":"date-time","description":"CV の時刻"}}},"DailyCountsOut":{"properties":{"traffic":{"$ref":"#/components/schemas/TrafficCountsOut"},"capture":{"$ref":"#/components/schemas/CaptureCountsOut"},"conversion":{"$ref":"#/components/schemas/ConversionCountsOut"},"delivery":{"$ref":"#/components/schemas/DeliveryCountsOut"}},"type":"object","required":["traffic","capture","conversion","delivery"],"title":"DailyCountsOut","description":"面ごと・段ごとの件数。集計がまだの日・シナリオで絞った時の配信以外の面は null。"},"DailyDayOut":{"properties":{"date":{"type":"string","title":"Date","description":"日付（`YYYY-MM-DD`・JST）"},"computed":{"type":"boolean","title":"Computed","description":"集計済みか。false の日の件数は null"},"counts":{"$ref":"#/components/schemas/DailyCountsOut"},"delivery_by_channel":{"$ref":"#/components/schemas/DeliveryByChannelOut"},"converted_spillover":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Converted Spillover"},"converted_hash_match":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Converted Hash Match"}},"type":"object","required":["date","computed","counts","delivery_by_channel","converted_spillover","converted_hash_match"],"title":"DailyDayOut","description":"1日分（JST）。"},"DailyNotesOut":{"properties":{"recovered_cv":{"type":"string","title":"Recovered Cv"},"traffic_unit":{"type":"string","title":"Traffic Unit"},"delivery":{"type":"string","title":"Delivery"}},"type":"object","required":["recovered_cv","traffic_unit","delivery"],"title":"DailyNotesOut","description":"数字の読み方の注記（画面と同じ文言）。"},"DailyRangeOut":{"properties":{"from":{"type":"string","title":"From","description":"期間の始まりの日付（含む）"},"to":{"type":"string","title":"To","description":"期間の終わりの日付（含まない）"},"timezone":{"type":"string","title":"Timezone"},"site_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site Id"},"campaign_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Id"},"scenario_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scenario Id"}},"type":"object","required":["from","to","timezone","site_id","campaign_id","scenario_id"],"title":"DailyRangeOut"},"DailyReportOut":{"properties":{"range":{"$ref":"#/components/schemas/DailyRangeOut"},"refreshed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refreshed At","description":"最後に集計した時刻。集計済みの日が無ければ null"},"not_computed_dates":{"items":{"type":"string"},"type":"array","title":"Not Computed Dates","description":"まだ集計していない日付"},"faces":{"items":{"$ref":"#/components/schemas/ReportFaceOut"},"type":"array","title":"Faces"},"metrics":{"items":{"$ref":"#/components/schemas/ReportMetricOut"},"type":"array","title":"Metrics"},"converted_spillover":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Converted Spillover"},"converted_hash_match":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Converted Hash Match"},"days":{"items":{"$ref":"#/components/schemas/DailyDayOut"},"type":"array","title":"Days"},"notes":{"$ref":"#/components/schemas/DailyNotesOut"},"groups":{"anyOf":[{"items":{"$ref":"#/components/schemas/DailyStepGroupOut"},"type":"array"},{"type":"null"}],"title":"Groups","description":"`group_by=step` の時だけ載る"}},"type":"object","required":["range","refreshed_at","not_computed_dates","faces","metrics","converted_spillover","converted_hash_match","days","notes"],"title":"DailyReportOut","description":"日次推移（期間は JST の日付の半開区間）。"},"DailyStepGroupOut":{"properties":{"step_id":{"type":"string","title":"Step Id"},"step_no":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Step No","description":"ステップ番号。削除済みで番号が引けない時は null"},"channel":{"type":"string","title":"Channel","enum":["sms","email"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"step_deleted":{"type":"boolean","title":"Step Deleted"},"counts":{"$ref":"#/components/schemas/DeliveryCountsOut"},"metrics":{"items":{"$ref":"#/components/schemas/ReportMetricOut"},"type":"array","title":"Metrics"}},"type":"object","required":["step_id","step_no","channel","step_deleted","counts","metrics"],"title":"DailyStepGroupOut","description":"シナリオのステップ別の実績（`group_by=step`）。期間内に送信の無いステップは行が無い。"},"DeliveryByChannelOut":{"properties":{"sms":{"$ref":"#/components/schemas/DeliveryCountsOut"},"email":{"$ref":"#/components/schemas/DeliveryCountsOut"}},"type":"object","required":["sms","email"],"title":"DeliveryByChannelOut"},"DeliveryCountsOut":{"properties":{"sent":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sent"},"delivered":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Delivered"},"opened":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Opened"},"clicked":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Clicked"},"converted":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Converted"}},"type":"object","required":["sent","delivered","opened","clicked","converted"],"title":"DeliveryCountsOut","description":"配信の段ごとの件数。SMS には開封が無い（`opened` は null）。集計がまだの日は null。"},"DeliveryEventData":{"type":"object","required":["delivery_id","lead_id","campaign_id","channel","step","status"],"properties":{"delivery_id":{"type":"string","format":"uuid","description":"配信の ID（`GET /deliveries/{delivery_id}`）"},"lead_id":{"type":"string","format":"uuid","description":"リードの ID（連絡先は `GET /leads/{lead_id}` で取得する）"},"campaign_id":{"type":"string","format":"uuid","description":"キャンペーンの ID"},"channel":{"type":"string","enum":["sms","email"],"description":"チャネル\n\n値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"step":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"シナリオのステップ番号（1始まり）"},"status":{"type":"string","enum":["sent","failed"],"description":"結果（イベント名の後半と同じ）\n\n値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"error_code":{"type":"string","description":"失敗の理由のコード（`delivery.failed` の時だけ）。固定の語彙ではない（送信事業者が返すエラー名がそのまま入ることがある）＝値で分岐せず、表示とログに使う"}}},"DeliveryListOut":{"properties":{"data":{"items":{"$ref":"#/components/schemas/DeliveryOut"},"type":"array","title":"Data"},"date_field":{"type":"string","title":"Date Field","description":"期間の絞り込みに使った日時の項目（クエリ `date_field`）\n\n値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）","enum":["created_at","scheduled_at","sent_at"]},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["data","date_field","next_cursor","has_more"],"title":"DeliveryListOut","description":"配信の一覧（cursor 方式）。行は `GET /deliveries/{delivery_id}` と同じ形。"},"DeliveryOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"lead_id":{"type":"string","format":"uuid","title":"Lead Id"},"status":{"type":"string","title":"Status","enum":["scheduled","sending","sent","delivered","failed","cancelled","suppressed"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"channel":{"type":"string","title":"Channel","enum":["sms","email"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"to_masked":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Masked"},"pii_state":{"type":"string","title":"Pii State","enum":["present","absent","error"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"campaign":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Campaign"},"scenario":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Scenario"},"step":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Step"},"scheduled_at":{"type":"string","format":"date-time","title":"Scheduled At"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"cancel_reason":{"anyOf":[{"type":"string","enum":["converted","suppressed","opted_out","cap_exceeded","invalid_contact","step_removed"]},{"type":"null"}],"title":"Cancel Reason","description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code","description":"失敗の理由のコード。固定の語彙ではない（送信事業者が返すエラー名がそのまま入ることがある）＝値で分岐せず、表示とログに使う"}},"type":"object","required":["id","lead_id","status","channel","to_masked","pii_state","campaign","scenario","step","scheduled_at","sent_at","created_at","cancel_reason","error_code"],"title":"DeliveryOut","description":"配信1件。宛先はマスク済みの `to_masked` だけを返す。"},"DeliveryStatusOut":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"enabled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Enabled At"},"mode":{"type":"string","enum":["off","test_only","live"],"title":"Mode","description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"}},"type":"object","required":["enabled","enabled_at","mode"],"title":"DeliveryStatusOut"},"Error":{"title":"Error","type":"object","required":["error"],"properties":{"error":{"type":"object","required":["type","code","message","request_id"],"properties":{"type":{"type":"string","enum":["invalid_request","authentication_error","permission_error","not_found","rate_limit_error","api_error"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]},"request_id":{"type":"string"}}}}},"FormProfileIn":{"properties":{"tel_selectors":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tel Selectors"},"email_selectors":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Email Selectors"},"consent_selector":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Consent Selector"},"tel_split_selectors":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tel Split Selectors"}},"type":"object","title":"FormProfileIn"},"FormProfileOut":{"properties":{"tel_selectors":{"items":{"type":"string"},"type":"array","title":"Tel Selectors"},"email_selectors":{"items":{"type":"string"},"type":"array","title":"Email Selectors"},"consent_selector":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Consent Selector"},"tel_split_selectors":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tel Split Selectors"},"detected_by":{"type":"string","title":"Detected By","enum":["manual","preset","auto"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"detected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Detected At"}},"type":"object","required":["tel_selectors","email_selectors","consent_selector","tel_split_selectors","detected_by","detected_at"],"title":"FormProfileOut"},"FromPresetIn":{"properties":{"preset_key":{"type":"string","title":"Preset Key"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["preset_key"],"title":"FromPresetIn"},"FunnelCampaignGroupOut":{"properties":{"campaign_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Id","description":"null はどのキャンペーンにも当たらなかった分"},"campaign_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Key"},"campaign_name":{"type":"string","title":"Campaign Name"},"page_view":{"type":"integer","title":"Page View"},"form_start":{"type":"integer","title":"Form Start"},"capture":{"type":"integer","title":"Capture"},"conversion":{"type":"integer","title":"Conversion"},"abandoned":{"type":"integer","title":"Abandoned"},"converted":{"type":"integer","title":"Converted"},"converted_spillover":{"type":"integer","title":"Converted Spillover"},"converted_hash_match":{"type":"integer","title":"Converted Hash Match"}},"type":"object","required":["campaign_id","campaign_key","campaign_name","page_view","form_start","capture","conversion","abandoned","converted","converted_spillover","converted_hash_match"],"title":"FunnelCampaignGroupOut","description":"キャンペーン別の行（`group_by=campaign`）。列ごとに数える基準の日時が違う。"},"FunnelRangeOut":{"properties":{"from":{"type":"string","title":"From","description":"期間の始まり（含む）"},"to":{"type":"string","title":"To","description":"期間の終わり（含まない）"},"site_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site Id"},"campaign_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Id"}},"type":"object","required":["from","to","site_id","campaign_id"],"title":"FunnelRangeOut"},"FunnelReportOut":{"properties":{"range":{"$ref":"#/components/schemas/FunnelRangeOut"},"unit":{"type":"string","title":"Unit","description":"トラフィックを数える単位の説明"},"faces":{"items":{"$ref":"#/components/schemas/ReportFaceOut"},"type":"array","title":"Faces"},"metrics":{"items":{"$ref":"#/components/schemas/ReportMetricOut"},"type":"array","title":"Metrics"},"volumes":{"additionalProperties":{"type":"integer"},"type":"object","title":"Volumes","description":"イベントの種類ごとの件数"},"conversion_events":{"type":"integer","title":"Conversion Events"},"converted_spillover":{"type":"integer","title":"Converted Spillover","description":"別のキャンペーンの CV から止めたリード数"},"converted_hash_match":{"type":"integer","title":"Converted Hash Match","description":"同じ連絡先の CV から止めたリード数"},"delivered_inferred":{"type":"integer","title":"Delivered Inferred","description":"到達の通知は無いが開封・クリックから到達に数えた配信数"},"excluded_no_session":{"type":"integer","title":"Excluded No Session","description":"訪問を特定できず集計から外したイベント数"},"imputed_by_visitor":{"type":"integer","title":"Imputed By Visitor","description":"訪問者の ID で訪問を代用したイベント数"},"unassigned_share":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Unassigned Share","description":"どのキャンペーンにも当たらなかった PV の割合"},"groups":{"anyOf":[{"items":{"$ref":"#/components/schemas/FunnelCampaignGroupOut"},"type":"array"},{"type":"null"}],"title":"Groups","description":"`group_by=campaign` の時だけ載る"}},"type":"object","required":["range","unit","faces","metrics","volumes","conversion_events","converted_spillover","converted_hash_match","delivered_inferred","excluded_no_session","imputed_by_visitor","unassigned_share"],"title":"FunnelReportOut","description":"ファネルと指標（期間は半開区間）。"},"LeadAbandonedData":{"type":"object","required":["lead_id","campaign_id","abandoned_at"],"properties":{"lead_id":{"type":"string","format":"uuid","description":"リードの ID（連絡先は `GET /leads/{lead_id}` で取得する）"},"campaign_id":{"type":"string","format":"uuid","description":"キャンペーンの ID"},"abandoned_at":{"type":"string","format":"date-time","description":"離脱が確定した時刻"}}},"LeadCapturedData":{"type":"object","required":["lead_id","campaign_id","site_id","channels"],"properties":{"lead_id":{"type":"string","format":"uuid","description":"リードの ID（連絡先は `GET /leads/{lead_id}` で取得する）"},"campaign_id":{"type":"string","format":"uuid","description":"キャンペーンの ID"},"site_id":{"type":"string","format":"uuid","description":"サイトの ID"},"channels":{"type":"array","items":{"type":"string","enum":["sms","email"]},"description":"取得した連絡先で届けられるチャネル（SMS は受信できる番号の時だけ）\n\n値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"}}},"LeadDetailOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"site":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Site"},"campaign":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Campaign"},"status":{"type":"string","title":"Status","enum":["started","captured","abandoned","queued","sent","converted","suppressed"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"consent_state":{"type":"string","title":"Consent State","enum":["none","notice_optout","explicit"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"email_masked":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email Masked"},"tel_masked":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tel Masked"},"pii_state":{"type":"string","title":"Pii State","enum":["present","absent","error"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"tel_kind":{"anyOf":[{"type":"string","enum":["mobile","ip","landline"]},{"type":"null"}],"title":"Tel Kind","description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"sms_capable":{"type":"boolean","title":"Sms Capable"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"captured_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Captured At"},"abandoned_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Abandoned At"},"converted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Converted At"},"conversion_source":{"anyOf":[{"type":"string","enum":["tag","tag_visitor","hash_match","cart_api","manual"]},{"type":"null"}],"title":"Conversion Source","description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"suppress_reason":{"anyOf":[{"type":"string","enum":["check_error","not_found","delivery_disabled","campaign_inactive","campaign_paused","scenario_inactive","scenario_paused","before_activation","stale","converted","lead_ineligible","no_contact","not_test_recipient","opted_out","suppressed","invalid_contact","sender_unverified","free_quota_exhausted","subscription_inactive","balance_exhausted","cap_exceeded"]},{"type":"null"}],"title":"Suppress Reason","description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"landing_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Landing Url"},"referrer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Referrer"},"utm":{"additionalProperties":true,"type":"object","title":"Utm","description":"流入時の UTM パラメータ。画面表示用。形は契約外（予告なく変わる）＝この中の項目に依存した処理を組まない"},"lp_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lp Key"},"timeline":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Timeline","description":"リードの出来事の時系列。画面表示用。形は契約外（予告なく変わる）＝この中の項目に依存した処理を組まない"}},"type":"object","required":["id","site","campaign","status","consent_state","email_masked","tel_masked","pii_state","tel_kind","sms_capable","created_at","captured_at","abandoned_at","converted_at","conversion_source","suppress_reason","landing_url","referrer","utm","lp_key","timeline"],"title":"LeadDetailOut","description":"詳細だけが返すもの。\n\n流入元（`landing_url` / `referrer` / `utm` / `lp_key`）は一覧に出さず詳細だけで返す。\n`referrer` には外部サイトの値がそのまま入る。タイムラインも詳細だけで返す。"},"LeadListOut":{"properties":{"data":{"items":{"$ref":"#/components/schemas/LeadOut"},"type":"array","title":"Data"},"date_field":{"type":"string","title":"Date Field","description":"期間の絞り込みに使った日時の項目（クエリ `date_field`）\n\n値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）","enum":["created_at","captured_at","abandoned_at","converted_at"]},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["data","date_field","next_cursor","has_more"],"title":"LeadListOut","description":"リードの一覧（cursor 方式）。"},"LeadOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"site":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Site"},"campaign":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Campaign"},"status":{"type":"string","title":"Status","enum":["started","captured","abandoned","queued","sent","converted","suppressed"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"consent_state":{"type":"string","title":"Consent State","enum":["none","notice_optout","explicit"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"email_masked":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email Masked"},"tel_masked":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tel Masked"},"pii_state":{"type":"string","title":"Pii State","enum":["present","absent","error"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"tel_kind":{"anyOf":[{"type":"string","enum":["mobile","ip","landline"]},{"type":"null"}],"title":"Tel Kind","description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"sms_capable":{"type":"boolean","title":"Sms Capable"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"captured_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Captured At"},"abandoned_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Abandoned At"},"converted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Converted At"},"conversion_source":{"anyOf":[{"type":"string","enum":["tag","tag_visitor","hash_match","cart_api","manual"]},{"type":"null"}],"title":"Conversion Source","description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"suppress_reason":{"anyOf":[{"type":"string","enum":["check_error","not_found","delivery_disabled","campaign_inactive","campaign_paused","scenario_inactive","scenario_paused","before_activation","stale","converted","lead_ineligible","no_contact","not_test_recipient","opted_out","suppressed","invalid_contact","sender_unverified","free_quota_exhausted","subscription_inactive","balance_exhausted","cap_exceeded"]},{"type":"null"}],"title":"Suppress Reason","description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"}},"type":"object","required":["id","site","campaign","status","consent_state","email_masked","tel_masked","pii_state","tel_kind","sms_capable","created_at","captured_at","abandoned_at","converted_at","conversion_source","suppress_reason"],"title":"LeadOut","description":"リード1件。連絡先はマスク済みの文字列だけを返す。"},"MatchLocationOut":{"properties":{"hostname":{"type":"string","title":"Hostname"},"pathname":{"type":"string","title":"Pathname"},"search":{"type":"string","title":"Search"}},"type":"object","required":["hostname","pathname","search"],"title":"MatchLocationOut","description":"テストした URL を判定に使う3つの部分に分けたもの。"},"MatchRuleOut":{"properties":{"campaign":{"type":"string","title":"Campaign","description":"キャンペーンの `key`"},"role":{"type":"string","title":"Role","enum":["landing","form","thanks"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"match_type":{"type":"string","title":"Match Type","enum":["prefix","glob","regex","query","host"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"pattern":{"type":"string","title":"Pattern"},"priority":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Priority","description":"小さいほど先に評価する。null は最後"}},"type":"object","required":["campaign","role","match_type","pattern","priority"],"title":"MatchRuleOut","description":"配信中のタグ設定に載っている URL ルール1件。"},"MatchTestIn":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"MatchTestIn"},"MatchTestOut":{"properties":{"url":{"type":"string","title":"Url"},"location":{"$ref":"#/components/schemas/MatchLocationOut"},"assigned":{"type":"boolean","title":"Assigned","description":"どれかのルールに当たったか"},"campaign":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign","description":"当たったキャンペーンの `key`。当たらなければ null"},"role":{"anyOf":[{"type":"string","enum":["landing","form","thanks"]},{"type":"null"}],"title":"Role","description":"当たったルールの役割。当たらなければ null\n\n値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"matched":{"anyOf":[{"$ref":"#/components/schemas/MatchRuleOut"},{"type":"null"}],"description":"最初に当たったルール。当たらなければ null"},"evaluated":{"items":{"$ref":"#/components/schemas/MatchRuleOut"},"type":"array","title":"Evaluated","description":"評価したルール（評価順）"}},"type":"object","required":["url","location","assigned","campaign","role","matched","evaluated"],"title":"MatchTestOut","description":"URL のマッチテストの結果。判定はタグに配る設定と同じルール・同じ順序で行う。"},"MessageExampleListOut":{"properties":{"data":{"items":{"$ref":"#/components/schemas/MessageExampleOut"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"MessageExampleListOut","description":"メッセージの例文の一覧（全件・ページングなし）。"},"MessageExampleOut":{"properties":{"key":{"type":"string","title":"Key","description":"例文の識別子（`sms_1` 等）"},"channel":{"type":"string","title":"Channel","enum":["sms","email"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"position":{"type":"integer","title":"Position","description":"何通目向けか（推奨シナリオでの順番・チャネルごと）"},"delay_minutes":{"type":"integer","title":"Delay Minutes","description":"推奨シナリオでの送るタイミング（シナリオに入ってから・分）"},"label":{"type":"string","title":"Label","description":"表示名（例: 1通目（離脱直後））"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body","description":"SMS の本文。メールは null"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject","description":"メールの件名。SMS は null"},"blocks":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Blocks","description":"メールのブロック。SMS は null"}},"type":"object","required":["key","channel","position","delay_minutes","label","body","subject","blocks"],"title":"MessageExampleOut","description":"例文1件。選んだら `POST /messages` の `body`（SMS）／`subject`＋`blocks`（メール）へ。"},"MessageIn":{"properties":{"channel":{"type":"string","title":"Channel","enum":["sms","email"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"body_html":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Html"},"header_image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Header Image Url"},"link_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Link Url"},"link_params":{"additionalProperties":{"type":"string"},"type":"object","title":"Link Params","default":{}},"blocks":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Blocks"}},"type":"object","required":["channel"],"title":"MessageIn"},"MessageListOut":{"properties":{"data":{"items":{"$ref":"#/components/schemas/MessageOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["data","next_cursor","has_more"],"title":"MessageListOut","description":"文面の一覧（cursor 方式）。"},"MessageOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"channel":{"type":"string","title":"Channel","enum":["sms","email"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"body":{"type":"string","title":"Body"},"body_html":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Html"},"header_image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Header Image Url"},"link_url":{"type":"string","title":"Link Url"},"link_params":{"additionalProperties":true,"type":"object","title":"Link Params"},"blocks":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Blocks"},"sms_segments":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sms Segments","description":"SMS の通数の目安（保存時点）。URL は展開後・商品名は字面（{{product_name}}）で数えたワーストケース（docomo 66文字刻み）。実際の通数はキャンペーンの商品名とキャリアで変わる（実績は配信の記録）。メールは null"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","channel","subject","body","body_html","header_image_url","link_url","link_params","blocks","sms_segments","created_at","updated_at"],"title":"MessageOut"},"MessagePatch":{"properties":{"channel":{"anyOf":[{"type":"string","enum":["sms","email"]},{"type":"null"}],"title":"Channel","description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"body_html":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Html"},"header_image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Header Image Url"},"link_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Link Url"},"link_params":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Link Params"},"blocks":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Blocks"}},"type":"object","title":"MessagePatch","description":"未送信＝現状維持。`subject` / `body_html` / `header_image_url` / `blocks` は null でクリア\n\n`header_image_url` は null 以外を送ると 422"},"MessagePreviewIn":{"properties":{"campaign_id":{"type":"string","format":"uuid","title":"Campaign Id"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"blocks":{"items":{},"type":"array","title":"Blocks"}},"type":"object","required":["campaign_id","blocks"],"title":"MessagePreviewIn"},"MessagePreviewOut":{"properties":{"subject":{"type":"string","title":"Subject"},"html":{"type":"string","title":"Html"},"text":{"type":"string","title":"Text"},"problems":{"items":{"$ref":"#/components/schemas/MessagePreviewProblem"},"type":"array","title":"Problems"}},"type":"object","required":["subject","html","text","problems"],"title":"MessagePreviewOut"},"MessagePreviewProblem":{"properties":{"code":{"type":"string","title":"Code","enum":["not_found","sender_info_missing","no_link_url","unknown_variable","missing_value","body_too_long","token_exhausted"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"message":{"type":"string","title":"Message"}},"type":"object","required":["code","message"],"title":"MessagePreviewProblem"},"MessageVariableOut":{"properties":{"name":{"type":"string","title":"Name"},"label":{"type":"string","title":"Label"},"sample":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sample"}},"type":"object","required":["name","label","sample"],"title":"MessageVariableOut"},"MessageVariablesOut":{"properties":{"campaign_id":{"type":"string","format":"uuid","title":"Campaign Id"},"variables":{"items":{"$ref":"#/components/schemas/MessageVariableOut"},"type":"array","title":"Variables"}},"type":"object","required":["campaign_id","variables"],"title":"MessageVariablesOut"},"OptoutTextOut":{"properties":{"link":{"type":"string","title":"Link"},"done":{"type":"string","title":"Done"}},"type":"object","required":["link","done"],"title":"OptoutTextOut"},"PpCheckListOut":{"properties":{"data":{"items":{"$ref":"#/components/schemas/PpCheckOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["data","next_cursor","has_more"],"title":"PpCheckListOut","description":"プライバシーポリシーのチェック結果の一覧（cursor 方式）。"},"PpCheckOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"site_id":{"type":"string","format":"uuid","title":"Site Id"},"trigger":{"type":"string","title":"Trigger","enum":["manual","sweep","recheck","operator"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"status":{"type":"string","title":"Status","enum":["queued","running","passed","failed","error"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"pp_url":{"type":"string","title":"Pp Url"},"external_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Url"},"rule_version":{"type":"string","title":"Rule Version"},"channels":{"items":{"type":"string","enum":["email","sms"]},"type":"array","title":"Channels","description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"elements":{"additionalProperties":true,"type":"object","title":"Elements"},"links":{"additionalProperties":true,"type":"object","title":"Links"},"pages":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Pages"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Finished At"}},"type":"object","required":["id","site_id","trigger","status","pp_url","external_url","rule_version","channels","elements","links","pages","created_at","finished_at"],"title":"PpCheckOut","description":"プライバシーポリシーのチェック1回の結果。`elements`＝{R1: {state, source, quote}, …}。"},"ReportFaceOut":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"basis":{"type":"string","title":"Basis","description":"数える基準の日時"},"available":{"type":"boolean","title":"Available"},"steps":{"items":{"$ref":"#/components/schemas/ReportStepOut"},"type":"array","title":"Steps"}},"type":"object","required":["key","label","basis","available","steps"],"title":"ReportFaceOut","description":"集計面。面ごとに数える基準の日時が違う（比率は同じ面の中でだけ出す）。"},"ReportMetricOut":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"face":{"type":"string","title":"Face","description":"分子・分母の段が属する面の `key`"},"basis":{"type":"string","title":"Basis"},"available":{"type":"boolean","title":"Available"},"numerator":{"type":"string","title":"Numerator","description":"分子の段の `key`"},"denominator":{"type":"string","title":"Denominator","description":"分母の段の `key`"},"numerator_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Numerator Count"},"denominator_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Denominator Count"},"rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rate","description":"比率（1＝100%）。分母が0・集計がまだなら null"}},"type":"object","required":["key","label","face","basis","available","numerator","denominator","numerator_count","denominator_count","rate"],"title":"ReportMetricOut","description":"指標（同じ面の2つの段の比率）。"},"ReportStepOut":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Count","description":"件数。集計がまだの時は null"},"rate_from_prev":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rate From Prev","description":"親の段（`rate_base`）からの比率（0〜1）。親が無い・分母が0なら null"},"rate_base":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rate Base","description":"比率の分母にした段の `key`。先頭の段は null"}},"type":"object","required":["key","label","count","rate_from_prev","rate_base"],"title":"ReportStepOut","description":"面の中の段の1つ。"},"ScenarioDuplicateIn":{"properties":{"campaign_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Campaign Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","title":"ScenarioDuplicateIn","description":"複製の指定。`campaign_id` 省略＝元と同じキャンペーン。`name` 省略＝「〇〇のコピー」。"},"ScenarioIn":{"properties":{"name":{"type":"string","title":"Name"},"status":{"anyOf":[{"type":"string","enum":["draft","active","paused"]},{"type":"null"}],"title":"Status","description":"作成時は常に draft。APIキーは draft 以外を指定すると 422\n\n値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"abandon_wait_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Abandon Wait Minutes"}},"type":"object","required":["name"],"title":"ScenarioIn"},"ScenarioListOut":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ScenarioOut"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"ScenarioListOut","description":"キャンペーンのシナリオの一覧（全件・ページングなし）。"},"ScenarioOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"campaign_id":{"type":"string","format":"uuid","title":"Campaign Id"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status","enum":["draft","active","paused"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"abandon_wait_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Abandon Wait Minutes"},"effective_abandon_wait_minutes":{"type":"integer","title":"Effective Abandon Wait Minutes"},"steps":{"items":{"$ref":"#/components/schemas/StepOut"},"type":"array","title":"Steps"},"shop_name_max_chars":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Shop Name Max Chars"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","campaign_id","name","status","abandon_wait_minutes","effective_abandon_wait_minutes","steps","shop_name_max_chars","created_at","updated_at"],"title":"ScenarioOut"},"ScenarioPatch":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"status":{"anyOf":[{"type":"string","enum":["draft","active","paused"]},{"type":"null"}],"title":"Status","description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"abandon_wait_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Abandon Wait Minutes"}},"type":"object","title":"ScenarioPatch","description":"未送信＝現状維持。`abandon_wait_minutes` の null はキャンペーンの値に戻す。"},"ScenarioPresetListOut":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ScenarioPresetOut"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"ScenarioPresetListOut","description":"シナリオのテンプレートの一覧（全件・ページングなし）。"},"ScenarioPresetOut":{"properties":{"key":{"type":"string","title":"Key","description":"テンプレートの識別子（作成時の `preset_key`）"},"name":{"type":"string","title":"Name"},"step_count":{"type":"integer","title":"Step Count"},"steps":{"items":{"$ref":"#/components/schemas/ScenarioPresetStepOut"},"type":"array","title":"Steps"},"available":{"type":"boolean","title":"Available","description":"今のプランで使えるか（ステップ数の上限で決まる）"},"unavailable_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unavailable Reason","description":"使えない時の理由。使える時は null"},"required_plan":{"anyOf":[{"type":"string","enum":["free","starter","growth","pro"]},{"type":"null"}],"title":"Required Plan","description":"使えない時に、使えるようになる今より上で一番安いプラン。使える時・プランを変えても使えない時は null\n\n値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"shop_name_max_chars":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Shop Name Max Chars","description":"このテンプレートの SMS が全部1通に収まる店名の最大字数。SMS が無ければ null"}},"type":"object","required":["key","name","step_count","steps","available","unavailable_reason","required_plan","shop_name_max_chars"],"title":"ScenarioPresetOut","description":"シナリオのテンプレート1件。作成は `POST /campaigns/{campaign_id}/scenarios/from_preset`。"},"ScenarioPresetStepOut":{"properties":{"channel":{"type":"string","title":"Channel","enum":["sms","email"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"delay_minutes":{"type":"integer","title":"Delay Minutes","description":"シナリオに入ってから送るまでの時間（分）"}},"type":"object","required":["channel","delay_minutes"],"title":"ScenarioPresetStepOut"},"SiteDetailOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"site_key":{"type":"string","title":"Site Key"},"domains":{"items":{"type":"string"},"type":"array","title":"Domains"},"cart_preset":{"type":"string","title":"Cart Preset","enum":["ecforce","futureshop","samurai","tamago","cf7","generic"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"is_active":{"type":"boolean","title":"Is Active"},"config_version":{"type":"integer","title":"Config Version"},"config_published_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Config Published At"},"config_publish_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Config Publish Error"},"publish_state":{"type":"string","title":"Publish State","enum":["never","published","failed"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"privacy_policy_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Privacy Policy Url"},"external_transmission_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Transmission Url"},"pp_url_changed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Pp Url Changed At"},"pp_check":{"additionalProperties":true,"type":"object","title":"Pp Check"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"snippets":{"additionalProperties":true,"type":"object","title":"Snippets","description":"貼り付け用の設置コード一式。画面表示用。形は契約外（予告なく変わる）＝この中の項目に依存した処理を組まない。CSP 用の形はクエリ `nonce=true`"},"stop_page_url":{"type":"string","title":"Stop Page Url","description":"プライバシーポリシーに貼る配信停止ページの URL。訪問者が電話番号・メールアドレスを入力すると、そのテナントへの配信を停止する（登録の有無に関わらず同じ応答）"}},"type":"object","required":["id","name","site_key","domains","cart_preset","is_active","config_version","config_published_at","config_publish_error","publish_state","privacy_policy_url","external_transmission_url","pp_url_changed_at","pp_check","created_at","updated_at","snippets","stop_page_url"],"title":"SiteDetailOut"},"SiteListOut":{"properties":{"data":{"items":{"$ref":"#/components/schemas/SiteOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["data","next_cursor","has_more"],"title":"SiteListOut","description":"サイトの一覧（cursor 方式）。設置コード（`snippets`）は詳細だけに載る。"},"SiteOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"site_key":{"type":"string","title":"Site Key"},"domains":{"items":{"type":"string"},"type":"array","title":"Domains"},"cart_preset":{"type":"string","title":"Cart Preset","enum":["ecforce","futureshop","samurai","tamago","cf7","generic"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"is_active":{"type":"boolean","title":"Is Active"},"config_version":{"type":"integer","title":"Config Version"},"config_published_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Config Published At"},"config_publish_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Config Publish Error"},"publish_state":{"type":"string","title":"Publish State","enum":["never","published","failed"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"privacy_policy_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Privacy Policy Url"},"external_transmission_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Transmission Url"},"pp_url_changed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Pp Url Changed At"},"pp_check":{"additionalProperties":true,"type":"object","title":"Pp Check"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","site_key","domains","cart_preset","is_active","config_version","config_published_at","config_publish_error","publish_state","privacy_policy_url","external_transmission_url","pp_url_changed_at","pp_check","created_at","updated_at"],"title":"SiteOut"},"SmsEstimateIn":{"properties":{"body":{"type":"string","minLength":1,"title":"Body"}},"type":"object","required":["body"],"title":"SmsEstimateIn"},"SmsEstimateOut":{"properties":{"chars":{"type":"integer","title":"Chars","description":"課金通数の判定に使う文字数。URL の差し込み変数（`{{short_url}}` / `{{unsubscribe_url}}`）は送信時と同じ長さに展開した後で数える。UTF-16 のコードユニット数（絵文字は2）で、改行は1つにつき2"},"segments":{"type":"integer","title":"Segments","description":"課金通数の目安。キャリア未確定のワーストケース（docomo＝70文字超は66文字刻み）"},"max_segments":{"type":"integer","title":"Max Segments","description":"1本の SMS の通数の上限（本文上限で数えた値）"}},"type":"object","required":["chars","segments","max_segments"],"title":"SmsEstimateOut"},"StepIn":{"properties":{"id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Id"},"channel":{"type":"string","title":"Channel","enum":["sms","email"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"delay_kind":{"type":"string","title":"Delay Kind","enum":["after_previous","after_entry","at_clock_time"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"delay_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Delay Minutes"},"send_at_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Send At Time"},"message_id":{"type":"string","format":"uuid","title":"Message Id"}},"type":"object","required":["channel","delay_kind","message_id"],"title":"StepIn"},"StepOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"step_no":{"type":"integer","title":"Step No"},"channel":{"type":"string","title":"Channel","enum":["sms","email"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"delay_kind":{"type":"string","title":"Delay Kind","enum":["after_previous","after_entry","at_clock_time"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"delay_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Delay Minutes"},"send_at_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Send At Time"},"message_id":{"type":"string","format":"uuid","title":"Message Id"}},"type":"object","required":["id","step_no","channel","delay_kind","delay_minutes","send_at_time","message_id"],"title":"StepOut"},"StepsIn":{"properties":{"steps":{"items":{"$ref":"#/components/schemas/StepIn"},"type":"array","title":"Steps"}},"type":"object","required":["steps"],"title":"StepsIn","description":"一括置換。**並び順がそのまま `step_no`** になる（画面の上下順）。"},"SuppressionCreatedOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"scope":{"type":"string","title":"Scope","enum":["tenant","campaign"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"campaign":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Campaign"},"kind":{"type":"string","title":"Kind","enum":["email","tel"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"value_masked":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value Masked"},"pii_state":{"type":"string","title":"Pii State","enum":["present","absent","error"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"reason":{"type":"string","title":"Reason","enum":["opt_out","manual","bounce","complaint","undeliverable"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"memo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memo"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"active":{"type":"boolean","title":"Active"},"deletable":{"type":"boolean","title":"Deletable"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"cancelled_deliveries":{"type":"integer","title":"Cancelled Deliveries","description":"この登録で取り消した同じ宛先の配信予約の件数"}},"type":"object","required":["id","scope","campaign","kind","value_masked","pii_state","reason","memo","expires_at","active","deletable","created_at","cancelled_deliveries"],"title":"SuppressionCreatedOut","description":"登録した除外1件と、その登録で取り消した配信予約の件数。"},"SuppressionIn":{"properties":{"scope":{"type":"string","title":"Scope","default":"tenant","enum":["tenant","campaign"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"campaign_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Campaign Id"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"memo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memo"},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value"}},"type":"object","title":"SuppressionIn"},"SuppressionListOut":{"properties":{"data":{"items":{"$ref":"#/components/schemas/SuppressionOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["data","next_cursor","has_more"],"title":"SuppressionListOut","description":"除外リストの一覧（cursor 方式）。宛先はマスクした文字列だけ。"},"SuppressionOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"scope":{"type":"string","title":"Scope","enum":["tenant","campaign"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"campaign":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Campaign"},"kind":{"type":"string","title":"Kind","enum":["email","tel"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"value_masked":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value Masked"},"pii_state":{"type":"string","title":"Pii State","enum":["present","absent","error"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"reason":{"type":"string","title":"Reason","enum":["opt_out","manual","bounce","complaint","undeliverable"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"memo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memo"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"active":{"type":"boolean","title":"Active"},"deletable":{"type":"boolean","title":"Deletable"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","scope","campaign","kind","value_masked","pii_state","reason","memo","expires_at","active","deletable","created_at"],"title":"SuppressionOut"},"TakeoverRuleOut":{"properties":{"match_type":{"type":"string","title":"Match Type","enum":["prefix","glob","regex","query","host"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"pattern":{"type":"string","title":"Pattern"},"priority":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Priority"}},"type":"object","required":["match_type","pattern","priority"],"title":"TakeoverRuleOut"},"TakeoverWarningOut":{"properties":{"code":{"type":"string","const":"url_takeover","title":"Code"},"message":{"type":"string","title":"Message"},"from_campaign":{"$ref":"#/components/schemas/CampaignRefOut"},"to_campaign":{"$ref":"#/components/schemas/CampaignRefOut"},"count":{"type":"integer","title":"Count"},"sample_urls":{"items":{"type":"string"},"type":"array","title":"Sample Urls"},"rules":{"items":{"$ref":"#/components/schemas/TakeoverRuleOut"},"type":"array","title":"Rules"}},"type":"object","required":["code","message","from_campaign","to_campaign","count","sample_urls","rules"],"title":"TakeoverWarningOut","description":"横取りの警告。稼働中の `from_campaign` が担当していた実URLを\n`to_campaign` の URL ルールが奪った。保存は成立している（止めない）。"},"TrafficCountsOut":{"properties":{"page_view":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page View"},"form_view":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Form View"},"form_start":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Form Start"},"capture":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Capture"}},"type":"object","required":["page_view","form_view","form_start","capture"],"title":"TrafficCountsOut"},"UrlRuleIn":{"properties":{"role":{"type":"string","title":"Role","enum":["landing","form","thanks"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"match_type":{"type":"string","title":"Match Type","enum":["prefix","glob","regex","query","host"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"pattern":{"type":"string","title":"Pattern"}},"type":"object","required":["role","match_type","pattern"],"title":"UrlRuleIn"},"UrlRuleOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"role":{"type":"string","title":"Role","enum":["landing","form","thanks"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"match_type":{"type":"string","title":"Match Type","enum":["prefix","glob","regex","query","host"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"pattern":{"type":"string","title":"Pattern"},"priority":{"type":"integer","title":"Priority"}},"type":"object","required":["id","role","match_type","pattern","priority"],"title":"UrlRuleOut"},"UrlRulesIn":{"properties":{"rules":{"items":{"$ref":"#/components/schemas/UrlRuleIn"},"type":"array","title":"Rules"}},"type":"object","required":["rules"],"title":"UrlRulesIn","description":"一括置換。**並び順がそのまま優先順位**になる（画面のドラッグ順）。"},"UsageThresholdReachedData":{"type":"object","required":["resource","threshold","used","limit","period"],"properties":{"resource":{"type":"string","enum":["sms_segments","emails"],"description":"枠の種類（SMS は通数・メールは件数）\n\n値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"threshold":{"type":"integer","enum":[80,100],"description":"到達した割合（%）\n\n値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"used":{"type":"integer","description":"使った量"},"limit":{"type":"integer","description":"枠の上限"},"period":{"anyOf":[{"type":"object","required":["start","end"],"properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}}},{"type":"null"}],"description":"枠の期間（月額プランの請求期間）。Free の総量枠は期間が無く null"}}},"WebhookDeliveryListOut":{"properties":{"data":{"items":{"$ref":"#/components/schemas/WebhookDeliveryOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["data","next_cursor","has_more"],"title":"WebhookDeliveryListOut"},"WebhookDeliveryOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"endpoint_id":{"type":"string","format":"uuid","title":"Endpoint Id"},"event":{"type":"string","title":"Event","enum":["lead.captured","lead.abandoned","delivery.sent","delivery.failed","conversion.detected","usage.threshold_reached"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"status":{"type":"string","title":"Status","enum":["pending","succeeded","failed"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"attempts":{"type":"integer","title":"Attempts"},"next_attempt_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Attempt At"},"response_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Response Code"},"response_body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Body"},"payload":{"$ref":"#/components/schemas/WebhookEvent","description":"送った本文（再送でも同じ）"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Delivered At"}},"type":"object","required":["id","endpoint_id","event","status","attempts","next_attempt_at","response_code","response_body","payload","created_at","delivered_at"],"title":"WebhookDeliveryOut"},"WebhookEndpointCreatedOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"url":{"type":"string","title":"Url"},"events":{"items":{"type":"string","enum":["lead.captured","lead.abandoned","delivery.sent","delivery.failed","conversion.detected","usage.threshold_reached"]},"type":"array","title":"Events","description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"status":{"type":"string","title":"Status","enum":["active","disabled"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"consecutive_failures":{"type":"integer","title":"Consecutive Failures"},"disabled_reason":{"anyOf":[{"type":"string","enum":["consecutive_failures"]},{"type":"null"}],"title":"Disabled Reason","description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"secret":{"type":"string","title":"Secret"}},"type":"object","required":["id","url","events","status","consecutive_failures","disabled_reason","created_at","updated_at","secret"],"title":"WebhookEndpointCreatedOut"},"WebhookEndpointIn":{"properties":{"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"events":{"items":{"type":"string","enum":["lead.captured","lead.abandoned","delivery.sent","delivery.failed","conversion.detected","usage.threshold_reached"]},"type":"array","title":"Events","default":[],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"}},"type":"object","title":"WebhookEndpointIn"},"WebhookEndpointListOut":{"properties":{"data":{"items":{"$ref":"#/components/schemas/WebhookEndpointOut"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"WebhookEndpointListOut"},"WebhookEndpointOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"url":{"type":"string","title":"Url"},"events":{"items":{"type":"string","enum":["lead.captured","lead.abandoned","delivery.sent","delivery.failed","conversion.detected","usage.threshold_reached"]},"type":"array","title":"Events","description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"status":{"type":"string","title":"Status","enum":["active","disabled"],"description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"consecutive_failures":{"type":"integer","title":"Consecutive Failures"},"disabled_reason":{"anyOf":[{"type":"string","enum":["consecutive_failures"]},{"type":"null"}],"title":"Disabled Reason","description":"値は今後増えることがある。未知の値を受けても処理が止まらないようにしてください（表示は「その他」等にまとめる）"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","url","events","status","consecutive_failures","disabled_reason","created_at","updated_at"],"title":"WebhookEndpointOut","description":"送信先（一覧・取得の形）。**署名鍵 `secret` は含まない**（作成の応答にだけ載る）。"},"WebhookEvent":{"description":"Outbound Webhook で送信先へ送る本文（`POST`・`Content-Type: application/json`・`User-Agent: OKAERI-Webhook/1`）。`type` ごとに `data` の形が決まる。連絡先（電話・メール）は含まない（必要なら `lead_id` で取得する）。\n\n**受け方**\n- 2xx を返すと成功。それ以外の応答・接続できない時は再試行する（初回＋再試行5回＝最大6回・間隔は 1分 → 5分 → 30分 → 2時間 → 6時間）。リダイレクトは追わない。連続して失敗し続けた送信先は自動で停止する（`disabled_reason`）\n- 少なくとも1回届ける＝同じイベントが2回以上届くことがある。`id` で重複を除く（再試行・再送でも`id` は同じ）\n- ヘッダ `X-OKAERI-Event`＝`type` と同じ値。`X-OKAERI-Delivery`＝送信ごとの ID（再送で変わる）\n\n**署名の検証**（ヘッダ `X-OKAERI-Signature: t=<UNIX 秒>,v1=<16進>`）\n1. ヘッダを `,` で分け、`t` と `v1` を取り出す\n2. `<t>.<受け取った本文のバイト列>` を、送信先の作成時に1回だけ受け取った `secret`（`whsec_…`）を鍵にして HMAC-SHA256 で計算し、16進（小文字）にする。本文は JSON として読み直したものでなく、受け取ったバイト列そのままを使う\n3. 計算した値と `v1` を定数時間で比較する。一致しなければ破棄する\n4. `t` と受信時刻の差が許容範囲（推奨 5分）を超えたら破棄する（盗んだ本文の再送の対策）。`t` は送るたびにその時刻で付け直す（再試行・再送でも古くならない）\n","oneOf":[{"$ref":"#/components/schemas/WebhookEventLeadCaptured"},{"$ref":"#/components/schemas/WebhookEventLeadAbandoned"},{"$ref":"#/components/schemas/WebhookEventDeliverySent"},{"$ref":"#/components/schemas/WebhookEventDeliveryFailed"},{"$ref":"#/components/schemas/WebhookEventConversionDetected"},{"$ref":"#/components/schemas/WebhookEventUsageThresholdReached"}],"discriminator":{"propertyName":"type","mapping":{"lead.captured":"#/components/schemas/WebhookEventLeadCaptured","lead.abandoned":"#/components/schemas/WebhookEventLeadAbandoned","delivery.sent":"#/components/schemas/WebhookEventDeliverySent","delivery.failed":"#/components/schemas/WebhookEventDeliveryFailed","conversion.detected":"#/components/schemas/WebhookEventConversionDetected","usage.threshold_reached":"#/components/schemas/WebhookEventUsageThresholdReached"}}},"WebhookEventConversionDetected":{"type":"object","description":"`conversion.detected` の本文","required":["id","type","created_at","tenant_id","data"],"properties":{"id":{"type":"string","format":"uuid","description":"イベントの ID＝受け手の重複除去のキー（再試行・再送でも同じ）"},"type":{"type":"string","const":"conversion.detected"},"created_at":{"type":"string","format":"date-time","description":"イベントの発生時刻"},"tenant_id":{"type":"string","format":"uuid","description":"テナントの ID"},"data":{"$ref":"#/components/schemas/ConversionDetectedData"}},"examples":[{"id":"00000000-0000-7000-8000-000000000001","type":"conversion.detected","created_at":"2026-01-01T00:00:00Z","tenant_id":"00000000-0000-7000-8000-000000000002","data":{"lead_id":"00000000-0000-7000-8000-000000000003","campaign_id":"00000000-0000-7000-8000-000000000004","site_id":"00000000-0000-7000-8000-000000000005","conversion_source":"tag","converted_at":"2026-01-01T00:00:00Z"}}]},"WebhookEventDeliveryFailed":{"type":"object","description":"`delivery.failed` の本文","required":["id","type","created_at","tenant_id","data"],"properties":{"id":{"type":"string","format":"uuid","description":"イベントの ID＝受け手の重複除去のキー（再試行・再送でも同じ）"},"type":{"type":"string","const":"delivery.failed"},"created_at":{"type":"string","format":"date-time","description":"イベントの発生時刻"},"tenant_id":{"type":"string","format":"uuid","description":"テナントの ID"},"data":{"$ref":"#/components/schemas/DeliveryEventData"}},"examples":[{"id":"00000000-0000-7000-8000-000000000001","type":"delivery.failed","created_at":"2026-01-01T00:00:00Z","tenant_id":"00000000-0000-7000-8000-000000000002","data":{"delivery_id":"00000000-0000-7000-8000-000000000006","lead_id":"00000000-0000-7000-8000-000000000003","campaign_id":"00000000-0000-7000-8000-000000000004","channel":"sms","step":1,"status":"failed","error_code":"invalid_number"}}]},"WebhookEventDeliverySent":{"type":"object","description":"`delivery.sent` の本文","required":["id","type","created_at","tenant_id","data"],"properties":{"id":{"type":"string","format":"uuid","description":"イベントの ID＝受け手の重複除去のキー（再試行・再送でも同じ）"},"type":{"type":"string","const":"delivery.sent"},"created_at":{"type":"string","format":"date-time","description":"イベントの発生時刻"},"tenant_id":{"type":"string","format":"uuid","description":"テナントの ID"},"data":{"$ref":"#/components/schemas/DeliveryEventData"}},"examples":[{"id":"00000000-0000-7000-8000-000000000001","type":"delivery.sent","created_at":"2026-01-01T00:00:00Z","tenant_id":"00000000-0000-7000-8000-000000000002","data":{"delivery_id":"00000000-0000-7000-8000-000000000006","lead_id":"00000000-0000-7000-8000-000000000003","campaign_id":"00000000-0000-7000-8000-000000000004","channel":"sms","step":1,"status":"sent"}}]},"WebhookEventLeadAbandoned":{"type":"object","description":"`lead.abandoned` の本文","required":["id","type","created_at","tenant_id","data"],"properties":{"id":{"type":"string","format":"uuid","description":"イベントの ID＝受け手の重複除去のキー（再試行・再送でも同じ）"},"type":{"type":"string","const":"lead.abandoned"},"created_at":{"type":"string","format":"date-time","description":"イベントの発生時刻"},"tenant_id":{"type":"string","format":"uuid","description":"テナントの ID"},"data":{"$ref":"#/components/schemas/LeadAbandonedData"}},"examples":[{"id":"00000000-0000-7000-8000-000000000001","type":"lead.abandoned","created_at":"2026-01-01T00:00:00Z","tenant_id":"00000000-0000-7000-8000-000000000002","data":{"lead_id":"00000000-0000-7000-8000-000000000003","campaign_id":"00000000-0000-7000-8000-000000000004","abandoned_at":"2026-01-01T00:00:00Z"}}]},"WebhookEventLeadCaptured":{"type":"object","description":"`lead.captured` の本文","required":["id","type","created_at","tenant_id","data"],"properties":{"id":{"type":"string","format":"uuid","description":"イベントの ID＝受け手の重複除去のキー（再試行・再送でも同じ）"},"type":{"type":"string","const":"lead.captured"},"created_at":{"type":"string","format":"date-time","description":"イベントの発生時刻"},"tenant_id":{"type":"string","format":"uuid","description":"テナントの ID"},"data":{"$ref":"#/components/schemas/LeadCapturedData"}},"examples":[{"id":"00000000-0000-7000-8000-000000000001","type":"lead.captured","created_at":"2026-01-01T00:00:00Z","tenant_id":"00000000-0000-7000-8000-000000000002","data":{"lead_id":"00000000-0000-7000-8000-000000000003","campaign_id":"00000000-0000-7000-8000-000000000004","site_id":"00000000-0000-7000-8000-000000000005","channels":["email","sms"]}}]},"WebhookEventUsageThresholdReached":{"type":"object","description":"`usage.threshold_reached` の本文","required":["id","type","created_at","tenant_id","data"],"properties":{"id":{"type":"string","format":"uuid","description":"イベントの ID＝受け手の重複除去のキー（再試行・再送でも同じ）"},"type":{"type":"string","const":"usage.threshold_reached"},"created_at":{"type":"string","format":"date-time","description":"イベントの発生時刻"},"tenant_id":{"type":"string","format":"uuid","description":"テナントの ID"},"data":{"$ref":"#/components/schemas/UsageThresholdReachedData"}},"examples":[{"id":"00000000-0000-7000-8000-000000000001","type":"usage.threshold_reached","created_at":"2026-01-01T00:00:00Z","tenant_id":"00000000-0000-7000-8000-000000000002","data":{"resource":"sms_segments","threshold":80,"used":800,"limit":1000,"period":{"start":"2026-01-01T00:00:00Z","end":"2026-02-01T00:00:00Z"}}}]}},"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"APIキー（`okr_live_…` / `okr_test_…`）"}}}}