# Update or create point campaign
You can update a specific point campaign or create if it doesn't exist.
PUT
/point-campaign/:id/
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 (in UNIX format). |
end_date | datetime | no | A datetime when point campaign ends (in UNIX 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 PUT 'https://<your_app_subdomain>.user.com/api/public/point-campaign/1/' \
--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:30:58.496Z", "end_date": "2022-03-09T13:30:58.496Z", "assigned_events": [ 0 ], "assigned_product_events": [ 0 ], "revenue_goal": 0, "query_map": {}}'
# Response
{
"id": 1,
"name": "string",
"start_date": "2022-03-09T13:30:58.496000Z",
"end_date": "2022-03-09T13:30:58.496000Z",
"created_at": "2022-03-09T13:56:21.520067Z",
"status": 1,
"assigned_events": [0],
"assigned_product_events": [0],
"revenue_goal": 0,
"query_map": {}
}