Skip to main content

Create New Campaign

Endpoint

POST /api/v6.1/campaign

Request Example

curl --location '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 '{
"campaign_name": "Campaign looking at the day, looking at the rain in a hurry",
"campaign_code": "YEUDI",
"responsible_username": "linhvidai",
"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 }
],
"opportunity_status": [
{ "status_id": 29, "name": "Go meet and greet", "description": "", "order": 1 },
{ "status_id": 30, "name": "Get full information from each other", "description": "", "order": 2 },
{ "status_id": 31, "name": "Friendly chat", "description": "", "order": 3 },
"status_id": 32, "name": "Sound out the opponent, wait for a signal", "description": "", "order": 4 },
{ "status_id": null, "name": "Confess hehehehehe", "description": "", "order": 4 }
]
}'

Required Data Fields (JSON body)

FieldTypeRequiredDescription
campaign_namestring✔️Campaign name
campaign_codestring✔️Unique campaign code
responsible_usernamestring✔️Responsible person's username
descriptionstring✖️Campaign description
time_registedint✖️Registration time (default = 0)
auto_divide_oppint✖️Automatically divide opportunities (1 = yes)
hide_infoint✖️Hide campaign information (1 = yes)
is_lockint✖️Lock campaign (1 = yes)
allow_duplicate_oppint✖️Allow duplicate opportunities (1 = yes)
related_usersarray✔️List of related users
opportunity_statusarray✔️List of opportunity steps in the pipeline
FieldTypeDescription
user_usernamestringRelated user's username
accept_oppintAccept opportunity (1 = yes)

opportunity_status Object

FieldTypeDescription
status_idint hoặc nullStatus ID (null if new)
namestringProcess step name
descriptionstringDescription (optional)
orderintDisplay order

Sample Response

{
"message": "Successfully added",
"data": {
"id": 29,
"campaign_name": "Campaign looking at the day, looking at the rain in a hurry",
"campaign_code": "YEUDI",
"description": "Looking at the day, looking at the rain in a hurry,...who is overflowing",
"responsible": 2,
"create_user": 1,
"time_registed": 0,
"auto_divide_opp": 1,
"hide_info": 0,
"is_lock": 0,
"allow_duplicate_opp": 1,
"token_api": "GQKeucYQgm",
"created_at": 1751012986,
"updated_at": 1751012986,
"topic_id": 29,
"related_users": [
{ "accept_opp": 1, "user_id": 2 },
{ "accept_opp": 1, "user_id": 1 }
],
"opportunity_status": [
{ "status_id": 29, "name": "Go meet and greet", "order": 1 },
{ "status_id": 30, "name": "Get full information from each other", "order": 2 },
{ "status_id": 31, "name": "Friendly chat", "order": 3 },
{ "status_id": 32, "name": "Sound out the opponent, wait for a signal", "order": 4 },
{ "status_id": null, "name": "Confess hehehehehe", "order": 4 }
]
}
}

Notes

  • If status_id is null, the system will automatically create a new step.
  • token_api is a code used to connect to related systems or quickly access campaigns.
  • Each campaign must have at least 1 related user and 1 opportunity step.