Update Webhook
curl --request PUT \
--url https://app.lettr.com/api/webhooks/{webhookId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Updated Webhook Name",
"active": false
}
'import requests
url = "https://app.lettr.com/api/webhooks/{webhookId}"
payload = {
"name": "Updated Webhook Name",
"active": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Updated Webhook Name', active: false})
};
fetch('https://app.lettr.com/api/webhooks/{webhookId}', 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://app.lettr.com/api/webhooks/{webhookId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Updated Webhook Name',
'active' => 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://app.lettr.com/api/webhooks/{webhookId}"
payload := strings.NewReader("{\n \"name\": \"Updated Webhook Name\",\n \"active\": false\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.lettr.com/api/webhooks/{webhookId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Updated Webhook Name\",\n \"active\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.lettr.com/api/webhooks/{webhookId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Updated Webhook Name\",\n \"active\": false\n}"
response = http.request(request)
puts response.read_body{
"message": "Webhook updated successfully.",
"data": {
"id": "webhook-abc123",
"name": "Updated Webhook Name",
"url": "https://example.com/webhook",
"enabled": false,
"event_types": [
"message.delivery",
"message.bounce"
],
"auth_type": "basic",
"has_auth_credentials": true,
"last_successful_at": "2024-01-15T10:30:00+00:00",
"last_failure_at": null,
"last_status": "success"
}
}Webhooks
Update Webhook
Update an existing webhook. Only the fields provided will be updated (partial update). You can change the name, target URL, authentication, events, or active status.
PUT
/
webhooks
/
{webhookId}
Update Webhook
curl --request PUT \
--url https://app.lettr.com/api/webhooks/{webhookId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Updated Webhook Name",
"active": false
}
'import requests
url = "https://app.lettr.com/api/webhooks/{webhookId}"
payload = {
"name": "Updated Webhook Name",
"active": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Updated Webhook Name', active: false})
};
fetch('https://app.lettr.com/api/webhooks/{webhookId}', 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://app.lettr.com/api/webhooks/{webhookId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Updated Webhook Name',
'active' => 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://app.lettr.com/api/webhooks/{webhookId}"
payload := strings.NewReader("{\n \"name\": \"Updated Webhook Name\",\n \"active\": false\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.lettr.com/api/webhooks/{webhookId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Updated Webhook Name\",\n \"active\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.lettr.com/api/webhooks/{webhookId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Updated Webhook Name\",\n \"active\": false\n}"
response = http.request(request)
puts response.read_body{
"message": "Webhook updated successfully.",
"data": {
"id": "webhook-abc123",
"name": "Updated Webhook Name",
"url": "https://example.com/webhook",
"enabled": false,
"event_types": [
"message.delivery",
"message.bounce"
],
"auth_type": "basic",
"has_auth_credentials": true,
"last_successful_at": "2024-01-15T10:30:00+00:00",
"last_failure_at": null,
"last_status": "success"
}
}Body
application/json
Request body for updating a webhook. Only provided fields will be updated. At least one of name, url, auth_type, events or active is required. Credentials are saved only together with auth_type: basic requires auth_username and auth_password; oauth2 requires oauth_client_id, oauth_client_secret and oauth_token_url.
Event types that trigger the webhook. Fully-prefixed names such as message.delivery are canonical; short names (delivery) and the legacy engagament.* prefix are accepted for backwards compatibility and are normalised to the fully-prefixed form.
Minimum array length:
1Available options:
message.injection, message.delivery, message.bounce, message.delay, message.out_of_band, message.spam_complaint, message.policy_rejection, engagement.click, engagement.open, engagement.initial_open, engagement.amp_click, engagement.amp_open, engagement.amp_initial_open, generation.generation_failure, generation.generation_rejection, unsubscribe.list_unsubscribe, unsubscribe.link_unsubscribe, relay.relay_injection, relay.relay_rejection, relay.relay_delivery, relay.relay_tempfail, relay.relay_permfail Example:
["message.delivery", "message.bounce"]
Was this page helpful?