API Version. In the future, we will update our API, and to avoid any disruptions, we will support old versions in parallel for a while.
message_id
yes
string
Message ID in your system. Necessary to prevent accidental re-triggers.
chat_id
yes
string
Chat ID in your system. The linking part that determines which dialogue the message will appear in.
text
yes, if attachments field is not specified
string, at least 1 character
Message text.
attachments
yes, if text field is not specified
array of Attachment objects
Attachments. Currently, only images and audio are supported.
message_sender
yes
string (customer or employee)
Message sender. Customer or employee from your system.
source
yes
string
Source. The value that appears in the "Source" column in the Suvvy dashboard.
Typically, the client's name or username, or the deal name.
link
no
Link object
Link to chat in your system. Will be displayed as a button in the Suvvy dashboard.
placeholders
no
object, where key and value are strings
Variables for instructions. More details below.
client_name
no
string
Client name.
client_phone
no
string
Client phone number.
Attachment Object
All fields are required.
Field
Type
Description
file_name
string
File name.
file_type
string (image or audio)
File type.
data
string, base64 of file
File. Permissible types are indicated below.
Suvvy accepts files of the following types:
For images: image/png, image/jpeg, image/gif
For audio: audio/ogg, audio/mpeg, audio/wav, audio/x-wav, audio/webm, audio/mp4, audio/m4a, audio/x-m4a
Maximum file size - 15 megabytes
Link Object
Field
Type
Description
type
string (user, chat, phone, lead, other)
Link type. Affects the icon displayed in the dashboard
user - 👤
chat - 💬
phone - 📞
lead - 🤝🏻
other - 🔗
hint
string or null
Text for button. Optional. If not specified (or null), titles are used depending on the type:
user - Accountchat - Chatphone - Phonelead - Leadother - Link
url
string
Link.
Response
Upon success, the webhook returns a body of the following form:
{
"message": "Successful"
}
This can be ignored as it doesn't carry useful information.
Errors
Invalid Token
Returns a body of the following type and code 401:
Returns when the channel is not connected or disabled in settings.
Returns a body of the following type and code 424:
{
"detail": "Channel is disabled.",
"status_code": 424,
"error_code": "instance_channel_is_disabled"
}
Unsupported File Type
Returns when the submitted file is unsupported by Suvvy. Provides supported types.
Returns a body of the following type and code 415:
{
"detail": "File type is not supported or invalid.",
"status_code": 415,
"error_code": "file_invalid_type",
"allowed_mime_types": [
"image/png",
"text/csv",
"audio/ogg"
]
}
Negative Balance
Returns when your Suvvy balance is below zero.
Returns a body of the following type and code 402:
{
"detail": "Your balance is below zero, so you can't perform this action.'",
"status_code": 402,
"error_code": "user_balance_below_zero"
}
Validation Error
Returns code 422 and a body detailing what was submitted incorrectly.