POST
/
campaigns
curl --request POST \
  --url https://app.masivo.ai/api/storefront/v1/campaigns \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "brand_id": "<string>",
  "name": "<string>",
  "description": "<string>",
  "type": "BEHAVIOR",
  "rules": [
    {
      "conditions": [
        [
          {
            "type": "Order Value",
            "operator": "grater than",
            "primitive": "string",
            "value": 9.95
          }
        ]
      ],
      "effects": [
        {
          "reward_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "type": "POINTS",
          "tier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "reward": {
            "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
            "brand_id": "<string>",
            "name": "<string>",
            "description": "<string>",
            "type": "POINTS",
            "conditions": [
              [
                {
                  "type": "Order Value",
                  "operator": "grater than",
                  "primitive": "string",
                  "value": 9.95
                }
              ]
            ],
            "attributes": {
              "conversion_factor": 0.1
            }
          },
          "expiration_date": "12/months",
          "amount": 1
        }
      ]
    }
  ],
  "attributes": {
    "trigger": "PURCHASE",
    "privacy": "PRIVATE"
  },
  "status": "RUNNING",
  "start_date": "2023-11-07T05:31:56Z",
  "end_date": "2023-11-07T05:31:56Z",
  "funded_by": "<string>",
  "budget": 1000
}'
{
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "brand_id": "<string>",
    "name": "<string>",
    "description": "<string>",
    "type": "BEHAVIOR",
    "rules": [
      {
        "conditions": [
          [
            {
              "type": "Order Value",
              "operator": "grater than",
              "primitive": "string",
              "value": 9.95
            }
          ]
        ],
        "effects": [
          {
            "reward_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
            "type": "POINTS",
            "tier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
            "reward": {
              "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
              "brand_id": "<string>",
              "name": "<string>",
              "description": "<string>",
              "type": "POINTS",
              "conditions": [
                [
                  {
                    "type": "Order Value",
                    "operator": "grater than",
                    "primitive": "string",
                    "value": 9.95
                  }
                ]
              ],
              "attributes": {
                "conversion_factor": 0.1
              }
            },
            "expiration_date": "12/months",
            "amount": 1
          }
        ]
      }
    ],
    "attributes": {
      "trigger": "PURCHASE",
      "privacy": "PRIVATE"
    },
    "status": "RUNNING",
    "start_date": "2023-11-07T05:31:56Z",
    "end_date": "2023-11-07T05:31:56Z",
    "funded_by": "<string>",
    "budget": 1000
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
brand_id
string | null

The brand id of the campaign, null if is a global campaign

name
string

The name of the campaign

description
string

The description of the campaign

type
enum<string>

The type of the campaign

Available options:
BEHAVIOR,
COUPONS
rules
object[]
attributes
object

The attributes of the campaign

status
enum<string>

The status of the campaign

Available options:
RUNNING,
PAUSED,
SCHEDULED,
FINISHED
start_date
string

The start date of the campaign

end_date
string | null

The end date of the campaign

funded_by
string | null

Who is funding these campaign

budget
number

The budget of the campaign

Example:

1000

Response

201
application/json
Campaign created
data
object