Update Webhook
Sets the webhook configuration for an application: the HTTPS URL the Gateway posts events to, the custom headers it attaches to each delivery, and which event types you are subscribed to.
Endpoint requirements. Your endpoint must be reachable over HTTPS with a valid certificate and must answer HTTP 200 within 5 seconds. Do the real work asynchronously.
Clearing headers. Send headers: {} to remove previously stored headers.
Tip. Point the URL at a request-inspection service such as webhook.site while wiring things up, then switch it to your own endpoint. The change takes effect on the next event, with no redeploy on your side.
curl --request POST \
--url https://public-api.gateway.connexease.com/api/v1/apps/{app_id}/webhook \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://api.acme.com/connexease/webhook",
"headers": {
"X-Signature-Token": "s3cr3t"
},
"subscribedEvents": {
"messages": true,
"message_status": true,
"message_template_status": false,
"read": true,
"account": false
}
}
'import requests
url = "https://public-api.gateway.connexease.com/api/v1/apps/{app_id}/webhook"
payload = {
"url": "https://api.acme.com/connexease/webhook",
"headers": { "X-Signature-Token": "s3cr3t" },
"subscribedEvents": {
"messages": True,
"message_status": True,
"message_template_status": False,
"read": True,
"account": False
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://api.acme.com/connexease/webhook',
headers: {'X-Signature-Token': 's3cr3t'},
subscribedEvents: {
messages: true,
message_status: true,
message_template_status: false,
read: true,
account: false
}
})
};
fetch('https://public-api.gateway.connexease.com/api/v1/apps/{app_id}/webhook', 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://public-api.gateway.connexease.com/api/v1/apps/{app_id}/webhook",
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([
'url' => 'https://api.acme.com/connexease/webhook',
'headers' => [
'X-Signature-Token' => 's3cr3t'
],
'subscribedEvents' => [
'messages' => true,
'message_status' => true,
'message_template_status' => false,
'read' => true,
'account' => false
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public-api.gateway.connexease.com/api/v1/apps/{app_id}/webhook"
payload := strings.NewReader("{\n \"url\": \"https://api.acme.com/connexease/webhook\",\n \"headers\": {\n \"X-Signature-Token\": \"s3cr3t\"\n },\n \"subscribedEvents\": {\n \"messages\": true,\n \"message_status\": true,\n \"message_template_status\": false,\n \"read\": true,\n \"account\": false\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://public-api.gateway.connexease.com/api/v1/apps/{app_id}/webhook")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://api.acme.com/connexease/webhook\",\n \"headers\": {\n \"X-Signature-Token\": \"s3cr3t\"\n },\n \"subscribedEvents\": {\n \"messages\": true,\n \"message_status\": true,\n \"message_template_status\": false,\n \"read\": true,\n \"account\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.gateway.connexease.com/api/v1/apps/{app_id}/webhook")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://api.acme.com/connexease/webhook\",\n \"headers\": {\n \"X-Signature-Token\": \"s3cr3t\"\n },\n \"subscribedEvents\": {\n \"messages\": true,\n \"message_status\": true,\n \"message_template_status\": false,\n \"read\": true,\n \"account\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"headers": {},
"subscribedEvents": {
"messages": true,
"message_status": true,
"read": true,
"message_template_status": true,
"account": true
},
"isActive": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"isSuccess": true
}{
"isSuccess": false,
"errors": {
"code": "META_075",
"group": "VALIDATION",
"description": "Template with 0000000000 not found in Meta.",
"params": {},
"fields": {}
}
}{
"isSuccess": false,
"errors": {
"code": "META_075",
"group": "VALIDATION",
"description": "Template with 0000000000 not found in Meta.",
"params": {},
"fields": {}
}
}{
"isSuccess": false,
"errors": {
"code": "META_075",
"group": "VALIDATION",
"description": "Template with 0000000000 not found in Meta.",
"params": {},
"fields": {}
}
}{
"isSuccess": false,
"errors": {
"code": "META_075",
"group": "VALIDATION",
"description": "Template with 0000000000 not found in Meta.",
"params": {},
"fields": {}
}
}Authorizations
Secret key in Bearer sk_... format. Server-to-server only — never embed it in a browser or mobile client. The organization is resolved from the key, so organization_id is never passed explicitly.
Path Parameters
Application ID. Must belong to the organization resolved from your secret key, otherwise the request returns 404 with APPLICATION_004.
"app_7poyXj8GXuv76e"
Body
The HTTPS endpoint that will receive events. Must be publicly reachable and serve a valid TLS certificate.
Custom headers the Gateway attaches to every delivery. Free-form, so this is where an auth token, tenant ID, or WAF bypass header goes. Send {} to clear existing headers. Do not put credentials here that you would not want stored on the configuration.
Show child attributes
Show child attributes
Event name to boolean map. Events set to false, and events left out entirely, are not delivered.
Show child attributes
Show child attributes
curl --request POST \
--url https://public-api.gateway.connexease.com/api/v1/apps/{app_id}/webhook \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://api.acme.com/connexease/webhook",
"headers": {
"X-Signature-Token": "s3cr3t"
},
"subscribedEvents": {
"messages": true,
"message_status": true,
"message_template_status": false,
"read": true,
"account": false
}
}
'import requests
url = "https://public-api.gateway.connexease.com/api/v1/apps/{app_id}/webhook"
payload = {
"url": "https://api.acme.com/connexease/webhook",
"headers": { "X-Signature-Token": "s3cr3t" },
"subscribedEvents": {
"messages": True,
"message_status": True,
"message_template_status": False,
"read": True,
"account": False
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://api.acme.com/connexease/webhook',
headers: {'X-Signature-Token': 's3cr3t'},
subscribedEvents: {
messages: true,
message_status: true,
message_template_status: false,
read: true,
account: false
}
})
};
fetch('https://public-api.gateway.connexease.com/api/v1/apps/{app_id}/webhook', 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://public-api.gateway.connexease.com/api/v1/apps/{app_id}/webhook",
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([
'url' => 'https://api.acme.com/connexease/webhook',
'headers' => [
'X-Signature-Token' => 's3cr3t'
],
'subscribedEvents' => [
'messages' => true,
'message_status' => true,
'message_template_status' => false,
'read' => true,
'account' => false
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public-api.gateway.connexease.com/api/v1/apps/{app_id}/webhook"
payload := strings.NewReader("{\n \"url\": \"https://api.acme.com/connexease/webhook\",\n \"headers\": {\n \"X-Signature-Token\": \"s3cr3t\"\n },\n \"subscribedEvents\": {\n \"messages\": true,\n \"message_status\": true,\n \"message_template_status\": false,\n \"read\": true,\n \"account\": false\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://public-api.gateway.connexease.com/api/v1/apps/{app_id}/webhook")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://api.acme.com/connexease/webhook\",\n \"headers\": {\n \"X-Signature-Token\": \"s3cr3t\"\n },\n \"subscribedEvents\": {\n \"messages\": true,\n \"message_status\": true,\n \"message_template_status\": false,\n \"read\": true,\n \"account\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.gateway.connexease.com/api/v1/apps/{app_id}/webhook")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://api.acme.com/connexease/webhook\",\n \"headers\": {\n \"X-Signature-Token\": \"s3cr3t\"\n },\n \"subscribedEvents\": {\n \"messages\": true,\n \"message_status\": true,\n \"message_template_status\": false,\n \"read\": true,\n \"account\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"headers": {},
"subscribedEvents": {
"messages": true,
"message_status": true,
"read": true,
"message_template_status": true,
"account": true
},
"isActive": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"isSuccess": true
}{
"isSuccess": false,
"errors": {
"code": "META_075",
"group": "VALIDATION",
"description": "Template with 0000000000 not found in Meta.",
"params": {},
"fields": {}
}
}{
"isSuccess": false,
"errors": {
"code": "META_075",
"group": "VALIDATION",
"description": "Template with 0000000000 not found in Meta.",
"params": {},
"fields": {}
}
}{
"isSuccess": false,
"errors": {
"code": "META_075",
"group": "VALIDATION",
"description": "Template with 0000000000 not found in Meta.",
"params": {},
"fields": {}
}
}{
"isSuccess": false,
"errors": {
"code": "META_075",
"group": "VALIDATION",
"description": "Template with 0000000000 not found in Meta.",
"params": {},
"fields": {}
}
}