Skip to content

Bulk Add Contacts and Send SMS

This API allows you to add multiple contacts in bulk to your Cellcast account and send SMS to those contacts at the same time.

Parameters for Bulk Add Contacts and Send SMS API

Headers Parameters

ParametersDescription
AuthorizationPlease add provided Bearer token - linked to your Cellcast account. Check here

Request Body Parameters

NameExampleDescription
contacts[{"first_name": "John","last_name": "Doe","phone_number": "+61400000000","birthday": "1990-05-14","address": "123 Main St, Sydney, NSW","email": "[email protected]","postal_code": "2000","gender": "male","purchase": "paypal"}]The body of the request should contain an array of contact objects. Each contact object can include the following properties:

- first_name: The first name of the contact.
- last_name: The last name of the contact.
- phone_number: The phone number of the contact.
- birthday: The birth date of the contact.
- address: The address of the contact.
- email: The email of the contact.
- postal_code: The postal code of the contact.
- gender: The gender of the contact.
- purchase: The purchase information of the contact.
tags[ "Example Tag", "New User Tag" ]Include this in your request to add Tags to the uploaded contacts. You can add multiple tags to the contacts.
list[ "Example List", "New User List" ]Include this in your request to add the uploaded contacts into Lists. You can add the contacts to multiple Lists.
sender#SharedNum# or Sender ID (Custom ID)Sender ID (Custom ID): Valid characters: A-Z a-z 0-9, space, and Dash (-). A numeric sender ID can be a maximum length of 16 digits. An alpha-numeric Sender ID can be a maximum length of 11 characters. If 'sender' is left blank, the system will default to '#SharedNum#'. *Note: Price increases to 1.3 credits per SMS for Custom ID and dedicated numbers.
senderType['customNumber', 'businessName', 'dedicatedNumber', '#SharedNum#']'customNumber' - Your Own Number. 'businessName' - Alpha ID. 'dedicatedNumber' - For using Dedicated Number. '#SharedNum#' - Standard shared number is a set of local numbers.
messageSMS Text goes hereString - Required field. To add a new line to the message, use "\r\n" in the message string with only double quotes.

Code Samples

Post https://api.cellcast.com/api/v1/contact/create-and-send

bash

curl --location 'https://api.cellcast.com/api/v1/contact/create-and-send' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{API_KEY}}' \
--data-raw '{
    "contacts": [
        {
            "first_name": "John",
            "last_name": "Cen A",
            "phone_number": "+61400000000",
            "birthday": "1990-05-14",
            "address": "123 Main St, Sydney, NSW",
            "email": "[email protected]",
            "postal_code": "2000",
            "gender": "male",
            "purchase": "paypal"
        },
        {
            "first_name": "Jane",
            "last_name": "Pilate",
            "phone_number": "+61400000001",
            "birthday": "1988-11-23",
            "address": "456 High St, Melbourne, VIC",
            "email": "[email protected]",
            "postal_code": "3000",
            "gender": "female",
            "purchase": "mastercard"
        }
    ],
    "tags": [
        "Test Tag",
        "Test2Tag"
    ],
    "list": [
        "Test List", "Test2List"
    ],
    "messageData": {
        "sender": "+61400000000",
        "senderType": "dedicatedNumber",
        "message": "Test Create Contact and send SMS"
    }
}'

Replace with the actual API key that you own.

Response

200 Success

json
}
    "message": "success",
    "data": {
        "message": "all data success to process",
        "success_data": 2,
        "failed_data": 0,
        "errors": []
    }
}

200 Partial Success

json
}
    "message": "partial_success",
    "data": {
        "message": "The data was successfully processed, but there was some data that was not processed because it was invalid",
        "success_data": 2,
        "failed_data": 2,
        "errors": [
            "contact[1] error : phone_number empty",
            "contact[3] error : phone_number is not valid"
        ]
    }
}

400 Bad Request

json
{
    "message": "fail",
    "data": {
        "message": "fail process data",
        "errors": [
            "contact[0] error : phone_number empty",
            "contact[1] error : phone_number is not valid"
        ]
    }
}