POST

Send Message


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Sends a message to the business or participant.

Specify the message type in message.content by including the appropriate object: basic, template, minimal, or form. For more information on message types and how each type renders in Inbox and the Chat widget, see Message Types.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Inbox Messages
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/inbox/v2/messages

Body Params
conversationIdstringRequiredformat GUID

ID of the conversation to add the message to.


messageMessageRequired

Message to send.


sendNotificationsboolean

Controls whether the message triggers notifications when it's received.

Defaults to false.


silentboolean

Controls whether the unread count and conversation summary are updated in the Message List.

If true, unread count and conversation summary are not updated.

Defaults to false.


sendAsstring

Controls which identity to use in the message's sender property.

  • CALLER: Uses the identity included in the request header.
  • PARTICIPANT: Uses the anonymousVisitorId, contactId, or memberId of the conversation's participant.
  • BUSINESS_USER: For internal use. Uses the wixUserId of the person sending messages on behalf of the business.

Defaults to CALLER. For 3rd-party apps, the app is the caller.

Response Object
messageMessage

Sent message.

Request
cURL
curl -X POST \ 'https://www.wixapis.com/inbox/v2/messages' \ -H 'Authorization: <AUTH>' \ -H 'Content-Type: application/json' \ -d '{ "conversation_id": "6202c3bb-f263-3c16-8c90-d6387d9ed420", "send_notifications": true, "silent": false, "typing_delay": 0, "send_as": "CALLER", "message": { "badges": [ { "text": "Email", "badge_visibility": "BUSINESS", "icon_url": "https://wixmp-9127dea18607b759d29e6784.wixmp.com/badges/mailSmallFlat.png" }], "target_channels": [ "EMAIL" ], "content": { "preview_text": "Hey!", "basic": { "items": [ { "text": "Hey!" } ] } }, "source_channel": "CHAT", "visibility": "BUSINESS_AND_PARTICIPANT", "direction": "BUSINESS_TO_PARTICIPANT" } }'
Response
JSON
{ "message": { "id": "1640849952353627", "content": { "previewText": "Hey!", "basic": { "items": [ { "text": "Hey!" } ] } }, "sender": { "wixUserId": "5a0c4737-a2a0-4c37-a07e-d9fd87027023" }, "badges": [ { "text": "Email", "iconUrl": "https://wixmp-9127dea18607b759d29e6784.wixmp.com/badges/mailSmallFlat.png", "badgeVisibility": "BUSINESS" } ], "targetChannels": ["EMAIL"], "sourceChannel": "CHAT", "appId": "141fbfae-511e-6817-c9f0-48993a7547d1", "visibility": "BUSINESS_AND_PARTICIPANT", "sequence": "1640849952353627", "direction": "BUSINESS_TO_PARTICIPANT", "createdDate": "2021-12-30T07:39:12.353Z" } }
Errors
403Permission Denied

There is 1 error with this status code.

404Not Found

There is 1 error with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

Did this help?