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

ParameterTypeDescriptionRequirement
campaignIdstringUnique identifier of the campaignrequired

Request Body

{
  "clients": [
    { "phoneNumber": "521234567890", "name": "Juan Pérez" },
    { "phoneNumber": "521234567891", "name": "María García" }
  ]
}

Body parameters

ParameterTypeDescriptionRequirement
clientsarrayList of customers to add. Minimum 1 itemrequired

clients[] object

ParameterTypeDescriptionRequirement
phoneNumberstringPhone number in international formatrequired
namestringCustomer namerequired

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

FieldTypeDescription
addedCountnumberTotal customers processed
createdCountnumberNew customers created in the workspace
updatedCountnumberExisting customers updated with the campaign tag
clientsarrayList 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}.