Overview
Call this endpoint using a PUT request to update a registered webhook with a new URL provided in the body.
Endpoint
Method | URL | Parameters |
---|---|---|
PUT | https://api.everlytic.net/transactional/email/v1/webhooks/[Webhook ID] | [Webhook ID] – ID of the webhook to be updated. |
Request Body
{ "event_types": [ "string" ], "url": "string", "verb": "string", "auth_details": { "username": "string", "password": "string" }, "auth_type": "basic", "content_type": "string", "field_set": "string", "settings": { "include_html": boolean } }
Properties
Property | Description | Data type | Parameters | Required |
---|---|---|---|---|
event_types | The type of event that will trigger the newly registered webhook | enum (string) |
|
Yes |
url | The URL that will receive the webhook event | string | Valid URL | Yes |
verb | The HTTP method that will be used by the webhook | enum (string) |
|
Yes |
auth_details | Authorization details required by the provided webhook URL. | JSON |
|
No |
|
The username required by the provided webhook URL | string | Valid string | Yes, if auth_details is not empty |
|
The username required by the provided webhook URL | string | Valid string | Yes, if auth_details is not empty |
auth_type | The type of authorization used by the provided webhook URL | enum (string) |
|
Yes, if auth_details is not empty |
content_type | The original media type (prior to any content encoding applied for sending) used for the webhook payload. | enum (string) |
|
No |
field_set | The format of the webhook payload. Set to “legacy” to use the format of legacy transactional callbacks. | enum (string) |
|
No |
settings | Optional settings to be used for this webhook. | JSON |
|
No |
|
Setting to enable sending transactional email’s HTML content as part of webhook payload. HTML content is only sent as part of “sent” event types and only part of the “legacy” field set. |
boolean |
|
No |
Example Request
curl --location 'https://api.everlytic.net/transactional/email/v1/webhooks/07a64775-ec55-40aa-b32b-7969cbf28b6a' \ --data '{ "event_types": [ "sent" ], "url": "https://your.webhook.url", "verb": "post", "auth_details": { "username": "admin", "password": "password123" }, "auth_type": "basic", "content_type": "application/x-www-form-urlencoded", "field_set": "standard", "settings": { "include_html": true } }'
Response
Status codes
Status code | Explanation |
---|---|
200 Ok | Webhook was updated successfully |
400 Bad Request | The request body was formatted improperly |
401 Unauthorized | The provided authorization credentials are incorrect |
412 Precondition Failed | One or more of the required fields were invalid |
Properties
Properties of response with status of 200 Ok
Property | Description | Data type | Parameters |
---|---|---|---|
webhook | Array containing response properties | JSON |
|
id | The ID that will be used to identify the webhook in future requests | string | |
url | The URL that will receive the webhook event | string | |
verb | The HTTP method that will be used by the webhook | enum (string) |
|
auth_details | Authorization details required by the provided webhook URL. | JSON |
|
|
The username required by the provided webhook URL | string | |
|
The password required by the provided webhook URL | string | |
auth_type | The type of authorization used by the provided webhook URL | enum (string) |
|
status | The current state of the new webhook | enum (string) |
|
settings | Optional settings used for this webhook. | JSON |
|
|
Setting to enable sending transactional email’s HTML content as part of webhook payload. HTML content is only sent as part of “sent” event types and only part of the “legacy” field set. |
boolean |
|
content_type | The original media type (prior to any content encoding applied for sending) used for the webhook payload. | enum (string) |
|
field_set | The format of the webhook payload. Set to “legacy” to use the format of legacy transactional callbacks. | enum (string) |
|
updated_timestamp | The date and time that the webhook was last updated | date-time | ISO 8601 date-time string |
created_timestamp | The date and time that the webhook was initially created | date-time | ISO 8601 date-time string |
event_types | Array containing the type of event that will trigger the webhook | array (string) |
|
Properties of response with status 4XX
Property | Description | Data type | Expected parameters |
---|---|---|---|
code | The HTTP response status code | integer |
|
message | The reason for the failure | string | Valid string |
error | Array containing errors field | JSON |
|
errors | Array containing the failure details | JSON |
|
domain | The classification of the type of error | string |
|
reason | Keyword used to describe the error | string |
|
message | Text describing the reason for the failure | string | Valid string |
locationType | The location where the failure occurred | string |
|
location | The type of validation that failed | string |
|
Example response
Successfully updated webhook [200 OK]
{ "webhook": { "id": "c18e399a-2c74-4dcf-8762-a8ff0f7093d8", "url": "https://your.webhook.url", "verb": "get", "auth_details": null, "auth_type": "basic", "status": "enabled", "settings": null, "content_type": "application/x-www-form-urlencoded", "field_set": "standard", "updated_timestamp": "2023-08-24T22:12:56.000Z", "created_timestamp": "2023-08-24T22:10:35.000Z", "event_types": [ "sent" ] } }
Webhook not found [400 Bad Request]
{ "code": 412, "message": "Webhook not found", "error": { "errors": [ { "domain": "global", "reason": "invalid", "message": "Webhook not found", "locationType": "request", "location": "default" } ] } }
Invalid/Missing authorization credentials [401 Unauthorized]
{ "code": 401, "message": "Login Required", "error": { "errors": [ { "domain": "global", "reason": "required", "message": "Login Required", "locationType": "request", "location": "authorization" } ] } }
Request unsuccessful [412 Precondition Failed]
{ "code": 412, "message": "The selected event types is invalid.", "error": { "errors": [ { "domain": "global", "reason": "invalidParameter", "message": "The selected event types is invalid.", "locationType": "request", "location": "webhookValidation" } ] } }