Skip to main content
POST
/
chat
/
sessions
/
{session_id}
/
send
Send a message
curl --request POST \
  --url https://api.open.cx/chat/sessions/{session_id}/send \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "message": {
    "type": "<string>",
    "text": "<string>",
    "attachments": [
      {
        "name": "<string>",
        "url": "<string>",
        "base64": "<string>",
        "mime_type": "<string>"
      }
    ]
  },
  "contact": {
    "name": "<string>",
    "email": "[email protected]",
    "phone_number": "<string>",
    "avatar_url": "<string>",
    "custom_data": {}
  },
  "custom_data": {},
  "agent": {
    "id": 123,
    "name": "<string>",
    "avatar_url": "<string>"
  },
  "should_take_over_session_from_ai": false
}
'
{
  "success": true,
  "data": {
    "message": {
      "id": "<string>"
    }
  }
}

Custom data

This endpoint accepts two independent custom_data objects, each merged into a different record:
  • Top-level custom_data — session-level attributes that belong to this conversation, such as an order ID, cart value, or routing flag. Merged into the chat session and returned by Get Session. Values can be strings, numbers, or booleans.
  • contact.custom_data — contact-level attributes that belong to the person, such as plan, region, or account tier. Merged into the contact. Values are strings.
Both merge into any existing data, so you only need to send the keys you want to add or update. Nested objects are rejected with a 400.
{
  "sender": "contact",
  "custom_data": { "order_id": "ord_123", "cart_value": 149.99, "priority": "high" },
  "contact": { "custom_data": { "plan": "pro", "region": "emea" } },
  "message": { "type": "text", "text": "I need help with this order" }
}
Session custom_data set through this endpoint is stored on the session but is not synced to a connected external ticketing system (e.g. Intercom or HubSpot).

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

session_id
string
required

The unique identifier of the chat session

Body

application/json
sender
enum<string>
required
Available options:
contact,
agent
message
object
required
contact
object
custom_data
object

Session-level custom data to merge into the chat session. Use contact.custom_data for contact-level attributes.

agent
object
should_take_over_session_from_ai
boolean
default:false

Response

Default Response

success
boolean
required
data
object
required