Skip to main content
PUT/sms-campaign/:id/

Add recipient SMS campaign

You can add recipients to an existing SMS campaign.

caution

Like Create SMS campaign, this endpoint needs a Twilio sender number (phone_number, with provider "Twilio"), and User no longer offers Twilio. It works only in workspaces that still have a Twilio number. Otherwise, create SMS campaigns in the panel; you can still list, read and delete them through the API.

Attributes

Optional unless marked required

idintegerrequired
ID of the campaign, in the path. Only draft campaigns (status 1) can be changed; others return 405.
recipientsarray of integersrequired
Contact IDs (id from the User model) to send the campaign to. Contacts without a phone number are skipped, and contacts sharing a phone number count once. They are added to the campaign's current recipients.
phone_numberobjectrequired
Same object as in Create SMS campaign. It must be sent, but it doesn't change the campaign's sender number; a number the workspace doesn't have yet is still added and charged.

Other fields in the body are ignored: this endpoint only adds recipients.

Request​

curl -X PUT "https://<your_app_subdomain>.user.com/api/public/sms-campaign/:id/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2" \
-H "Content-Type: application/json" \
-d '{
"phone_number": {
"provider": "Twilio",
"phone_number": "+48500100200",
"name": "Main sender"
},
"recipients": [
5,
6,
7,
8
]
}'

Response examples​

{
"id": 8,
"name": "Sample SMS campaign",
"description": "",
"app": 1,
"phone_number": {
"id": 3,
"app": 1,
"provider": "Phone number provider",
"country": "",
"phone_number": "123123123",
"name": "Custom name of your phone number",
"description": "",
"sms": false,
"voice": false,
"price": "0.00",
"last_used_at": null,
"created_at": "2018-02-19T13:01:41.083625Z",
"updated_at": "2018-02-19T13:01:41.083655Z",
"record_incoming_calls": false
},
"type": 1,
"eta": null,
"status": 1,
"recipients": [
1,
2,
3,
4,
5,
6,
7,
8
],
"recipients_ids": "[1,2,3,4,5,6,7,8]",
"recipients_count": 8,
"started_at": null,
"last_message_sent_at": null,
"finished_at": null,
"author": 1,
"created_at": "2018-02-19T13:01:41.097096Z",
"updated_at": "2018-02-19T13:01:41.097126Z"
}
note

Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.