PATCH/ point-campaign/ :id/
Update point campaign
You can update a specific point campaign.
Attributes
Optional unless marked required
- id
- A unique identifier for the point campaign which is given by User
- name
- A point campaign name.
- start_date
- A datetime when point campaign starts (in UNIX format).
- end_date
- A datetime when point campaign ends (in UNIX format).
- created_at
- A datetime of point campaign creation.
- status
- A point campaign status: Draft = 1, Pending = 2, Active = 3, Finished = 4
- assigned_events
- A counted value based on events assigned to the Point Acquire Rule and Point Exchange Rule.
- assigned_product_events
- A counted value based on product events assigned to the Point Acquire Rule and Point Exchange Rule.
- revenue_goal
- A sum from all transactions (points) generated by users.
- query_map
- A valid JSON object with a definition of Engagement groups (filters).
Request
- cURL
- JavaScript
- PHP
- Python
curl -X PATCH "https://<your_app_subdomain>.user.com/api/public/point-campaign/:id/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2" \
-H "Content-Type: application/json" \
-d '{
"name": "Spring loyalty campaign",
"revenue_goal": 1500
}'
const response = await fetch(
"https://<your_app_subdomain>.user.com/api/public/point-campaign/:id/",
{
method: "PATCH",
headers: {
Authorization: "Token <your_64_char_api_key>",
Accept: "*/*; version=2",
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Spring loyalty campaign",
revenue_goal: 1500,
}),
},
);
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://<your_app_subdomain>.user.com/api/public/point-campaign/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: Token <your_64_char_api_key>",
"Accept: */*; version=2",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"name" => "Spring loyalty campaign",
"revenue_goal" => 1500,
]),
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
response = requests.patch(
"https://<your_app_subdomain>.user.com/api/public/point-campaign/:id/",
headers={
"Authorization": "Token <your_64_char_api_key>",
"Accept": "*/*; version=2",
},
json={
"name": "Spring loyalty campaign",
"revenue_goal": 1500,
},
)
print(response.json())
Response examples
- 200 OK
- 404 Not Found
{"id": 12,"name": "Spring loyalty campaign","start_date": "2026-11-10T09:38:40+01:00","end_date": "2026-12-10T09:38:40+01:00","created_at": "2026-11-10T08:38:40.641230Z","status": 1,"assigned_events": [],"assigned_product_events": [],"revenue_goal": 1500,"query_map": {}}{
"detail": "No PointCampaign matches the given query."
}
Response fields
Fields returned in the 200 OK response body.
- id
- A unique identifier for the point campaign which is given by User
- name
- A point campaign name.
- start_date
- A datetime when point campaign starts (in UNIX format).
- end_date
- A datetime when point campaign ends (in UNIX format).
- created_at
- A datetime of point campaign creation.
- status
- A point campaign status: Draft = 1, Pending = 2, Active = 3, Finished = 4
- assigned_events
- A counted value based on events assigned to the Point Acquire Rule and Point Exchange Rule.
- assigned_product_events
- A counted value based on product events assigned to the Point Acquire Rule and Point Exchange Rule.
- revenue_goal
- A sum from all transactions (points) generated by users.
- query_map
- A valid JSON object with a definition of Engagement groups (filters).
note
Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.