Documentation and APIs

Learn how to use our serverless platform to create voice, video and messaging applications and services by reading our getting started guide. It's the best way to become familiar with the platform architecture and capabilities.

Number Management
SMS
Anonymize
Authenticate – OTP
Authenticate – One Tap Authentication
Engage
WhatsApp
Programmable Voice(India)
Email
Programmable Voice (USA)

Email

Explore our extensive Email API documentation and learn how to execute targeted email blasts, trigger personalized journeys based on user behavior, and other wide range of operations. You can integrate our REST APIs to automate tasks, integrate with other systems, and build custom solutions that drive productivity.

Contact

Create a folder

POST: /v3/contacts/folder

Body Params:
ParamTypeDescriptionExample
NameStringName of the folderTest_folder
Responses:
MethodDescriptionResponse body
200successfully created ID of the folder created

{
    "id": 5
}

400Bad request
CURL:
copy

curl -X POST \ 
    {{baseUrl}}/v3/contacts/folders \ 
    -H 'api-key: {{api-key}}I' \ 
    -d '{
        "name": "{{folder-name}}"
    }'  

Example:
copy

curl -X POST \. 
    {{baseUrl}}/v3/contacts/folders \  
    -H 'api-key: {{api-key}}I' \ 
    -d '{
        "name": "test_folder"
    }' 

Create a list

POST: /v3/contacts/lists

Body Params:
ParamTypeDescriptionExample
NameStringName of the listTest_list
folderIdIntegerId of the parent folder in which this list is to be created5
Responses:
MethodDescriptionResponse body
200successfully created ID of the list created

{
    "id": 16
}

400Bad request
CURL:
copy

curl -X POST \ 
    {{baseUrl}}/v3/contacts/lists \ 
    -H 'api-key: {{api-key}}' \ 
    -d '{
        "name": "{{list name}}",
        "folderId": {{folder id}}
    }' 

Example:
copy

curl -X POST \ 
    {{baseUrl}}/v3/contacts/lists \ 
    -H 'api-key: {{api-key}}' \ 
    -d '{
        "name": "test_list",
        "folderId": 5
    }'

Create a contact

POST: /v3/contacts

Body Params:
ParamTypeDescriptionExample
EmailStringEmail address of the user. Mandatoryelly@example.com
ext_idStringPass your own Id to create a contact.
attributesObjectPass the set of attributes and their values. The attribute’s parameter should be passed in capital letter while creating a contact. These attributes must be present in your account.

{
    "FNAME": "Elly",
    "LNAME": "Roger"
}

emailBlacklistedBooleanSet this field to blacklist the contact for emailsTrue
smsBlacklistedBooleanSet this field to blacklist the contact for SMStrue
listIdsArray of integersIds of the lists to add the contact to[36, 68]
updateEnabledBooleanFacilitate to update the existing contact in the same requesttrue
smtpBlacklistSenderArray of Stringstransactional email forbidden sender for contact. Use only for email Contact.
( only available if updateEnabled = true )
[“user@example.com”]
Responses:
MethodDescriptionResponse body
201Description

{
    "id": 21
}

204Contact updated
400Bad request
CURL:
copy

curl -X POST \ 
    {{baseUrl}}/v3/contacts \ 
    -H 'api-key: {{api-key}}' \ 
    -d '{
        "email": "{{receiver-email}]",
        "ext_id": "{{externalId}}",
        "attributes": {
            "FNAME": "{{receiver-firstname}}",
            "LNAME": "{{receiver-lastname}}"
        },
        "emailBlacklisted": false,
        "smsBlacklisted": false,
        "listIds": [{{listId}}],
        "updateEnabled": false,
        "smtpBlacklistSender": [
            "{{blacklisted-email}}"
        ]
    }'

Example:
copy

curl -X POST \ 
    {{baseUrl}}/v3/contacts \ 
    -H 'api-key: {{api-key}}' \ 
    -d '{
        "email": "elly@example.com",
        "ext_id": "externalId",
        "attributes": {
            "FNAME": "Elly",
            "LNAME": "Roger"
        },
        "emailBlacklisted": false,
        "smsBlacklisted": false,
        "listIds": [
            36
        ],
        "updateEnabled": false,
        "smtpBlacklistSender": [
            "user@example.com"
        ]
    }'  

Import contact

It returns the background process ID which on completion calls the notify URL that you have set in the input.

POST: /v3/contacts

