# Create point campaign

You can create a new point campaign.

POST /point-campaign/

Attributes Type Required Description
id integer no A unique identifier for the point campaign which is given by User.com
name string yes A point campaign name.
start_date datetime no A datetime when point campaign starts (YYYY-MM-DDThh:MM[:ss[.uuuuuu]][+HH:MM|-HH:MM|z] format).
end_date datetime no A datetime when point campaign ends (YYYY-MM-DDThh:MM[:ss[.uuuuuu]][+HH:MM|-HH:MM|z] format).
created_at datetime no A datetime of point campaign creation.
status integer no A point campaign status: Draft = 1, Pending = 2, Active = 3, Finished = 4
assigned_events integer no A counted value based on events assigned to the Point Acquire Rule and Point Exchange Rule.
assigned_product_events integer no A counted value based on product events assigned to the Point Acquire Rule and Point Exchange Rule.
revenue_goal integer no A sum from all transactions (points) generated by users.
query_map object no A valid JSON object with a definition of Engagement groups (filters).

# Request

  • CURL
  • JavaScript
  • PHP
  • Python
curl --location --request POST 'https://<your_app_subdomain>.user.com/api/public/point-campaign/' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token <your_64_char_api_key>' \
--header 'Accept: */*; version=2' \
--data-raw '{  "name": "string",  "start_date": "2022-03-09T13:18:42.359Z",  "end_date": "2022-03-09T13:18:42.359Z",  "assigned_events": [    0  ],  "assigned_product_events": [    0  ],  "revenue_goal": 0,  "query_map": {}}'

# Response

{
  "id": 4,
  "name": "string",
  "start_date": "2022-03-09T13:18:42.359000Z",
  "end_date": "2022-03-09T13:18:42.359000Z",
  "created_at": "2022-03-17T12:08:43.620642Z",
  "status": 1,
  "assigned_events": [0],
  "assigned_product_events": [0],
  "revenue_goal": 0,
  "query_map": {}
}