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

# Create Campaign

> Creates a new campaign with variants

<Info>
  Scope required: `rewards.issue`
</Info>

This endpoint creates a new partner-initiated campaign for a merchant. A
campaign defines the time window, terms, and reward variants for issuing
rewards to users.

Each campaign must have between 1 and 4 variants. Treatment variants specify
a `reward_template_id` that defines the reward to be issued. Control variants
(named "Control") do not require a
`reward_template_id`.

Use the [List Reward Templates](/partner/reward-templates/list-reward-templates)
endpoint to discover available reward templates for a merchant.

### Parameters

<ParamField body="campaign.merchant_id" type="string" required>
  Merchant ID
</ParamField>

<ParamField body="campaign.name" type="string" required>
  Campaign name
</ParamField>

<ParamField body="campaign.objective" type="string">
  Campaign objective
</ParamField>

<ParamField body="campaign.fine_print" type="string">
  Terms and conditions
</ParamField>

<ParamField body="campaign.start_at" type="string" required>
  Campaign start date (ISO8601)
</ParamField>

<ParamField body="campaign.end_at" type="string" required>
  Campaign end date (ISO8601)
</ParamField>

<ParamField body="campaign.redeemable_from" type="string" required>
  Reward redemption start date (ISO8601)
</ParamField>

<ParamField body="campaign.redeemable_to" type="string" required>
  Reward redemption end date (ISO8601)
</ParamField>

<ParamField body="campaign.variants" type="array" required>
  Campaign variants (1-4 variants)

  <Expandable title="variant">
    <ParamField body="name" type="string" required>
      Variant name
    </ParamField>

    <ParamField body="reward_template_id" type="string">
      Reward template ID. Required for treatment variants, omit for control
      variants.
    </ParamField>
  </Expandable>
</ParamField>

### Response

Returns 201 Created with the campaign object.

<RequestExample>
  ```bash Create Campaign theme={null}
  curl https://api.thanxsandbox.com/partner/campaigns \
    -X POST \
    -H 'X-ClientId: {client_id}' \
    -H 'Accept-Version: v4.0' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer {access_token}' \
    -d '{
      "campaign": {
        "merchant_id": "k2lye10h32l5wzo",
        "name": "Summer Free Coffee",
        "objective": "Re-engage lapsed customers",
        "fine_print": "Limit one per customer",
        "start_at": "2025-06-01T00:00:00Z",
        "end_at": "2025-08-31T23:59:59Z",
        "redeemable_from": "2025-06-01T00:00:00Z",
        "redeemable_to": "2025-09-30T23:59:59Z",
        "variants": [
          {
            "name": "Treatment",
            "reward_template_id": "abc123def456"
          },
          {
            "name": "Control"
          }
        ]
      }
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "campaign": {
      "id": "camp_abc123",
      "name": "Summer Free Coffee",
      "objective": "Re-engage lapsed customers",
      "start_at": "2025-06-01T00:00:00Z",
      "end_at": "2025-08-31T23:59:59Z",
      "redeemable_from": "2025-06-01T00:00:00Z",
      "redeemable_to": "2025-09-30T23:59:59Z",
      "time_zone": "America/Los_Angeles",
      "fine_print": "Limit one per customer",
      "variants": [
        {
          "id": "var_treat1",
          "name": "Treatment",
          "reward_template_id": "abc123def456"
        },
        {
          "id": "var_ctrl1",
          "name": "Control",
          "reward_template_id": null
        }
      ]
    }
  }
  ```
</ResponseExample>