Body Params:
ParamTypeDescriptionExample
fileUrlurlMandatory if fileBody and jsonBody is not defined. URL of the file to be imported (no local file). Possible file formats:
.txt, .csv, .json
https://importfile.domain.com
fileBodyStringMandatory if fileUrl and jsonBody is not defined. CSV content to be imported. Use semicolon to separate multiple attributes. Maximum allowed file body size is 10MB . However we recommend a safe limit of around 8 MB to avoid the issues caused due to increase of file body size while parsing. Please use fileUrl instead to import bigger files.NAME; SURNAME; EMAIL
Smith; John; john.smith@example.com
Roger; Ellie; ellie36@example.com
jsonBodyarray of objectsMandatory if fileUrl and fileBody is not defined. JSON content to be imported. Maximum allowed json body size is 10MB . However we recommend a safe limit of around 8 MB to avoid the issues caused due to increase of json body size while parsing. Please use fileUrl instead to import bigger files.

[
    {
        "email": "ndicky0@ocn.ne.jp",
        "attributes": {
            "LNAME": "Noemi",
            "FNAME": "Dicky",
            "COUNTRY": "DE",
            "BIRTHDAY": "11/02/1989",
            "PREFERED_COLOR": "BLACK"
        }
    }
]

listIdsArray of integersMandatory if newList is not defined. Ids of the lists in which the contacts shall be imported.[2, 4, 7]
notifyUrlurlURL that will be called once the import process is finishedhttp://requestb.in/173lyyx1
listIdsArray of integersIds of the lists to add the contact to[36, 68]
newListobjectTo create a new list and import the contacts into it, pass the listName and an optional folderId.

{
    "listName": "ContactImport - 2017-05",
    "folderId": 2
}

emailBlacklistBooleanTo blacklist all the contacts for email
disableNotificationBooleanTo disable email notification
smsBlacklistBooleanTo blacklist all the contacts for sms
updateExistingContactsBooleanTo facilitate the choice to update the existing contacts
emptyContactsAttributesBooleanTo facilitate the choice to erase any attribute of the existing contacts with empty value.
emptyContactsAttributes = true means the empty fields in your import will erase any attribute that currently exists, & emptyContactsAttributes = false means the empty fields will not affect your existing data ( only available if updateExistingContacts set to true )
Responses:
MethodDescriptionResponse body
200process id created

{
    "processId": 78
}

400Bad request

{
    "code": "method_not_allowed",
    "message": "POST Method is not allowed on this path"
}

CURL:
copy

curl -X POST \ 
    {{baseUrl}}/v3/contacts/import \ 
    -H 'api-key: {{api-key}}' \ 
    -d '{
        "fileUrl": "https://importfile.domain.com",
        "fileBody": "NAME;SURNAME;EMAIL ",
        "jsonBody": [
            {
                "email": "{{receiver-email}]",
                "attributes": {
                    "FNAME": "{{receiver-firstname}}",
                    "LNAME": "{{receiver-lastname}}"
                }
            }
        ],
        "listIds": [
            {{list_id}}
        ],
        "notifyUrl": {{notify_url}},
        "newList": {
            "listName": {{list_name}},
            "folderId": {{folder_id}}
        },
        "emailBlacklist": false,
        "disableNotification": false,
        "smsBlacklist": false,
        "updateExistingContacts": true,
        "emptyContactsAttributes": true
    }'

Example:
copy

curl -X POST \ 
    {{baseUrl}}/v3/contacts/import \ 
    -H 'api-key: {{api-key}}' \ 
    -d '{
        "fileUrl": "https://importfile.domain.com",
        "fileBody": "NAME;SURNAME;EMAIL\nSmith;John;john.smith@example.com\nRoger;Ellie;ellie36@example.com",
        "jsonBody": [
            {
                "email": "ndicky0@ocn.ne.jp",
                "attributes": {
                    "LNAME": "Noemi",
                    "FNAME": "Dicky",
                    "COUNTRY": "DE",
                    "BIRTHDAY": "11/02/1989",
                    "PREFERED_COLOR": "BLACK"
                }
            }
        ],
        "listIds": [
            76
        ],
        "notifyUrl": "http://requestb.in/173lyyx1",
        "newList": {
            "listName": "ContactImport - 2017-05",
            "folderId": 2
        },
        "emailBlacklist": false,
        "disableNotification": false,
        "smsBlacklist": false,
        "updateExistingContacts": true,
        "emptyContactsAttributes": true
    }'  

Get list in folder

GET: /v3/contacts/folders/{folderId}/lists

Path Params:
ParamTypeDescriptionExample
folderIdIntegerId of the parent folder in which this list exists.16
Query Params:
ParamTypeDescriptionExample
LimitIntegerNumber of documents per page10
OffsetIntegerIndex of the first document of the page0
SortStringSort the results in the ascending/descending order of record creation. Default order is descending if sort is not passeddesc
Responses:
MethodDescriptionResponse body
200Folder’s Lists details

