Skip to content

Reply to a customer on WhatsApp

POST
/whatsapp/conversations/{id}/messages
curl --request POST \
--url https://example.com/whatsapp/conversations/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f/messages \
--header 'Content-Type: application/json' \
--cookie __Host-bottle.session_token=<__Host-bottle.session_token> \
--data '{ "text": "example" }'

Sends the text from the business’s WhatsApp number, as a reply typed on the phone would be. WhatsApp only allows it within 24 hours of the customer’s last message. Once somebody has replied, Bottle stays out of the conversation unless there is an order or a question.

id
required

UUID v7

string format: uuid

Example

019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f

UUID v7

Media typeapplication/json
object
text
required
string
>= 1 characters <= 4000 characters

Example generated

{
"text": "example"
}

The conversation, with the reply in it

Media typeapplication/json
object
id
required

UUID v7

string format: uuid
contactPhone
required
string
profileName
required
string | null
status
required
string
Allowed values: waiting reading drafted not_order attention closed
customer
required
object
id
required

UUID v7

string format: uuid
name
required
string
customerChosen
required
boolean
candidates
required
Array<object>
object
id
required

UUID v7

string format: uuid
name
required
string
orderId
required

UUID v7

string | null format: uuid
summary
required
string | null
lines
required
Array<object>
object
productId
required

UUID v7

string | null format: uuid
productName
required
string | null
quantity
required
integer
said
required
string
reason
required
string | null
unsure
required
Array<string>
orderConfirmed
required
boolean
addressConfirmed
required
boolean
empties
required
object
answer
required
string | null
Allowed values: yes no
count
required
integer | null
waitingFor
required
string | null
Allowed values: address product empties summary
failed
required
boolean
bottleReplying
required
boolean
messages
required
Array<object>
object
id
required

UUID v7

string format: uuid
direction
required
string
Allowed values: in out
kind
required
string
body
required
string | null
translation
required
string | null
sentByBottle
required
boolean
buttons
required
Array<string> | null
sentAt
required
string format: date-time
lastMessageAt
required
string format: date-time

Example

{
"id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f",
"status": "waiting",
"customer": {
"id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f"
},
"candidates": [
{
"id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f"
}
],
"orderId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f",
"lines": [
{
"productId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f"
}
],
"empties": {
"answer": "yes"
},
"waitingFor": "address",
"messages": [
{
"id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f",
"direction": "in"
}
]
}

Not signed in

Media typeapplication/json
object
error
required
string
message
required
string

Example

{
"error": "not_found",
"message": "Customer not found"
}

Not a member, or without the permission this needs

Media typeapplication/json
object
error
required
string
message
required
string

Example

{
"error": "not_found",
"message": "Customer not found"
}

Not found

Media typeapplication/json
object
error
required
string
message
required
string

Example

{
"error": "not_found",
"message": "Customer not found"
}

Conflicts with how things are now

Media typeapplication/json
object
error
required
string
message
required
string

Example

{
"error": "not_found",
"message": "Customer not found"
}

Validation failed

Media typeapplication/json
object
error
required
string
Allowed values: validation
message
required
string
issues
required
Array<object>
object
path
required
string
message
required
string

Example

{
"error": "validation",
"issues": [
{
"path": "email",
"message": "Invalid email"
}
]
}