Update Campaign
Endpoint
PUT /api/v6.1/campaign
Request Example
curl --location --request PUT 'https://demo.getflycrm.com/api/v6.1/campaign' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: ADP8QgZR2f0dd6ryjfrXQhtM38Z7MP' \
--header 'Cookie: v6_getflycrm_session=utvHrfLkNPOhNIF34iyKhtbCqpRf2Ji2CGCUlYBJ' \
--data '{
"current_campaign_code": "YEUDI",
"campaign_name": "Campaign looking at the day, looking at the rain in a hurry",
"campaign_code": "YEUDIMA2",
"responsible_username": "sangkhanh",
"description": "Looking at the day, looking at the rain in a hurry,...who is overflowing",
"time_registed": 0,
"auto_divide_opp": 1,
"hide_info": 0,
"is_lock": 0,
"allow_duplicate_opp": 1,
"related_users": [
{ "user_username": "linhvidai", "accept_opp": 1 },
{ "user_username": "sangkhanh", "accept_opp": 1 },
{ "user_username": "trandinhcuong", "accept_opp": 0 }
],
"opportunity_status": [
{ "status_id": 51, "name": "Go meet and greet", "description": "", "order": 1 },
{ "status_id": 52, "name": "Get full information from each other", "description": "", "order": 2 },
{ "status_id": 53, "name": "Friendly chat", "description": "", "order": 3 },
{ "status_id": 54, "name": "Sound out the opponent, wait for a signal", "description": "", "order": 4 },
{ "status_id": 55, "name": "Confess hehehehehe", "description": "", "order": 5 }
]
}'
Required Data Fields (JSON body)
Field | Type | Required | Description |
---|---|---|---|
current_campaign_code | string | ✔️ | Current campaign code to identify the record to update |
campaign_name | string | ✔️ | New campaign name |
campaign_code | string | ✔️ | New campaign code (can be the same as the old code if not changed) |
responsible_username | string | ✔️ | New responsible person's username |
description | string | ✖️ | Campaign description |
time_registed | int | ✖️ | Registration time |
auto_divide_opp | int | ✖️ | Automatically divide opportunities (1 = yes) |
hide_info | int | ✖️ | Hide campaign information (1 = yes) |
is_lock | int | ✖️ | Lock campaign (1 = yes) |
allow_duplicate_opp | int | ✖️ | Allow duplicate opportunities (1 = yes) |
related_users | array | ✔️ | List of related users |
opportunity_status | array | ✔️ | List of opportunity processing statuses |
Sample Response
{
"message": "Update successful",
"data": {
"id": 29,
"campaign_name": "Campaign looking at the day, looking at the rain in a hurry",
"campaign_code": "YEUDIMA2",
"description": "Looking at the day, looking at the rain in a hurry,...who is overflowing",
"time_registed": 0,
"auto_divide_opp": 1,
"hide_info": 0,
"is_lock": 0,
"allow_duplicate_opp": 1,
"opportunity_status": [
{ "status_id": 51, "name": "Go meet and greet", "order": 1 },
{ "status_id": 52, "name": "Get full information from each other", "order": 2 },
{ "status_id": 53, "name": "Friendly chat", "order": 3 },
{ "status_id": 54, "name": "Sound out the opponent, wait for a signal", "order": 4 },
{ "status_id": 55, "name": "Confess hehehehehe", "order": 5 }
],
"responsible": 1,
"related_users": [
{ "accept_opp": 1, "user_id": 2 },
{ "accept_opp": 1, "user_id": 1 },
{ "accept_opp": 0, "user_id": 4 }
],
"updated_at": 1751013215,
"created_at": 1751012986,
"create_user": 1,
"token_api": "GQKeucYQgm",
"topic_id": 29,
"project_id": null,
"campaign_divide_condition": null
}
}
Notes
status_id
must be accurate with existing steps ornull
if adding new.current_campaign_code
is the unique identifier to update the campaign.token_api
andtopic_id
fields are technical information linking other systems if any.