{
    "lists": [
        {
            "id": 46,
            "name": "Reactiv",
            "totalSubscribers": 7655,
            "totalBlacklisted": 0,
            "uniqueSubscribers": 7655
        }
    ],
    "count": 1
}

400Bad request
404Folder ID not found
CURL:
copy

curl -X GET \ '{{baseUrl}}/v3/contacts/folders/{{folder_id}}/lists' \ 
    -H 'api-key: {{api-key}}' \ 

Example:
copy

curl -X GET \ 
    '{{baseUrl}}/v3/contacts/folders/16/lists' \ 
    -H 'api-key: {{api-key}}' \  

Get list info

GET: /v3/contacts/lists/{listId}

Path Params:
ParamTypeDescriptionExample
listIdIntegerId of the list16
Responses:
MethodDescriptionResponse body
200Folder’s Lists details

{
    "id": 16,
    "name": "Newsletter_Weekly",
    "totalSubscribers": 6533,
    "totalBlacklisted": 63,
    "uniqueSubscribers": 6596,
    "folderId": 1,
    "createdAt": "2016-02-26T11:56:08Z",
    "campaignStats": [
        {
            "campaignId": 15,
            "stats": {
                "uniqueClicks": 701,
                "clickers": 789,
                "complaints": 0,
                "delivered": 6632,
                "sent": 6645,
                "softBounces": 34,
                "hardBounces": 4,
                "uniqueViews": 3442,
                "unsubscriptions": 4,
                "viewed": 4322,
                "deferred": 0
            }
        }
    ],
    "dynamicList": false
}

400Bad request
404List ID not found
CURL:
copy

curl -X GET \ 
    '{{baseUrl}}/v3/contacts/lists/{{list_id}}' \ 
    -H 'api-key: {{api-key}}' \ 

Example:
copy

curl -X GET \ 
    '{{baseUrl}}/v3/contacts/lists/16' \ 
    -H 'api-key: {{api-key}}' \  

Get all contacts

GET: /v3/contacts/

Query Params:
ParamTypeDescriptionExample
LimitIntegerNumber of documents per page10
OffsetIntegerIndex of the first document of the page0
modifiedSinceStringFilter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
createdSinceStringFilter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
SortStringSort the results in the ascending/descending order of record creation. Default order is descending if sort is not passeddesc
Responses:
MethodDescriptionResponse body
200All contacts listed

{
    "contacts": [
        {
            "email": "contact1@example.com",
            "id": 247,
            "emailBlacklisted": true,
            "smsBlacklisted": true,
            "createdAt": "2017-05-01T17:05:03Z",
            "modifiedAt": "2017-05-01T17:05:03Z",
            "listIds": [
                43,
                58
            ]
        }
    ],
    "count": 1
}

400Bad request
CURL:
copy

curl -X GET \ 
    {{baseUrl}}/v3/contacts \ 
    -H 'api-key: {{api-key}}' \ 

Get contacts in list

GET: /v3/contacts/folders/{folderId}/lists

Path Params:
ParamTypeDescriptionExample
listIdIntegerId of the list16
Query Params:
ParamTypeDescriptionExample
modifiedSinceStringFilter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
LimitIntegerNumber of documents per page10
OffsetIntegerIndex of the first document of the page0
SortStringSort the results in the ascending/descending order of record creation. Default order is descending if sort is not passeddesc
Responses:
MethodDescriptionResponse body
200Contact informations

{
    "contacts": [
        {
            "email": "alex.pain@example.com",
            "id": 45,
            "emailBlacklisted": false,
            "smsBlacklisted": true,
            "createdAt": "2017-05-12T12:30:00Z",
            "modifiedAt": "2017-05-12T12:30:00Z",
            "listIds": [
                12,
                9,
                20
            ],
            "listUnsubscribed": [
                1,
                2
            ],
            "attributes": {
                "LASTNAME": "Pain",
                "FIRSTNAME": "Alex",
                "DOB": "2010-12-31",
                "GENDER": "Kid"
            }
        }
    ],
    "count": 17655
}

400Bad request
404List ID not found
CURL:
copy

curl -X GET \ 
    '{{baseUrl}}/v3/contacts/lists/{{List_id}}/contacts' \ 
    -H 'api-key: {{api-key}}' \  

Example:
copy

curl -X GET \ 
    '{{baseUrl}}/v3/contacts/lists/18/contacts' \ 
    -H 'api-key: {{api-key}}' \  

What’s New