Skip to content

Finish connecting a WhatsApp Business number

POST
/whatsapp/connect
curl --request POST \
--url https://example.com/whatsapp/connect \
--header 'Content-Type: application/json' \
--cookie __Host-bottle.session_token=<__Host-bottle.session_token> \
--data '{ "code": "example", "wabaId": "example", "phoneNumberId": "example" }'

Takes what Meta’s Embedded Signup gave the browser, swaps the code for the business’s token, and asks Meta to send the number’s messages to Bottle.

Media typeapplication/json
object
code
required
string
>= 1 characters <= 2000 characters
wabaId
required
string
/^\d{1,30}$/
phoneNumberId
required
string
/^\d{1,30}$/

Example generated

{
"code": "example",
"wabaId": "example",
"phoneNumberId": "example"
}

Connected

Media typeapplication/json
object
status
required
string
Allowed values: off disconnected connected
signup
required
object
appId
required
string
configId
required
string
displayPhone
required
string | null
verifiedName
required
string | null
createDrafts
required
boolean
replyToCustomers
required
boolean
answerQuestions
required
boolean
allowReschedule
required
boolean
allowCancel
required
boolean
placeWhenConfirmed
required
boolean
onlyTrialPhones
required
boolean
trialPhones
required
Array<string>
lastMessageAt
required
string | null format: date-time
lastError
required
string | null

Example

{
"status": "off"
}

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"
}
]
}

WhatsApp is not configured on this installation

Media typeapplication/json
object
error
required
string
message
required
string

Example

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