Skip to main content
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
}
'
{
  "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"
  }
}

Authorizations

Authorization
string
header
required

API key for authentication

Path Parameters

webhookId
string
required

The webhook ID to update

Example:

"webhook-abc123"

Body

application/json

Request body for updating a webhook. Only provided fields will be updated.

name
string

Name of the webhook

Maximum string length: 255
Example:

"Updated Webhook Name"

target
string<uri>

URL where webhook events will be sent

Maximum string length: 2048
Example:

"https://example.com/webhook"

auth_type
enum<string>

Authentication type for the webhook

Available options:
none,
basic,
oauth2
Example:

"none"

auth_username
string

Username for basic authentication

Maximum string length: 255
auth_password
string

Password for basic authentication

Maximum string length: 255
oauth_token_url
string<uri>

OAuth2 token URL

Maximum string length: 2048
oauth_client_id
string

OAuth2 client ID

Maximum string length: 255
oauth_client_secret
string

OAuth2 client secret

Maximum string length: 255
events
enum<string>[]

Event types that trigger the webhook

Minimum array length: 1
Available options:
message.injection,
message.delivery,
message.bounce,
message.delay,
message.out_of_band,
message.spam_complaint,
message.policy_rejection,
engagament.click,
engagament.open,
engagament.initial_open,
engagament.amp_click,
engagament.amp_open,
engagament.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"]
active
boolean

Whether the webhook is enabled

Example:

true

Response

Webhook updated successfully

Response containing a single webhook

message
string
required

Human-readable response message

Example:

"Webhook retrieved successfully."

data
object
required

View of a webhook