cURL
curl -X PATCH 'https://api.nuntly.com/webhooks/wh_01ka8k8s80gvx9604cn9am5st4' \
-H 'Authorization: Bearer apk_xxx' \
-H 'Content-Type: application/json' \
-d '{"name":"Production webhook","events":["email.queued"]}'import { Nuntly } from '@nuntly/sdk';
const client = new Nuntly({
apiKey: process.env['NUNTLY_API_KEY'],
});
const response = await client.webhooks.update('wh_01ka8k8s80gvx9604cn9am5st4', {
name: 'Production webhook',
events: ['email.queued'],
});import com.nuntly.sdk.Nuntly;
import com.nuntly.sdk.ClientOptions;
import com.nuntly.sdk.models.*;
var nuntly = Nuntly.create(ClientOptions.builder()
.apiKey(System.getenv("NUNTLY_API_KEY"))
.build());
var response = nuntly.webhooks().update("wh_01ka8k8s80gvx9604cn9am5st4", UpdateWebhookRequest.builder()
.name("Production webhook")
.events(List.of(EventType.EMAIL_QUEUED))
.build());import requests
url = "https://api.nuntly.com/webhooks/{id}"
payload = {
"name": "Production webhook",
"endpointUrl": "https://example.com/webhooks",
"events": [],
"rotateSecret": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nuntly.com/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([
'name' => 'Production webhook',
'endpointUrl' => 'https://example.com/webhooks',
'events' => [
],
'rotateSecret' => true
]),
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://api.nuntly.com/webhooks/{id}"
payload := strings.NewReader("{\n \"name\": \"Production webhook\",\n \"endpointUrl\": \"https://example.com/webhooks\",\n \"events\": [],\n \"rotateSecret\": true\n}")
req, _ := http.NewRequest("PATCH", 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))
}require 'uri'
require 'net/http'
url = URI("https://api.nuntly.com/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Production webhook\",\n \"endpointUrl\": \"https://example.com/webhooks\",\n \"events\": [],\n \"rotateSecret\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "wh_01ka8k8s80gvx9604cn9am5st4",
"signingSecret": "<string>"
}
}{
"error": {
"status": 123,
"code": "<string>",
"title": "<string>",
"details": {}
}
}Webhooks
Update Webhook
Update the endpoint URL, subscribed event types, or rotate the signing secret.
PATCH
/
webhooks
/
{id}
cURL
curl -X PATCH 'https://api.nuntly.com/webhooks/wh_01ka8k8s80gvx9604cn9am5st4' \
-H 'Authorization: Bearer apk_xxx' \
-H 'Content-Type: application/json' \
-d '{"name":"Production webhook","events":["email.queued"]}'import { Nuntly } from '@nuntly/sdk';
const client = new Nuntly({
apiKey: process.env['NUNTLY_API_KEY'],
});
const response = await client.webhooks.update('wh_01ka8k8s80gvx9604cn9am5st4', {
name: 'Production webhook',
events: ['email.queued'],
});import com.nuntly.sdk.Nuntly;
import com.nuntly.sdk.ClientOptions;
import com.nuntly.sdk.models.*;
var nuntly = Nuntly.create(ClientOptions.builder()
.apiKey(System.getenv("NUNTLY_API_KEY"))
.build());
var response = nuntly.webhooks().update("wh_01ka8k8s80gvx9604cn9am5st4", UpdateWebhookRequest.builder()
.name("Production webhook")
.events(List.of(EventType.EMAIL_QUEUED))
.build());import requests
url = "https://api.nuntly.com/webhooks/{id}"
payload = {
"name": "Production webhook",
"endpointUrl": "https://example.com/webhooks",
"events": [],
"rotateSecret": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nuntly.com/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([
'name' => 'Production webhook',
'endpointUrl' => 'https://example.com/webhooks',
'events' => [
],
'rotateSecret' => true
]),
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://api.nuntly.com/webhooks/{id}"
payload := strings.NewReader("{\n \"name\": \"Production webhook\",\n \"endpointUrl\": \"https://example.com/webhooks\",\n \"events\": [],\n \"rotateSecret\": true\n}")
req, _ := http.NewRequest("PATCH", 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))
}require 'uri'
require 'net/http'
url = URI("https://api.nuntly.com/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Production webhook\",\n \"endpointUrl\": \"https://example.com/webhooks\",\n \"events\": [],\n \"rotateSecret\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "wh_01ka8k8s80gvx9604cn9am5st4",
"signingSecret": "<string>"
}
}{
"error": {
"status": 123,
"code": "<string>",
"title": "<string>",
"details": {}
}
}Authorizations
Use an API key from https://nuntly.com/api-keys. Required on every endpoint.
Path Parameters
The id of the webhook
Body
application/json
The name of the webhook
Example:
"Production webhook"
The endpoint URL of the webhook
Example:
"https://example.com/webhooks"
The event types to subscribe to
Available options:
email.queued, email.scheduled, email.processed, email.sending, email.sent, email.delivered, email.opened, email.clicked, email.bounced, email.complained, email.rejected, email.deliveryDelayed, email.failed, email.renderingFailed, email.subscribed, email.unsubscribed, message.received, message.security.flagged, message.agent.triggered, message.sent, message.rejected The status of the webhook.
Available options:
enabled, disabled If true, a new signing secret will be generated
Response
Successful response.
Show child attributes
Show child attributes
