#Add contacts bulk

Add new contacts in bulk. When a given phone number already exists, it updates existing contact. If existing contact gets updated, all information gets overwritten, including all extra fields.

#Method

POST

#Path

/contacts/bulk

#Body parameters

NameValueData typeRequired?
list_id0 - to add to "All Contacts" or
List ID - to add to a contact list (Use /lists endpoint to get all the contact lists)
IntegerNo (defaults to 0)
phone_number_ccPhone number country dial code (e.g. "1")StringNo
recordsSee belowArrayYes

#records

The 'records' field is supposed to be an array of up to 10,000 contacts. Each item in the array should be as below.

NameValueData typeRequired?
phone_numberPhone number starting with the country code with or without leading plus. e.g. +16175551212 or 16175551212StringYes
nameContact person nameStringNo
extra_fieldsKey value pair object with additional custom fields (e.g. { "email_address": "john@example.com", "id": 987123 })ObjectNo

#Response

#HTTP status codes

CodeRemarks
200Request was successful.
400Validation error or request body was incorrectly formatted.
401Authentication failed. Check apikey header.
404Requested API endpoint not found.
429The rate limit has been reached.
500-511There was a problem processing the request on our server. Try again later.

#Response object

NameValueRemarks
statussuccess or error-
errorsArray of object { msg: [error detail] }Only present when status is error.

#Code sample

curl --location --request POST 'https://api.sociocs.com/contacts/bulk' \ --header 'apikey: your_api_key' \ --header 'Content-Type: application/json' \ --data-raw '{ "list_id": 0, "phone_number_cc": "1", "records": [ { "phone_number": "16175551212", "name": "John Johnson", "extra_fields": { "email_address": john@example.com } }, { "phone_number": "16175551111", "name": "David Davidson", "extra_fields": { "email_address": david@example.com } } ] }'