POST
/
campaigns
curl --request POST \
  --url https://v2.firstpromoter.com/api/v2/company/campaigns \
  --header 'Account-ID: <account-id>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "landing_url": "<string>",
  "ref_token_param": "?fpr",
  "color": "<string>",
  "visitor_cookie_life": 123,
  "auto_approve_promoters": true,
  "is_private": true,
  "track_ad_traffic": "pending",
  "links": [
    {
      "id": 123,
      "name": "<string>",
      "url": "<string>",
      "_destroy": true
    }
  ],
  "upgrade_details": {
    "campaign_id": 123,
    "amount": 123,
    "metric": "customers"
  },
  "rewards_for_promoters": [
    {
      "apply_on": "monthly",
      "product_ids": [
        "<any>"
      ],
      "reward_id": 123
    }
  ],
  "rewards_for_referrals": [
    {
      "apply_on": "monthly",
      "product_ids": [
        "<any>"
      ],
      "reward_id": 123
    }
  ]
}'
{
  "id": 123,
  "name": "<string>",
  "color": "<string>",
  "stats": {
    "referrals_count": 123,
    "sales_count": 123,
    "customers_count": 123,
    "promoters_count": 123,
    "revenue_amount": 123
  },
  "landing_url": "<string>",
  "visitor_cookie_life": 123,
  "ref_token_param": "<string>",
  "auto_approve_leads": true,
  "track_ad_traffic": "pending",
  "auto_approve_promoters": true,
  "is_private": true,
  "is_default": true,
  "upgrade_details": {
    "campaign_id": 123,
    "amount": 123,
    "metric": "customers",
    "move_referrals_on_level_change": true
  },
  "signup_url": "<string>",
  "links": [
    {
      "id": 123,
      "name": "<string>",
      "url": "<string>"
    }
  ],
  "rewards_for_promoters": [
    {
      "apply_on": "monthly",
      "product_ids": [
        123
      ],
      "reward_id": 123,
      "reward": {
        "name": "<string>",
        "promoter_reward_type": "<string>",
        "hide_reward": true,
        "tier_level": 123,
        "coupon": "<string>"
      },
      "products": [
        {
          "id": 123,
          "name": "<string>"
        }
      ]
    }
  ],
  "rewards_for_referrals": [
    {
      "apply_on": "monthly",
      "product_ids": [
        123
      ],
      "reward_id": 123,
      "reward": {
        "name": "<string>",
        "promoter_reward_type": "<string>",
        "hide_reward": true,
        "tier_level": 123,
        "coupon": "<string>"
      },
      "products": [
        {
          "id": 123,
          "name": "<string>"
        }
      ]
    }
  ]
}

Authorizations

Authorization
string
header
required

Access token passed as a Bearer token in the Authorization header

Headers

Account-ID
string
required

Account identifier that specifies which account is making the request

Example:

"acc_123456"

Body

application/json

Response

201
application/json

Campaign created successfully

The response is of type object.