Create Child Object
  • 09 Jun 2025
  • 2 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Create Child Object

  • Dark
    Light
  • PDF

Article summary

Post
/streams/{STREAM_ID}/objects/{OBJECT_ID}/child

This API creates a message (child) in a conversation (object) on behalf of the agent, sending it to the customer, or on behalf of the customer, displaying it to the agent.
The API returns the new child’s ID.


Required path parameters include the Stream (channel) ID and the Object (conversation) ID.

Required body parameters for a message on behalf of the customer:
a) The data “Type” see Enum at https://www.commbox.io/api/#section/Enums/ObjectType
b) UserStreamProviderId – the email or phone number of the person you are sending the message on their behalf.
c) UserStreamProviderType of the channel. See Enum at https://www.commbox.io/api/#section/Enums/StreamProviderType
d) The messages

Required body parameters for a message on behalf of the agent:
a) The data “Type” - See Enum at https://www.commbox.io/api/#section/Enums/ObjectType
b) Add this Boolean field 'IsManager': true,
c) Enter the agent’s user ID 'UserIdentity' : 34168,
Get the agent's User ID by using the Get Managers API https://api.commbox.io/managers
d) UserStreamProviderId – the email or phone number of the person you are sending the message on their behalf.
e) UserStreamProviderType of the channel. See Enum at https://www.commbox.io/api/#section/Enums/StreamProviderType
f) The messages

Note: After 24 hours from last sent message, APIs messages sent to customers will be blocked by WhatsApp.

POST /streams/STREAM_ID/objects/OBJECT_ID/child
POST /streams/STREAM_ID/objects/STREAM_PROVIDER_ID/STREAM_PROVIDER_TYPE/child

Security
HTTP
Type bearer

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.

Path parameters
STREAM_ID
Required

The unique identifier for the stream (CommBox channel)

OBJECT_ID
Required

The unique identifier for the object (CommBox conversation)

Body parameters

Payload containing child object information

On behalf of Agent - Sending an email
{
  "data": {
    "IsManager": true,
    "UserIdentity": 36574658,
    "Type": 4,
    "UserStreamProviderId": "best.agent@commbox.com",
    "UserStreamProviderType": 4,
    "Message": "A new message on behalf of the agent"
  }
}
On behalf of Agent - Sending a WhatsApp message
{
  "data": {
    "IsManager": true,
    "UserIdentity": 36574658,
    "Type": 4,
    "UserStreamProviderId": "972542660000",
    "UserStreamProviderType": 7,
    "Message": "A new message on behalf of the agent"
  }
}
On behalf of Customer
{
  "data": {
    "Type": 4,
    "UserStreamProviderId": "MrDoe@gmail.com",
    "UserStreamProviderType": 4,
    "Message": "A message on behalf of Mr. John Doe"
  }
}
object
type
integer (int64)

The type of the object. See Enum

IsManager
boolean

Indicates whether the message is from the agent or admin (true) or from a customer (false)

UserIdentity
integer

Enter the agent's user ID. Ignore when creating customer's message. Get the agent's User ID by using the Get Managers API

UserStreamProviderId
string

The email or phone number of the person you are sending the message on their behalf

UserStreamProviderType
integer

The channel type’s code. See Enum

Message
string

The message on behalf of the agent / customer

Responses
200

OK

Expand All
object
status
string
Example200
description
string
ExampleOK
response_time
string
Example2024-08-06T07:51:52.2581942Z
data
object
id
integer
Example294159
400

Bad Request - The request could not be understood by the server. Incoming parameters might not be valid

401

Unauthorized - The supplied credentials, if any, are not sufficient to access the resource

404

Not found - The requested resource is not found

429

Too Many Requests - Too many requests have been made in a short period of time (Throttling)

500

Server Error - The server could not return the representation due to an internal server error

501

Not Implemented - The requested operation is not supported


Was this article helpful?

What's Next