Change a webhook's events
curl --request PATCH \
--url https://api.getreply.in/v1/webhooks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
"message.delivered",
"message.read",
"message.received"
]
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({events: ['message.delivered', 'message.read', 'message.received']})
};
fetch('https://api.getreply.in/v1/webhooks/{id}', 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.getreply.in/v1/webhooks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'events' => [
'message.delivered',
'message.read',
'message.received'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://api.getreply.in/v1/webhooks/{id}"
payload = { "events": ["message.delivered", "message.read", "message.received"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": "string",
"url": "string",
"events": [
"string"
],
"status": "ON",
"created_at": "string"
}
Webhooks
Change a webhook's events
Replaces the webhook’s events with this full list (at least one; repeats are removed). Only the events change: the link, the secret and whether it is on stay as they are. Events already queued are still sent; new events follow the new list from now. To change the link, add a new webhook and delete this one.
Permission: A Full key.
PATCH
/
v1
/
webhooks
/
{id}
Change a webhook's events
curl --request PATCH \
--url https://api.getreply.in/v1/webhooks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
"message.delivered",
"message.read",
"message.received"
]
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({events: ['message.delivered', 'message.read', 'message.received']})
};
fetch('https://api.getreply.in/v1/webhooks/{id}', 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.getreply.in/v1/webhooks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'events' => [
'message.delivered',
'message.read',
'message.received'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://api.getreply.in/v1/webhooks/{id}"
payload = { "events": ["message.delivered", "message.read", "message.received"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": "string",
"url": "string",
"events": [
"string"
],
"status": "ON",
"created_at": "string"
}
Authorizations
Your API key, e.g. gr_live_…
Headers
Your own unique id for this request (at most 255 characters). The same id and body within 24 hours answers the first answer again — never a second send or charge.
Maximum string length:
255Path Parameters
The id.
Body
application/json
Minimum array length:
1Available options:
message.accepted, message.sent, message.delivered, message.read, message.failed, message.received, message.sent_from_phone, wallet.low, number.quality_changed, number.status_changed, number.name_changed, template.status_changed, template.quality_changed, template.created, template.deleted, campaign.started, campaign.finished, campaign.paused, campaign.stopped, plan.ended, key.disabled, daily_limit.reached, webhook.disabled