Create webhook subscription
curl --request POST \
--url https://api.birdeye.com/resources/v1/messenger/subscribe/webhook/event \
--header 'Content-Type: application/json' \
--data '
{
"businessNumber": "755009344",
"apiKey": "92bcd6e0-c102-43fd-8a67-1a7be5258451",
"events": [
"conversation.created",
"conversation.updated",
"message.added",
"message.closed"
],
"endpoint": "https://webhook.site/0c27e14d-f833-4589-b201-86b41a651464"
}
'import requests
url = "https://api.birdeye.com/resources/v1/messenger/subscribe/webhook/event"
payload = {
"businessNumber": "755009344",
"apiKey": "92bcd6e0-c102-43fd-8a67-1a7be5258451",
"events": ["conversation.created", "conversation.updated", "message.added", "message.closed"],
"endpoint": "https://webhook.site/0c27e14d-f833-4589-b201-86b41a651464"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
businessNumber: '755009344',
apiKey: '92bcd6e0-c102-43fd-8a67-1a7be5258451',
events: [
'conversation.created',
'conversation.updated',
'message.added',
'message.closed'
],
endpoint: 'https://webhook.site/0c27e14d-f833-4589-b201-86b41a651464'
})
};
fetch('https://api.birdeye.com/resources/v1/messenger/subscribe/webhook/event', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.birdeye.com/resources/v1/messenger/subscribe/webhook/event",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'businessNumber' => '755009344',
'apiKey' => '92bcd6e0-c102-43fd-8a67-1a7be5258451',
'events' => [
'conversation.created',
'conversation.updated',
'message.added',
'message.closed'
],
'endpoint' => 'https://webhook.site/0c27e14d-f833-4589-b201-86b41a651464'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.birdeye.com/resources/v1/messenger/subscribe/webhook/event"
payload := strings.NewReader("{\n \"businessNumber\": \"755009344\",\n \"apiKey\": \"92bcd6e0-c102-43fd-8a67-1a7be5258451\",\n \"events\": [\n \"conversation.created\",\n \"conversation.updated\",\n \"message.added\",\n \"message.closed\"\n ],\n \"endpoint\": \"https://webhook.site/0c27e14d-f833-4589-b201-86b41a651464\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.birdeye.com/resources/v1/messenger/subscribe/webhook/event")
.header("Content-Type", "application/json")
.body("{\n \"businessNumber\": \"755009344\",\n \"apiKey\": \"92bcd6e0-c102-43fd-8a67-1a7be5258451\",\n \"events\": [\n \"conversation.created\",\n \"conversation.updated\",\n \"message.added\",\n \"message.closed\"\n ],\n \"endpoint\": \"https://webhook.site/0c27e14d-f833-4589-b201-86b41a651464\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.birdeye.com/resources/v1/messenger/subscribe/webhook/event")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"businessNumber\": \"755009344\",\n \"apiKey\": \"92bcd6e0-c102-43fd-8a67-1a7be5258451\",\n \"events\": [\n \"conversation.created\",\n \"conversation.updated\",\n \"message.added\",\n \"message.closed\"\n ],\n \"endpoint\": \"https://webhook.site/0c27e14d-f833-4589-b201-86b41a651464\"\n}"
response = http.request(request)
puts response.read_body{
"subscriptionId": 2,
"businessId": 755009344,
"events": [
"conversation.created",
"conversation.updated",
"message.added",
"conversation.closed"
]
}{
"code": 1167,
"message": "API key is missing"
}{
"code": 1011,
"message": "Business id is invalid"
}{
"code": 89,
"message": "Rate limit exceeded"
}Webhook
Create Webhook Subscription
POST
/
v1
/
messenger
/
subscribe
/
webhook
/
event
Create webhook subscription
curl --request POST \
--url https://api.birdeye.com/resources/v1/messenger/subscribe/webhook/event \
--header 'Content-Type: application/json' \
--data '
{
"businessNumber": "755009344",
"apiKey": "92bcd6e0-c102-43fd-8a67-1a7be5258451",
"events": [
"conversation.created",
"conversation.updated",
"message.added",
"message.closed"
],
"endpoint": "https://webhook.site/0c27e14d-f833-4589-b201-86b41a651464"
}
'import requests
url = "https://api.birdeye.com/resources/v1/messenger/subscribe/webhook/event"
payload = {
"businessNumber": "755009344",
"apiKey": "92bcd6e0-c102-43fd-8a67-1a7be5258451",
"events": ["conversation.created", "conversation.updated", "message.added", "message.closed"],
"endpoint": "https://webhook.site/0c27e14d-f833-4589-b201-86b41a651464"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
businessNumber: '755009344',
apiKey: '92bcd6e0-c102-43fd-8a67-1a7be5258451',
events: [
'conversation.created',
'conversation.updated',
'message.added',
'message.closed'
],
endpoint: 'https://webhook.site/0c27e14d-f833-4589-b201-86b41a651464'
})
};
fetch('https://api.birdeye.com/resources/v1/messenger/subscribe/webhook/event', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.birdeye.com/resources/v1/messenger/subscribe/webhook/event",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'businessNumber' => '755009344',
'apiKey' => '92bcd6e0-c102-43fd-8a67-1a7be5258451',
'events' => [
'conversation.created',
'conversation.updated',
'message.added',
'message.closed'
],
'endpoint' => 'https://webhook.site/0c27e14d-f833-4589-b201-86b41a651464'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.birdeye.com/resources/v1/messenger/subscribe/webhook/event"
payload := strings.NewReader("{\n \"businessNumber\": \"755009344\",\n \"apiKey\": \"92bcd6e0-c102-43fd-8a67-1a7be5258451\",\n \"events\": [\n \"conversation.created\",\n \"conversation.updated\",\n \"message.added\",\n \"message.closed\"\n ],\n \"endpoint\": \"https://webhook.site/0c27e14d-f833-4589-b201-86b41a651464\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.birdeye.com/resources/v1/messenger/subscribe/webhook/event")
.header("Content-Type", "application/json")
.body("{\n \"businessNumber\": \"755009344\",\n \"apiKey\": \"92bcd6e0-c102-43fd-8a67-1a7be5258451\",\n \"events\": [\n \"conversation.created\",\n \"conversation.updated\",\n \"message.added\",\n \"message.closed\"\n ],\n \"endpoint\": \"https://webhook.site/0c27e14d-f833-4589-b201-86b41a651464\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.birdeye.com/resources/v1/messenger/subscribe/webhook/event")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"businessNumber\": \"755009344\",\n \"apiKey\": \"92bcd6e0-c102-43fd-8a67-1a7be5258451\",\n \"events\": [\n \"conversation.created\",\n \"conversation.updated\",\n \"message.added\",\n \"message.closed\"\n ],\n \"endpoint\": \"https://webhook.site/0c27e14d-f833-4589-b201-86b41a651464\"\n}"
response = http.request(request)
puts response.read_body{
"subscriptionId": 2,
"businessId": 755009344,
"events": [
"conversation.created",
"conversation.updated",
"message.added",
"conversation.closed"
]
}{
"code": 1167,
"message": "API key is missing"
}{
"code": 1011,
"message": "Business id is invalid"
}{
"code": 89,
"message": "Rate limit exceeded"
}Headers
e.g. application/json
Body
application/json
The business number for which events to be subscribed. Should always be the account business number not the location business number.
Partner specific API key provided by Birdeye for data exchange.
A list of event name strings from the list of available events that should trigger this webhook. Possible values are
conversation.created - A new conversation started,
conversation.updated - A conversation has been updated with a new status or assigned/unassigned,
message.added - A new message has been created. Triggered for both sent and received messages,
and conversation.closed - Conversation is closed.
f833-4589-b201-86b41a651464 (string) - The webhook endpoint URL on your server on which webhook requests are to be sent.

