Update a webhook
Update a webhook’s URL and/or event subscription. A webhook is bound to its domain — domain_id is not mutable.
PATCH
/
email_domains
/
{domain_id}
/
webhooks
/
{id}
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const EmailWebhook = await client.emailDomains.webhooks.update('domain_id', 'id', {
url: 'url',
});
console.log(EmailWebhook.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
email_webhook = client.email_domains.webhooks.update(
domain_id="domain_id",
id="id",
url="url",
)
print(email_webhook.data)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
webhook, err := client.EmailDomains.Webhooks.Update(
context.TODO(),
"domain_id",
"id",
telnyx.EmailDomainWebhookUpdateParams{
URL: telnyx.String("url"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", webhook.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.emailDomains.webhooks.WebhookUpdateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
WebhookUpdateParams params = WebhookUpdateParams.builder()
.url("url")
.build();
var response = client.emailDomains().webhooks().update("domain_id", "id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
email_webhook = telnyx.email_domains.webhooks.update("domain_id", "id", url: "url")
puts(email_webhook)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$email_webhook = $client->emailDomains->webhooks->update(
'domain_id',
'id',
url: 'url',
);
var_dump($email_webhook);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx email-domains:webhooks update \
--api-key 'My API Key' \
--domain-id domain_id \
--id id \
--url urlcurl --request PATCH \
--url https://api.telnyx.com/v2/email_domains/{domain_id}/webhooks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
"email.sent",
"email.delivered",
"email.opened"
]
}
'{
"data": {
"id": "123e4567-e89b-12d3-a456-426614174003",
"record_type": "email_webhook",
"url": "https://example.com/webhooks/email",
"events": [
"email.sent",
"email.delivered",
"email.bounced"
],
"domain_id": "123e4567-e89b-12d3-a456-426614174000",
"created_at": "2026-06-18T12:00:00Z",
"updated_at": "2026-06-18T12:00:00Z"
}
}{
"errors": [
{
"code": "10001",
"title": "Not Found",
"detail": "The requested email domain was not found"
}
]
}{
"errors": [
{
"code": "10015",
"title": "Validation Failed",
"detail": "domain is invalid",
"source": {
"pointer": "/data/attributes/domain"
}
}
]
}{
"errors": [
{
"code": "500",
"title": "Internal Server Error",
"detail": "An unexpected error occurred"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Email domain UUID
Email webhook UUID
Body
application/json
Minimum array length:
1Event types a webhook may subscribe to. The union of email.* events (published by email-api) and email_domain.* lifecycle events (published by this service). An event not listed here can never be subscribed to and is silently dropped.
Available options:
email.scheduled, email.sandbox, email.queued, email.sending, email.sent, email.delivered, email.deferred, email.bounced, email.failed, email.complained, email.opened, email.clicked, email.unsubscribed, email.received, email_domain.created, email_domain.verified, email_domain.degraded, email_domain.suspended, email_domain.deleted Response
Email webhook updated
Show child attributes
Show child attributes
Example:
{
"id": "123e4567-e89b-12d3-a456-426614174003",
"record_type": "email_webhook",
"url": "https://example.com/webhooks/email",
"events": [
"email.sent",
"email.delivered",
"email.bounced"
],
"domain_id": "123e4567-e89b-12d3-a456-426614174000",
"created_at": "2026-06-18T12:00:00Z",
"updated_at": "2026-06-18T12:00:00Z"
}
Was this page helpful?
⌘I
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const EmailWebhook = await client.emailDomains.webhooks.update('domain_id', 'id', {
url: 'url',
});
console.log(EmailWebhook.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
email_webhook = client.email_domains.webhooks.update(
domain_id="domain_id",
id="id",
url="url",
)
print(email_webhook.data)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
webhook, err := client.EmailDomains.Webhooks.Update(
context.TODO(),
"domain_id",
"id",
telnyx.EmailDomainWebhookUpdateParams{
URL: telnyx.String("url"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", webhook.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.emailDomains.webhooks.WebhookUpdateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
WebhookUpdateParams params = WebhookUpdateParams.builder()
.url("url")
.build();
var response = client.emailDomains().webhooks().update("domain_id", "id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
email_webhook = telnyx.email_domains.webhooks.update("domain_id", "id", url: "url")
puts(email_webhook)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$email_webhook = $client->emailDomains->webhooks->update(
'domain_id',
'id',
url: 'url',
);
var_dump($email_webhook);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx email-domains:webhooks update \
--api-key 'My API Key' \
--domain-id domain_id \
--id id \
--url urlcurl --request PATCH \
--url https://api.telnyx.com/v2/email_domains/{domain_id}/webhooks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
"email.sent",
"email.delivered",
"email.opened"
]
}
'{
"data": {
"id": "123e4567-e89b-12d3-a456-426614174003",
"record_type": "email_webhook",
"url": "https://example.com/webhooks/email",
"events": [
"email.sent",
"email.delivered",
"email.bounced"
],
"domain_id": "123e4567-e89b-12d3-a456-426614174000",
"created_at": "2026-06-18T12:00:00Z",
"updated_at": "2026-06-18T12:00:00Z"
}
}{
"errors": [
{
"code": "10001",
"title": "Not Found",
"detail": "The requested email domain was not found"
}
]
}{
"errors": [
{
"code": "10015",
"title": "Validation Failed",
"detail": "domain is invalid",
"source": {
"pointer": "/data/attributes/domain"
}
}
]
}{
"errors": [
{
"code": "500",
"title": "Internal Server Error",
"detail": "An unexpected error occurred"
}
]
}