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)
Field | Type | Required | Description |
---|---|---|---|
campaign_name | string | ✔️ | Campaign name |
campaign_code | string | ✔️ | Unique campaign code |
responsible_username | string | ✔️ | Responsible person's username |
description | string | ✖️ | Campaign description |
time_registed | int | ✖️ | Registration time (default = 0) |
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 steps in the pipeline |
related_users
Object
Field | Type | Description |
---|---|---|
user_username | string | Related user's username |
accept_opp | int | Accept opportunity (1 = yes) |
opportunity_status
Object
Field | Type | Description |
---|---|---|
status_id | int hoặc null | Status ID (null if new) |
name | string | Process step name |
description | string | Description (optional) |
order | int | Display 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
isnull
, 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.