Skip to main content
POST
/
conversations
/
send-message
Send Message
curl --request POST \
  --url http://localhost:3000/api/conversations/send-message \
  --header 'Content-Type: application/json' \
  --data '
{
  "conversationId": "<string>",
  "messageData": {
    "type": "TEXT",
    "text": "<string>"
  },
  "fileUrls": [
    {
      "url": "<string>",
      "name": "<string>",
      "type": "<string>"
    }
  ],
  "messageId": "<string>"
}
'
{
  "success": true,
  "message": {
    "id": "<string>",
    "senderId": "<string>",
    "content": "<string>",
    "timestamp": 123,
    "readBy": [
      "<string>"
    ],
    "type": "<string>"
  },
  "fileMessages": [
    {
      "id": "<string>",
      "senderId": "<string>",
      "content": "<string>",
      "timestamp": 123,
      "readBy": [
        "<string>"
      ],
      "type": "<string>"
    }
  ]
}

Body

application/json
conversationId
string
required

ID of the conversation to send the message to

messageData
object
required

Data for the message to send

  • Option 1
  • Option 2
fileUrls
object[]

Optional array of file URLs to send as separate file messages

messageId
string

Optional frontend-generated unique ID for message correlation

Response

Message sent successfully

success
boolean
required

Whether the message was sent successfully

message
object

The text message that was sent, if any

fileMessages
object[]

Array of file messages that were sent, if any