NIT America
Send SMS / MMS
Send an SMS or MMS message to one or more recipients. The message is sent as MMS automatically when an image is attached.
post
EndPoint
POST /message/send/{channelKey}
Parameters
channelKey
*
Sender number key
Parameters Body
destination
Recipient list
phone
*
Recipient phone number in E.164 format (e.g. +19497490579)
params
Per-recipient variable substitution (json: variable name -> value)
title
*
Message title / subject
content
*
Message body
category
*
Use-case category for TCR consent gating. One of: transactional, security, appointments, announcements. A recipient is only delivered to if they opted in to this category.
isTest
*
Test send flag (0: live, 1: test)
channelType
Delivery channel (sms, rcs, whatsapp). Defaults to sms when omitted.
variables
Global variable substitution applied to all recipients (json: variable name -> value)
reserve
Scheduled send flag (0: send now, 1: schedule)
sendDate
Scheduled send time, required when reserve=1 (yyyy-MM-dd HH:mm:ss)
imageFile
Image file name returned by the image upload endpoint (sends as MMS)
isAuth
Authentication / one-time-code message flag (0: no, 1: yes)
Response
- JSON
statusCode
Error code
error
Error message
message
Result message
historyIdx
Send history ID
count
Number of recipients accepted
Example
Request
POST /message/send/{channelKey}
Request Body
{
    "destination": [
        {
            "phone": "+19497490579",
            "params": {
                "name": "Alex"
            }
        }
    ],
    "variables": {
        "company": "NIT America"
    },
    "title": "Order update",
    "content": "Hi #{name}, your #{company} order has shipped.",
    "category": "transactional",
    "channelType": "sms",
    "reserve": 0,
    "isTest": 0
}
description
Response
{
    "historyIdx": 231,
    "count": 1
}
description
Error Response
{
    "statusCode": 400,
    "error": "Bad Request",
    "message": [
        "Message category is required and must be one of: transactional, security, appointments, announcements. (category)"
    ]
}
description
top button
Send RCS
Send a rich RCS message (buttons, card, or carousel) using the same send endpoint with channelType set to rcs. The sender identity is the registered RCS agent; channelKey selects your account's channel.
post
EndPoint
POST /message/send/{channelKey}
Parameters
channelKey
*
Sender number key
Parameters Body
channelType
*
Must be rcs
destination
Recipient list
phone
*
Recipient phone number in E.164 format
params
Per-recipient variable substitution
title
*
Message title
content
*
Fallback / body text
category
*
Use-case category (transactional, security, appointments, announcements)
isTest
*
Test send flag (0: live, 1: test)
rcsOptions
RCS rich content (optional)
buttons
Suggested action buttons: [{ type, text, url?, payload? }]
card
Single rich card: { title, description?, media_url?, orientation? }
carousel
Carousel of cards: [{ title, description?, media_url? }]
Response
- JSON
statusCode
Error code
error
Error message
message
Result message
historyIdx
Send history ID
count
Number of recipients accepted
Example
Request
POST /message/send/{channelKey}
Request Body
{
    "channelType": "rcs",
    "destination": [
        {
            "phone": "+19497490579"
        }
    ],
    "title": "Appointment reminder",
    "content": "Your appointment is tomorrow at 10:00 AM.",
    "category": "appointments",
    "isTest": 0,
    "rcsOptions": {
        "buttons": [
            {
                "type": "openUrl",
                "text": "Reschedule",
                "url": "https://example.com/reschedule"
            }
        ]
    }
}
description
Response
{
    "historyIdx": 232,
    "count": 1
}
description
Error Response
{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "RCS agent is not configured."
}
description
top button
Send WhatsApp
Send a WhatsApp message using the same send endpoint with channelType set to whatsapp. Outside an open 24-hour customer session you must send a pre-approved template. Recipients must have opted in to WhatsApp.
post
EndPoint
POST /message/send/{channelKey}
Parameters
channelKey
*
Sender number key
Parameters Body
channelType
*
Must be whatsapp
destination
Recipient list
phone
*
Recipient phone number in E.164 format
params
Per-recipient variable substitution
title
*
Message title
content
*
Free-form body text (only delivered inside an open 24h session)
category
*
Use-case category (transactional, security, appointments, announcements)
isTest
*
Test send flag (0: live, 1: test)
whatsappTemplate
Pre-approved template (required outside a 24h session)
name
Approved template name (e.g. nit_otp_code)
parameters
Ordered list of positional parameter values
Response
- JSON
statusCode
Error code
error
Error message
message
Result message
historyIdx
Send history ID
count
Number of recipients accepted
Example
Request
POST /message/send/{channelKey}
Request Body
{
    "channelType": "whatsapp",
    "destination": [
        {
            "phone": "+19497490579"
        }
    ],
    "title": "Verification code",
    "content": "Your verification code is 123456.",
    "category": "security",
    "isTest": 0,
    "whatsappTemplate": {
        "name": "nit_otp_code",
        "parameters": [
            "NIT America",
            "123456",
            "10"
        ]
    }
}
description
Response
{
    "historyIdx": 233,
    "count": 1
}
description
Error Response
{
    "statusCode": 401,
    "error": "Unauthorized",
    "message": "Invalid x-api-key."
}
description
top button
v1.1.150 · d510041