---
updatedAt: 2026-04-27T13:21:37.000Z
agentTools:
  projectIndex: https://developers.karte.io/llms.txt
---

# Create campaign

#### Required Scope
APIの実行に必要なScopeです。
```
beta.action.campaign.create
```

#### Required Role
管理画面でScopeを追加する際に必要な権限です。
```
接客サービス > 接客サービスの作成・編集
```


# OpenAPI definition

````json
{
  "openapi": "3.0.0",
  "servers": [
    {
      "url": "https://api.karte.io",
      "description": "Production server"
    },
    {
      "url": "https://api-jp.karte.io",
      "description": "Production JP server. リージョン固定オプションのプロジェクトはこちらのエンドポイントを利用してください."
    }
  ],
  "info": {
    "version": "2.0.0",
    "title": "Action"
  },
  "paths": {
    "/v2beta/action/campaign/create": {
      "post": {
        "tags": [
          "Campaign"
        ],
        "summary": "Create campaign",
        "description": "#### Required Scope\nAPIの実行に必要なScopeです。\n```\nbeta.action.campaign.create\n```\n\n#### Required Role\n管理画面でScopeを追加する際に必要な権限です。\n```\n接客サービス > 接客サービスの作成・編集\n```\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "campaign"
                ],
                "properties": {
                  "campaign": {
                    "$ref": "#/components/schemas/RequestCreateCampaign"
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "campaign": {
                  "title": "title_name",
                  "enabled": false,
                  "actions": [
                    {
                      "action_id": 1,
                      "assign_rate": 80
                    },
                    {
                      "action_id": 2,
                      "assign_rate": 20
                    }
                  ],
                  "description": "This is action setting.",
                  "segments_details": [],
                  "dist_days_and_hours": [],
                  "max_number_of_display": 0,
                  "max_number_of_display_per_day": 0,
                  "max_number_of_close": 0,
                  "max_number_of_close_per_day": 0,
                  "max_number_of_click": 0,
                  "max_number_of_click_per_day": 0,
                  "goal": {
                    "event_name": "cart_in",
                    "goal_event_name": "buy"
                  },
                  "dimension_optimisation": {
                    "enabled": false,
                    "iteration": 0
                  },
                  "start_date": "2019-01-01T00:00:00.000Z",
                  "end_date": "2019-01-02T00:00:00.000Z"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "campaign"
                  ],
                  "properties": {
                    "campaign": {
                      "$ref": "#/components/schemas/Campaign"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-karte-api",
            "schema": {
              "type": "string"
            },
            "description": "今後利用する可能性のある予約語です。現在は設定不要です。"
          },
          {
            "in": "header",
            "name": "authorization",
            "schema": {
              "type": "string"
            },
            "description": "認証情報を含むトークンです。\"Authorization\" ヘッダーに `Bearer <token>` の形式で設定してください。"
          },
          {
            "in": "header",
            "name": "content-type",
            "schema": {
              "type": "string"
            },
            "description": "リクエストのコンテンツタイプを指定します。通常は `application/json` を使用してください。"
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "RequestCreateCampaign": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "接客サービスの表示名。"
          },
          "enabled": {
            "type": "boolean",
            "description": "接客サービスの公開/非公開設定。公開の場合は `true`, 非公開の場合は `false` を指定します。"
          },
          "description": {
            "type": "string",
            "description": "接客サービスの説明。"
          },
          "segments_details": {
            "type": "array",
            "description": "対象ユーザー指定で利用するセグメントの指定。",
            "items": {
              "type": "object",
              "properties": {
                "logic_gate": {
                  "type": "string",
                  "description": "セグメントの論理演算子。$andは「次に該当する」、$notは「次を除く」を指定します。",
                  "enum": [
                    "$and",
                    "$not"
                  ]
                },
                "segment_set": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{24}$",
                    "minLength": 1
                  },
                  "description": "セグメントIDの配列。各IDはObjectID形式（24桁の16進数）である必要があります。"
                }
              },
              "additionalProperties": false
            }
          },
          "start_date": {
            "type": "string",
            "format": "date-time",
            "description": "接客サービスの配信開始日時。日時はISO 8601形式で指定します。"
          },
          "end_date": {
            "type": "string",
            "format": "date-time",
            "description": "接客サービスの配信終了日時。日時はISO 8601形式で指定します。"
          },
          "dist_days_and_hours": {
            "type": "array",
            "description": "配信曜日および配信時間の設定。配列の要素は開始〜終了の期間です。開始時刻および終了時刻は日曜日の0:00(JST)を0とした時の各時刻までの秒数です。\n",
            "items": {
              "type": "object",
              "properties": {
                "start": {
                  "type": "number",
                  "description": "配信開始時刻。"
                },
                "end": {
                  "type": "number",
                  "description": "配信終了時刻。"
                }
              },
              "additionalProperties": false
            }
          },
          "max_number_of_display": {
            "type": "number",
            "description": "表示回数上限による配信停止設定。「すべての期間で合計 x 回表示されたユーザー」への停止条件となる表示回数 (x) です。"
          },
          "max_number_of_display_per_day": {
            "type": "number",
            "description": "表示回数上限による配信停止設定。「1日（日本時間の0時〜24時）で合計 x 回表示されたユーザー」への停止条件となる表示回数 (x) です。"
          },
          "max_number_of_close": {
            "type": "number",
            "description": "閉じられた回数による配信停止設定。「すべての期間で合計 x 回閉じたユーザー」への停止条件となる回数 (x) です。"
          },
          "max_number_of_close_per_day": {
            "type": "number",
            "description": "閉じられた回数による配信停止設定。「1日（日本時間の0時〜24時）の間で合計 x 回閉じたユーザー」への停止条件となる回数 (x) です。"
          },
          "max_number_of_click": {
            "type": "number",
            "description": "クリック回数による配信停止設定。「すべての期間で合計 x 回クリックしたユーザー」への停止条件となる回数 (x) です。"
          },
          "max_number_of_click_per_day": {
            "type": "number",
            "description": "クリック回数による配信停止設定。「1日（日本時間の0時〜24時）の間で合計 x 回クリックしたユーザー」への停止条件となる回数 (x) です。"
          },
          "goal": {
            "type": "object",
            "description": "ゴール設定。",
            "properties": {
              "event_name": {
                "type": "string",
                "description": "スクリプトアクションの場合は_message_ready, それ以外の場合はmessage_openとしてください。"
              },
              "goal_event_name": {
                "type": "string",
                "description": "ゴールイベントのイベント名(buy, viewなど)。ゴール(β)機能で作成したゴールの場合は空になります。"
              },
              "goal_id": {
                "type": "string",
                "description": "指定したいゴールが持つID。ゴールイベントの場合は空になります。"
              },
              "stat_span": {
                "type": "string",
                "description": "効果計測期間です。"
              }
            },
            "additionalProperties": false
          },
          "dimension_optimisation": {
            "type": "object",
            "description": "配信対象ユーザーの自動最適化設定です。",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": "自動最適化設定を有効にするかどうかを指定します。"
              }
            },
            "additionalProperties": false
          },
          "trigger": {
            "type": "array",
            "description": "配信トリガー設定。",
            "items": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "event_name"
                ],
                "additionalProperties": false,
                "properties": {
                  "event_name": {
                    "type": "string",
                    "description": "トリガーとなるイベント名。"
                  },
                  "field": {
                    "type": "string",
                    "description": "イベント内の特定フィールドを指定するパス。ドット記法を使用できます。"
                  },
                  "key": {
                    "type": "string",
                    "description": "配列やオブジェクト内の特定のキーを指定します。通常は省略可能となります。"
                  },
                  "compare": {
                    "type": "string",
                    "description": "比較演算子。空文字列または$eqで「等しい」、$existsは「存在確認」、$neは「等しくない」、$gtは「より大きい」、$gteは「以上」、$ltは「より小さい」、$lteは「以下」、$inは「配列内一致」、$ninは「配列内不一致」、$regexは「正規表現マッチ」を表します。"
                  },
                  "value": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      }
                    ],
                    "description": "比較対象の値です。"
                  },
                  "is_regex": {
                    "type": "boolean",
                    "description": "valueを正規表現として扱うかどうかを指定します。"
                  },
                  "match_type": {
                    "type": "string",
                    "description": "マッチングタイプ。exactは「完全一致」、partialは「部分一致」、prefixは「前方一致」、suffixは「後方一致」を表します。"
                  },
                  "useRegex": {
                    "type": "boolean",
                    "description": "正規表現マッチングの有効/無効を指定します。match_typeフィールドと組み合わせて詳細なマッチングタイプを制御します。nullの場合はis_regexフィールドが使用されます。"
                  }
                }
              }
            }
          },
          "user_type": {
            "type": "string",
            "description": "配信対象ユーザーの属性。\n「全員」の場合は `all` 、「ビジターのみ」の場合は `visitor` 、「ユーザーのみ」の場合は `user` を指定します。\n"
          },
          "coexist_policy": {
            "type": "string",
            "description": "同時配信ポリシー設定。「NG」の場合は `exclusive` 、「OK」の場合は `always` を指定します。",
            "enum": [
              "always",
              "exclusive",
              "none"
            ]
          },
          "is_archived": {
            "type": "boolean",
            "description": "接客サービスをアーカイブするかどうかを指定します。"
          }
        },
        "additionalProperties": false
      },
      "Campaign": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "接客サービスの識別用ID。"
          },
          "title": {
            "type": "string",
            "description": "接客サービスの表示名。"
          },
          "enabled": {
            "type": "boolean",
            "description": "接客サービスの公開/非公開設定。"
          },
          "description": {
            "type": "string",
            "description": "接客サービスの説明。"
          },
          "actions": {
            "type": "array",
            "description": "接客サービスに紐づく接客アクションの設定。",
            "items": {
              "type": "object",
              "properties": {
                "action_id": {
                  "type": "string",
                  "description": "接客アクションの識別用ID"
                },
                "assign_rate": {
                  "type": "number",
                  "description": "接客アクションの配信率。全要素の合計値は100以下となります。合計が100以下の場合、100との差分が「配信しない」の割合です。"
                },
                "filled": {
                  "type": "boolean",
                  "description": "接客アクションの設定が完了しているかどうかを示します。"
                },
                "stat": {
                  "additionalProperties": true,
                  "type": "object",
                  "properties": {},
                  "description": "接客アクションの統計情報。"
                },
                "is_archived": {
                  "type": "boolean",
                  "description": "接客アクションがアーカイブされているかどうかを示します。"
                },
                "stop": {
                  "type": "boolean",
                  "description": "接客アクションが停止されているかどうかを示します。"
                },
                "template_id": {
                  "type": "string",
                  "description": "接客アクションで使ったテンプレートの識別用ID。"
                }
              },
              "additionalProperties": false
            }
          },
          "segments": {
            "type": "array",
            "description": "対象ユーザー指定で利用しているセグメントの識別用ID。",
            "items": {
              "type": "string"
            }
          },
          "segments_details": {
            "type": "array",
            "description": "対象ユーザー指定で利用するセグメントの指定。",
            "items": {
              "type": "object",
              "properties": {
                "logic_gate": {
                  "description": "セグメントの論理演算子。$andは「次に該当する」、$notは「次を除く」を指定します。",
                  "type": "string",
                  "enum": [
                    "$and",
                    "$not"
                  ]
                },
                "segment_set": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{24}$",
                    "minLength": 1
                  },
                  "description": "セグメントIDの配列です。各IDはObjectID形式（24桁の16進数）である必要があります。"
                }
              },
              "additionalProperties": false
            }
          },
          "dist_days_and_hours": {
            "type": "array",
            "description": "配信曜日および配信時間の設定。配列の要素は開始〜終了の期間です。開始時刻および終了時刻は日曜日の0:00(JST)を0とした時の各時刻までの秒数です。\n",
            "items": {
              "additionalProperties": false,
              "type": "object",
              "properties": {
                "created": {
                  "type": "string",
                  "format": "date-time",
                  "description": "配信曜日・時間設定の作成時刻。"
                },
                "modified": {
                  "type": "string",
                  "format": "date-time",
                  "description": "配信曜日・時間設定の最終更新時刻。"
                },
                "start": {
                  "type": "number",
                  "description": "配信開始時刻。"
                },
                "end": {
                  "type": "number",
                  "description": "配信終了時刻。"
                }
              }
            }
          },
          "start_date": {
            "type": "string",
            "nullable": true,
            "description": "接客サービスの開始日。Unixtime (ミリ秒）を文字列として返却します。"
          },
          "end_date": {
            "type": "string",
            "nullable": true,
            "description": "接客サービスの終了日。Unixtime (ミリ秒）を文字列として返却します。"
          },
          "max_number_of_display": {
            "type": "number",
            "description": "表示回数上限による配信停止設定。「すべての期間で合計 x 回表示されたユーザー」への停止条件となる表示回数 (x) です。"
          },
          "max_number_of_display_per_day": {
            "type": "number",
            "description": "表示回数上限による配信停止設定。「1日（日本時間の0時〜24時）で合計 x 回表示されたユーザー」への停止条件となる表示回数 (x) です。"
          },
          "max_number_of_close": {
            "type": "number",
            "description": "閉じられた回数による配信停止設定。「すべての期間で合計 x 回閉じたユーザー」への停止条件となる回数 (x) です。"
          },
          "max_number_of_close_per_day": {
            "type": "number",
            "description": "閉じられた回数による配信停止設定。「1日（日本時間の0時〜24時）の間で合計 x 回閉じたユーザー」への停止条件となる回数 (x) です。"
          },
          "max_number_of_click": {
            "type": "number",
            "description": "クリック回数による配信停止設定。「すべての期間で合計 x 回クリックしたユーザー」への停止条件となる回数 (x) です。"
          },
          "max_number_of_click_per_day": {
            "type": "number",
            "description": "クリック回数による配信停止設定。「1日（日本時間の0時〜24時）の間で合計 x 回クリックしたユーザー」への停止条件となる回数 (x) です。"
          },
          "goal": {
            "type": "object",
            "description": "ゴール設定。",
            "properties": {
              "event_name": {
                "type": "string",
                "description": "スクリプトアクションの場合は_message_ready, それ以外の場合はmessage_openとしてください。"
              },
              "goal_event_name": {
                "type": "string",
                "nullable": true,
                "description": "ゴールイベントのイベント名(buy, viewなど)。ゴール(β)機能で作成したゴールの場合は空になります。"
              },
              "stat_span": {
                "enum": [
                  "SESSION",
                  "DAY",
                  "7DAYS",
                  "30DAYS"
                ],
                "type": "string",
                "description": "効果計測期間です。"
              },
              "goal_id": {
                "type": "string",
                "nullable": true,
                "description": "ゴールが持つID。ゴールイベントの場合は空になります。"
              }
            },
            "additionalProperties": false
          },
          "trigger": {
            "type": "array",
            "description": "配信トリガー設定。",
            "items": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "event_name": {
                    "type": "string",
                    "nullable": true,
                    "description": "トリガーとなるイベント名。"
                  },
                  "field": {
                    "type": "string",
                    "nullable": true,
                    "description": "イベント内の特定フィールドを指定するパス。ドット記法を使用できます。"
                  },
                  "key": {
                    "type": "string",
                    "nullable": true,
                    "description": "配列やオブジェクト内の特定のキーを指定します。"
                  },
                  "compare": {
                    "type": "string",
                    "nullable": true,
                    "description": "比較演算子。空文字列または$eqで「等しい」、$existsは「存在確認」、$neは「等しくない」、$gtは「より大きい」、$gteは「以上」、$ltは「より小さい」、$lteは「以下」、$inは「配列内一致」、$ninは「配列内不一致」、$regexは「正規表現マッチ」を表します。"
                  },
                  "value": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            }
                          ]
                        }
                      }
                    ],
                    "nullable": true,
                    "description": "比較対象の値。compareの種類に応じて適切な型を指定します。"
                  },
                  "is_regex": {
                    "type": "boolean",
                    "nullable": true,
                    "description": "正規表現モードのオン/オフを指定します。trueの場合は部分一致、falseの場合は完全一致として動作します。"
                  },
                  "match_type": {
                    "type": "string",
                    "nullable": true,
                    "description": "マッチングタイプ。exactは「完全一致」、partialは「部分一致」、prefixは「前方一致」、suffixは「後方一致」を表します。"
                  },
                  "useRegex": {
                    "type": "boolean",
                    "nullable": true,
                    "description": "正規表現マッチングの有効/無効を指定します。match_typeフィールドと組み合わせて詳細なマッチングタイプを制御します。nullの場合はis_regexフィールドが使用されます。"
                  }
                }
              }
            }
          },
          "user_type": {
            "type": "string",
            "description": "配信対象ユーザーの属性。\n「全員」の場合は all、「ビジターのみ」の場合は `visitor` 、「ユーザーのみ」の場合は `user` が入ります。\n"
          },
          "coexist_policy": {
            "type": "string",
            "description": "同時配信ポリシー設定。「NG」の場合は `exclusive` 、「OK」の場合は `always` を指定します。",
            "enum": [
              "always",
              "exclusive",
              "none"
            ]
          },
          "schedule_id": {
            "type": "string",
            "nullable": true,
            "description": "接客スケジュールの識別用ID。"
          },
          "is_archived": {
            "type": "boolean",
            "description": "接客サービスのアーカイブ設定です。"
          },
          "is_session": {
            "type": "boolean",
            "description": "配信頻度が「セッション毎」の場合に `true` となります。"
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "x-explorer-enabled": false
}
````