Webhooks
Update Webhook
Updates a webhook’s URL, subscribed events, active state, or metadata. The signing secret is immutable — create a new webhook to rotate it.
PUT
/
webhooks
/
{id}
curl --request PUT \
--url https://api.autosend.com/v1/webhooks/60d5ec49f1b2c72d9c8b1234 \
--header 'Authorization: Bearer AS_your-api-key' \
--header 'Content-Type: application/json' \
--data '{
"events": ["email.delivered", "email.opened", "email.clicked"],
"isActive": false
}'
import requests
webhook_id = "60d5ec49f1b2c72d9c8b1234"
url = f"https://api.autosend.com/v1/webhooks/{webhook_id}"
headers = {
"Authorization": "Bearer AS_your-api-key",
"Content-Type": "application/json"
}
payload = {
"events": ["email.delivered", "email.opened", "email.clicked"],
"isActive": False
}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
const webhookId = '60d5ec49f1b2c72d9c8b1234';
fetch(`https://api.autosend.com/v1/webhooks/${webhookId}`, {
method: 'PUT',
headers: {
'Authorization': 'Bearer AS_your-api-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
events: ['email.delivered', 'email.opened', 'email.clicked'],
isActive: false
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$webhookId = '60d5ec49f1b2c72d9c8b1234';
$url = "https://api.autosend.com/v1/webhooks/{$webhookId}";
$data = [
'events' => ['email.delivered', 'email.opened', 'email.clicked'],
'isActive' => false
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer AS_your-api-key',
'Content-Type: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
webhookID := "60d5ec49f1b2c72d9c8b1234"
url := "https://api.autosend.com/v1/webhooks/" + webhookID
payload := map[string]interface{}{
"events": []string{"email.delivered", "email.opened", "email.clicked"},
"isActive": false,
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("PUT", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer AS_your-api-key")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
public class UpdateWebhook {
public static void main(String[] args) {
try {
String webhookId = "60d5ec49f1b2c72d9c8b1234";
URL url = new URL("https://api.autosend.com/v1/webhooks/" + webhookId);
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("PUT");
con.setRequestProperty("Authorization", "Bearer AS_your-api-key");
con.setRequestProperty("Content-Type", "application/json");
con.setDoOutput(true);
String jsonInputString = "{\n" +
" \"events\": [\"email.delivered\", \"email.opened\", \"email.clicked\"],\n" +
" \"isActive\": false\n" +
"}";
try (OutputStream os = con.getOutputStream()) {
byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
int status = con.getResponseCode();
System.out.println("Response Status: " + status);
} catch (Exception e) {
e.printStackTrace();
}
}
}
require 'net/http'
require 'json'
require 'uri'
webhook_id = '60d5ec49f1b2c72d9c8b1234'
uri = URI("https://api.autosend.com/v1/webhooks/#{webhook_id}")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Put.new(uri.request_uri)
request['Authorization'] = 'Bearer AS_your-api-key'
request['Content-Type'] = 'application/json'
request.body = {
events: ['email.delivered', 'email.opened', 'email.clicked'],
isActive: false
}.to_json
response = http.request(request)
puts response.body
{
"success": true,
"message": "Webhook updated successfully",
"data": {
"id": "60d5ec49f1b2c72d9c8b1234",
"organizationId": "60d5ec49f1b2c72d9c8b0000",
"projectId": "60d5ec49f1b2c72d9c8b1111",
"url": "https://example.com/webhooks/autosend",
"secret": "***hidden***",
"events": ["email.delivered", "email.opened", "email.clicked"],
"isActive": false,
"status": "inactive",
"failureCount": 0,
"lastFailedAt": null,
"lastSuccessAt": "2026-06-12T10:00:00.000Z",
"lastDeliveredAt": "2026-06-12T10:00:00.000Z",
"metadata": { "team": "growth" },
"createdAt": "2026-06-01T09:00:00.000Z",
"updatedAt": "2026-06-12T11:00:00.000Z"
}
}
This endpoint accepts a project API key (
AS_ prefix). The signing secret is immutable — create a new webhook to rotate it. Supplying a secret field returns a 400 error.curl --request PUT \
--url https://api.autosend.com/v1/webhooks/60d5ec49f1b2c72d9c8b1234 \
--header 'Authorization: Bearer AS_your-api-key' \
--header 'Content-Type: application/json' \
--data '{
"events": ["email.delivered", "email.opened", "email.clicked"],
"isActive": false
}'
import requests
webhook_id = "60d5ec49f1b2c72d9c8b1234"
url = f"https://api.autosend.com/v1/webhooks/{webhook_id}"
headers = {
"Authorization": "Bearer AS_your-api-key",
"Content-Type": "application/json"
}
payload = {
"events": ["email.delivered", "email.opened", "email.clicked"],
"isActive": False
}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
const webhookId = '60d5ec49f1b2c72d9c8b1234';
fetch(`https://api.autosend.com/v1/webhooks/${webhookId}`, {
method: 'PUT',
headers: {
'Authorization': 'Bearer AS_your-api-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
events: ['email.delivered', 'email.opened', 'email.clicked'],
isActive: false
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$webhookId = '60d5ec49f1b2c72d9c8b1234';
$url = "https://api.autosend.com/v1/webhooks/{$webhookId}";
$data = [
'events' => ['email.delivered', 'email.opened', 'email.clicked'],
'isActive' => false
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer AS_your-api-key',
'Content-Type: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
webhookID := "60d5ec49f1b2c72d9c8b1234"
url := "https://api.autosend.com/v1/webhooks/" + webhookID
payload := map[string]interface{}{
"events": []string{"email.delivered", "email.opened", "email.clicked"},
"isActive": false,
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("PUT", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer AS_your-api-key")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
public class UpdateWebhook {
public static void main(String[] args) {
try {
String webhookId = "60d5ec49f1b2c72d9c8b1234";
URL url = new URL("https://api.autosend.com/v1/webhooks/" + webhookId);
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("PUT");
con.setRequestProperty("Authorization", "Bearer AS_your-api-key");
con.setRequestProperty("Content-Type", "application/json");
con.setDoOutput(true);
String jsonInputString = "{\n" +
" \"events\": [\"email.delivered\", \"email.opened\", \"email.clicked\"],\n" +
" \"isActive\": false\n" +
"}";
try (OutputStream os = con.getOutputStream()) {
byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
int status = con.getResponseCode();
System.out.println("Response Status: " + status);
} catch (Exception e) {
e.printStackTrace();
}
}
}
require 'net/http'
require 'json'
require 'uri'
webhook_id = '60d5ec49f1b2c72d9c8b1234'
uri = URI("https://api.autosend.com/v1/webhooks/#{webhook_id}")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Put.new(uri.request_uri)
request['Authorization'] = 'Bearer AS_your-api-key'
request['Content-Type'] = 'application/json'
request.body = {
events: ['email.delivered', 'email.opened', 'email.clicked'],
isActive: false
}.to_json
response = http.request(request)
puts response.body
{
"success": true,
"message": "Webhook updated successfully",
"data": {
"id": "60d5ec49f1b2c72d9c8b1234",
"organizationId": "60d5ec49f1b2c72d9c8b0000",
"projectId": "60d5ec49f1b2c72d9c8b1111",
"url": "https://example.com/webhooks/autosend",
"secret": "***hidden***",
"events": ["email.delivered", "email.opened", "email.clicked"],
"isActive": false,
"status": "inactive",
"failureCount": 0,
"lastFailedAt": null,
"lastSuccessAt": "2026-06-12T10:00:00.000Z",
"lastDeliveredAt": "2026-06-12T10:00:00.000Z",
"metadata": { "team": "growth" },
"createdAt": "2026-06-01T09:00:00.000Z",
"updatedAt": "2026-06-12T11:00:00.000Z"
}
}
Authorizations
string | header
required
Project API key header of the form Bearer
AS_<key>.Path Parameters
string
required
The unique identifier of the webhook.Example:
"60d5ec49f1b2c72d9c8b1234"Body
All fields are optional — only the fields you supply are updated.string
A new destination URL (must include the
http/https protocol).Example: "https://example.com/webhooks/autosend"string[]
Replaces the subscribed event list. Must contain at least one valid event.Example:
["email.delivered", "email.opened"]boolean
Enable or disable delivery without deleting the webhook.Example:
falseResponse
Webhook updated successfully (200)boolean
Indicates if the request was successful
object
The updated webhook object. The signing secret is always masked as
***hidden***.Show child attributes
Show child attributes
string
Unique webhook identifier
string
The destination URL events are delivered to
string[]
The updated subscribed event types
boolean
Whether the webhook is currently active
string
Delivery status. One of
active, inactive, or disabledinteger
Number of consecutive delivery failures (reset to
0 when re-activating)string | null
Timestamp of the most recent failed delivery (ISO 8601), or
nullstring | null
Timestamp of the most recent successful delivery (ISO 8601), or
nullstring | null
Timestamp of the most recent delivery attempt (ISO 8601), or
nullobject | null
Arbitrary key-value metadata attached to the webhook
string
ISO 8601 creation timestamp
string
ISO 8601 last-updated timestamp
Error Responses
object
Returned when a
secret field is included in the request body.{
"success": false,
"error": {
"message": "Secret cannot be updated. Create a new webhook instead.",
"code": "VALIDATION_ERROR",
}
}
object
Returned when no webhook with the given ID exists in the project.
{
"success": false,
"error": {
"message": "Webhook not found",
"code": "WEBHOOK_NOT_FOUND",
}
}
Was this page helpful?
⌘I
curl --request PUT \
--url https://api.autosend.com/v1/webhooks/60d5ec49f1b2c72d9c8b1234 \
--header 'Authorization: Bearer AS_your-api-key' \
--header 'Content-Type: application/json' \
--data '{
"events": ["email.delivered", "email.opened", "email.clicked"],
"isActive": false
}'
import requests
webhook_id = "60d5ec49f1b2c72d9c8b1234"
url = f"https://api.autosend.com/v1/webhooks/{webhook_id}"
headers = {
"Authorization": "Bearer AS_your-api-key",
"Content-Type": "application/json"
}
payload = {
"events": ["email.delivered", "email.opened", "email.clicked"],
"isActive": False
}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
const webhookId = '60d5ec49f1b2c72d9c8b1234';
fetch(`https://api.autosend.com/v1/webhooks/${webhookId}`, {
method: 'PUT',
headers: {
'Authorization': 'Bearer AS_your-api-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
events: ['email.delivered', 'email.opened', 'email.clicked'],
isActive: false
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$webhookId = '60d5ec49f1b2c72d9c8b1234';
$url = "https://api.autosend.com/v1/webhooks/{$webhookId}";
$data = [
'events' => ['email.delivered', 'email.opened', 'email.clicked'],
'isActive' => false
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer AS_your-api-key',
'Content-Type: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
webhookID := "60d5ec49f1b2c72d9c8b1234"
url := "https://api.autosend.com/v1/webhooks/" + webhookID
payload := map[string]interface{}{
"events": []string{"email.delivered", "email.opened", "email.clicked"},
"isActive": false,
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("PUT", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer AS_your-api-key")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
public class UpdateWebhook {
public static void main(String[] args) {
try {
String webhookId = "60d5ec49f1b2c72d9c8b1234";
URL url = new URL("https://api.autosend.com/v1/webhooks/" + webhookId);
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("PUT");
con.setRequestProperty("Authorization", "Bearer AS_your-api-key");
con.setRequestProperty("Content-Type", "application/json");
con.setDoOutput(true);
String jsonInputString = "{\n" +
" \"events\": [\"email.delivered\", \"email.opened\", \"email.clicked\"],\n" +
" \"isActive\": false\n" +
"}";
try (OutputStream os = con.getOutputStream()) {
byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
int status = con.getResponseCode();
System.out.println("Response Status: " + status);
} catch (Exception e) {
e.printStackTrace();
}
}
}
require 'net/http'
require 'json'
require 'uri'
webhook_id = '60d5ec49f1b2c72d9c8b1234'
uri = URI("https://api.autosend.com/v1/webhooks/#{webhook_id}")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Put.new(uri.request_uri)
request['Authorization'] = 'Bearer AS_your-api-key'
request['Content-Type'] = 'application/json'
request.body = {
events: ['email.delivered', 'email.opened', 'email.clicked'],
isActive: false
}.to_json
response = http.request(request)
puts response.body
{
"success": true,
"message": "Webhook updated successfully",
"data": {
"id": "60d5ec49f1b2c72d9c8b1234",
"organizationId": "60d5ec49f1b2c72d9c8b0000",
"projectId": "60d5ec49f1b2c72d9c8b1111",
"url": "https://example.com/webhooks/autosend",
"secret": "***hidden***",
"events": ["email.delivered", "email.opened", "email.clicked"],
"isActive": false,
"status": "inactive",
"failureCount": 0,
"lastFailedAt": null,
"lastSuccessAt": "2026-06-12T10:00:00.000Z",
"lastDeliveredAt": "2026-06-12T10:00:00.000Z",
"metadata": { "team": "growth" },
"createdAt": "2026-06-01T09:00:00.000Z",
"updatedAt": "2026-06-12T11:00:00.000Z"
}
}