Introduction

This document contains the API details to send notifications to users on WhatsApp. You can integrate these APIs with your business system/CRM to send notifications based on your business logic. If you are directly reading this, please first refer to Notification Getting Started.


Important links:

  1. Morph.ai API Introduction: Use this to understand the request/response structure, authentication, status/error codes, test API, etc.
  2. Postman Collection: This postman collection contains all the APIs.


Send Notification API


This API can be used to send a notification to any particular user. Apart from sending a notification, you can also update the user's profile.


Request

URL: https://open-api.morph.ai/v1/message/wa/post_session/send/<userPhoneNumber>
Method: POST

Header:
    Authorization: <access_token>
    Content-Type: application/json

Body:
    {
        "accountId": "<account_id>",
        "templateId": "<template_id>",
        "postSessionParams": [
            "param1",
            "param2"
        ],
        "customerData": {
            "<property_title>": "<value>"
        }
    }


Request Parameters
ParameterRequiredTypeDescription
userPhoneNumberYesStringThis is the WhatsApp number of the user you want to send a notification. Please make sure this number is with country code eg. +919626262626
accountIdYesStringThis is the business WhatsApp account id. You can find this from the platform Nurture>API.
templateIdYesStringThis is the id of the template which you want to send to your user. You can find this from the platform Nurture>API.
postSessionParamsYesArray of StringIf the template contains the dynamic parameters, then you have to pass the parameters in this. This is an ordered list means the params in this array should appear in the same order of the notification template. Also, if you skip this while sending the notification, the value will be picked from the user's profile on Morph.ai.
customerDataOptionalNested ObjectYou can use this to also update the customer properties. You can pass any property you want to update. 


customerData
ParameterRequiredTypeDescription
<property_title>YesStringThe name of the property you want to update.
<value>YesString/NumberThe value you want to update the property with.


Response

{
  "status": "success"
}