Add Campaign Audience
Add customers to a campaign's audience. If a customer does not exist in the workspace, it is created automatically with the data provided.
POST https://api.platica.mx/v1/campaigns/{campaignId}/audience
URL parameters
| Parameter | Type | Description | Requirement |
campaignId | string | Unique identifier of the campaign | required |
Request Body
{
"clients": [
{ "phoneNumber": "521234567890", "name": "Juan Pérez" },
{ "phoneNumber": "521234567891", "name": "María García" }
]
}
Body parameters
| Parameter | Type | Description | Requirement |
clients | array | List of customers to add. Minimum 1 item | required |
clients[] object
| Parameter | Type | Description | Requirement |
phoneNumber | string | Phone number in international format | required |
name | string | Customer name | required |
Response
{
"status": "success",
"message": "2 client(s) added to campaign (1 created, 1 updated)",
"data": {
"addedCount": 2,
"createdCount": 1,
"updatedCount": 1,
"clients": [
{ "phoneNumber": "521234567890", "name": "Juan Pérez" },
{ "phoneNumber": "521234567891", "name": "María García" }
]
}
}
Response fields
| Field | Type | Description |
addedCount | number | Total customers processed |
createdCount | number | New customers created in the workspace |
updatedCount | number | Existing customers updated with the campaign tag |
clients | array | List of customers sent in the request |
Notes
- If the customer already exists (same
phoneNumber), their name is updated and the campaign tag is added. - If the customer does not exist, a minimal record is created with
phoneNumber, name, tags, owners, customFields, creationDate, and lastUpdate. - The tag assigned to the customers has the format
campaign-{campaignId}.