This API creates a message (child) within a conversation (object). The message can be sent either on behalf of an agent (to the customer) or on behalf of a customer (displayed to the agent).
The API response returns the ID of the newly created child.
Path Parameters
• STREAM_ID – Encrypted Stream ID representing the channel
• OBJECT_ID – ID of the conversation
Request Body
Message on Behalf of the Customer
a) "Type": 4, - Enter 4 as default child type (conversation)- see Enum at https://help.commbox.io/apidocs/enums#objectchildtype
b) "UserStreamProviderId" – Enter the email or phone number of the person you are sending the message on their behalf.
c) "UserStreamProviderType" – Enter 4 for email or 5 for a phone number (See Enum at https://help.commbox.io/apidocs/enums#streamprovidertype )
d) "Message" – Enter the message
Message on Behalf of the Agent
a) "Type": 4, - Enter 4 as default child type (conversation)- see Enum at https://help.commbox.io/apidocs/enums#objectchildtype
b) "IsManager": true, - Add this Boolean field for the agent
c) "UserIdentity": 123456, - Enter the agent’s user ID in the specific brand. You can get the agent's User ID by using the Get Managers API https://api.commbox.io/managers
d) "UserStreamProviderId" – Enter the email or phone number of the agent.
e) "UserStreamProviderType" – Enter 4 for email or 5 for a phone number (See Enum at https://help.commbox.io/apidocs/enums#streamprovidertype )
f) "Message" – Enter the message
Note: After 24 hours from last sent message, APIs messages sent to customers will be blocked by WhatsApp.
Attachments in Chat Conversations
You can attach files to chat conversations using
multipart/form-data.The "Type" field defines the kind of object attached to the message.
For example:
• 1 – Link
• 2 – Image
• 4 – File (when no message is included)
(See the full enum list: https://help.commbox.io/apidocs/enums#objectchildtype)
Notes:
1. Leave the file parameter key empty, set the type to
File, and upload the file directly from your device. 2. Enter
data (file type Text) and for the value, copy the raw form, ensuring there are no extra parentheses.3. Base64 file upload alternative option:
filename:{name};base64:{data}
API key is needed to authorize requests. You can get your API key via the management console.
A Bearer Token is needed to be set in the Authorization header of every API call.
For additional support you can contact us.
The unique identifier for the channel
The unique identifier for the conversation
Payload containing child object information
{
"data": {
"IsManager": true,
"UserIdentity": 36574658,
"Type": 4,
"UserStreamProviderId": "best.agent@commbox.com",
"UserStreamProviderType": 4,
"Message": "A new message on behalf of the agent"
}
}{
"data": {
"IsManager": true,
"UserIdentity": 36574658,
"Type": 4,
"UserStreamProviderId": "972542660000",
"UserStreamProviderType": 7,
"Message": "A new message on behalf of the agent"
}
}{
"data": {
"Type": 4,
"UserStreamProviderId": "MrDoe@gmail.com",
"UserStreamProviderType": 4,
"Message": "A message on behalf of Mr. John Doe"
}
}The type of the object of the child. See Enum
Indicates whether the message is from the agent or admin (true) or from a customer (false)
Enter the agent's user ID. Ignore when creating customer's message. Get the agent's User ID by using the Get Managers API
The email or phone number of the person you are sending the message on their behalf
The channel type’s code. See Enum
The message on behalf of the agent / customer
OK
Bad Request - The request could not be understood by the server. Incoming parameters might not be valid
Unauthorized - The supplied credentials, if any, are not sufficient to access the resource
Not Found - The requested resource is not found
Too Many Requests - Too many requests have been made in a short period of time (Throttling)
Internal Server Error - The server could not return the representation due to an internal server error
{
"status": 500,
"description": "Operation failed",
"response_time": "2025-04-15T07:24:52.956Z"
}Not Implemented - The requested operation is not supported