MailSlurpAPI.Api.WebhookController (mailslurp v15.17.22)

API calls for all endpoints tagged WebhookController.

Summary

Functions

Attach a WebHook URL to an inbox Get notified of account level events such as bounce and bounce recipient.

Attach a WebHook URL to an inbox Get notified whenever an inbox receives an email via a WebHook URL. An emailID will be posted to this URL every time an email is received for this inbox. The URL must be publicly reachable by the MailSlurp server. You can provide basicAuth values if you wish to secure this endpoint.

Attach a WebHook URL to a phone number Get notified whenever a phone number receives an SMS via a WebHook URL.

Delete and disable a Webhook for an Inbox

List account webhooks Paginated List account webhooks in paginated form. Allows for page index, page size, and sort direction.

List Webhooks Paginated List webhooks in paginated form. Allows for page index, page size, and sort direction.

Get JSON Schema definition for webhook payload by event

Get JSON Schema definition for webhook payload

Get test webhook payload example. Response content depends on eventName passed. Uses EMAIL_RECEIVED as default.

Get webhook test payload for bounce

Get webhook test payload for bounce recipient

Get webhook test payload for delivery status event

Get webhook test payload for email opened event

Get webhook test payload for email opened event

Get webhook test payload for new attachment event

Get webhook test payload for new contact event

Get webhook test payload for new email event

Get webhook test payload for new sms event

Get a webhook results for a webhook

Get count of unseen webhook results with error status

Get all webhooks for an Inbox

Get a webhook result and try to resend the original webhook payload Allows you to resend a webhook payload that was already sent. Webhooks that fail are retried automatically for 24 hours and then put in a dead letter queue. You can retry results manually using this method.

Verify a webhook payload signature Verify a webhook payload using the messageId and signature. This allows you to be sure that MailSlurp sent the payload and not another server.

Functions

Link to this function

create_account_webhook(connection, create_webhook_options, opts \\ [])

@spec create_account_webhook(
  Tesla.Env.client(),
  MailSlurpAPI.Model.CreateWebhookOptions.t(),
  keyword()
) :: {:ok, MailSlurpAPI.Model.WebhookDto.t()} | {:error, Tesla.Env.t()}

Attach a WebHook URL to an inbox Get notified of account level events such as bounce and bounce recipient.

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • create_webhook_options (CreateWebhookOptions):
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

create_webhook(connection, inbox_id, create_webhook_options, opts \\ [])

Attach a WebHook URL to an inbox Get notified whenever an inbox receives an email via a WebHook URL. An emailID will be posted to this URL every time an email is received for this inbox. The URL must be publicly reachable by the MailSlurp server. You can provide basicAuth values if you wish to secure this endpoint.

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • inbox_id (String.t):
  • create_webhook_options (CreateWebhookOptions):
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

create_webhook_for_phone_number(connection, phone_number_id, create_webhook_options, opts \\ [])

@spec create_webhook_for_phone_number(
  Tesla.Env.client(),
  String.t(),
  MailSlurpAPI.Model.CreateWebhookOptions.t(),
  keyword()
) :: {:ok, MailSlurpAPI.Model.WebhookDto.t()} | {:error, Tesla.Env.t()}

Attach a WebHook URL to a phone number Get notified whenever a phone number receives an SMS via a WebHook URL.

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • phone_number_id (String.t):
  • create_webhook_options (CreateWebhookOptions):
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

delete_all_webhooks(connection, opts \\ [])

@spec delete_all_webhooks(Tesla.Env.client(), keyword()) ::
  {:ok, nil} | {:error, Tesla.Env.t()}

Delete all webhooks

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters
    • :before (DateTime.t): before

Returns

} on success {:error, info} on failure

Link to this function

delete_webhook(connection, inbox_id, webhook_id, opts \\ [])

@spec delete_webhook(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, nil} | {:error, Tesla.Env.t()}

Delete and disable a Webhook for an Inbox

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • inbox_id (String.t):
  • webhook_id (String.t):
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

delete_webhook_by_id(connection, webhook_id, opts \\ [])

@spec delete_webhook_by_id(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, nil} | {:error, Tesla.Env.t()}

Delete a webhook

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • webhook_id (String.t):
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

get_all_account_webhooks(connection, opts \\ [])

@spec get_all_account_webhooks(Tesla.Env.client(), keyword()) ::
  {:ok, MailSlurpAPI.Model.PageWebhookProjection.t()} | {:error, Tesla.Env.t()}

List account webhooks Paginated List account webhooks in paginated form. Allows for page index, page size, and sort direction.

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters
    • :page (integer()): Optional page index in list pagination
    • :size (integer()): Optional page size for paginated result list.
    • :sort (String.t): Optional createdAt sort direction ASC or DESC
    • :event_type (String.t): Optional event type
    • :since (DateTime.t): Filter by created at after the given timestamp
    • :before (DateTime.t): Filter by created at before the given timestamp

Returns

} on success {:error, info} on failure

Link to this function

get_all_webhook_results(connection, opts \\ [])

@spec get_all_webhook_results(Tesla.Env.client(), keyword()) ::
  {:ok, MailSlurpAPI.Model.PageWebhookResult.t()} | {:error, Tesla.Env.t()}

Get results for all webhooks

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters
    • :page (integer()): Optional page index in list pagination
    • :size (integer()): Optional page size in list pagination
    • :sort (String.t): Optional createdAt sort direction ASC or DESC
    • :search_filter (String.t): Optional search filter
    • :since (DateTime.t): Filter by created at after the given timestamp
    • :before (DateTime.t): Filter by created at before the given timestamp
    • :unseen_only (boolean()): Filter for unseen exceptions only

Returns

} on success {:error, info} on failure

Link to this function

get_all_webhooks(connection, opts \\ [])

@spec get_all_webhooks(Tesla.Env.client(), keyword()) ::
  {:ok, MailSlurpAPI.Model.PageWebhookProjection.t()} | {:error, Tesla.Env.t()}

List Webhooks Paginated List webhooks in paginated form. Allows for page index, page size, and sort direction.

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters
    • :page (integer()): Optional page index in list pagination
    • :size (integer()): Optional page size for paginated result list.
    • :sort (String.t): Optional createdAt sort direction ASC or DESC
    • :search_filter (String.t): Optional search filter
    • :since (DateTime.t): Filter by created at after the given timestamp
    • :inbox_id (String.t): Filter by inboxId
    • :phone_id (String.t): Filter by phoneId
    • :before (DateTime.t): Filter by created at before the given timestamp

Returns

} on success {:error, info} on failure

Link to this function

get_inbox_webhooks_paginated(connection, inbox_id, opts \\ [])

@spec get_inbox_webhooks_paginated(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, MailSlurpAPI.Model.PageWebhookProjection.t()} | {:error, Tesla.Env.t()}

Get paginated webhooks for an Inbox

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • inbox_id (String.t):
  • opts (KeywordList): [optional] Optional parameters
    • :page (integer()): Optional page index in list pagination
    • :size (integer()): Optional page size in list pagination
    • :sort (String.t): Optional createdAt sort direction ASC or DESC
    • :search_filter (String.t): Optional search filter
    • :since (DateTime.t): Filter by created at after the given timestamp
    • :before (DateTime.t): Filter by created at before the given timestamp

Returns

} on success {:error, info} on failure

Link to this function

get_json_schema_for_webhook_event(connection, event, opts \\ [])

@spec get_json_schema_for_webhook_event(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, MailSlurpAPI.Model.JsonSchemaDto.t()} | {:error, Tesla.Env.t()}

Get JSON Schema definition for webhook payload by event

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • event (String.t):
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

get_json_schema_for_webhook_payload(connection, webhook_id, opts \\ [])

@spec get_json_schema_for_webhook_payload(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, MailSlurpAPI.Model.JsonSchemaDto.t()} | {:error, Tesla.Env.t()}

Get JSON Schema definition for webhook payload

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • webhook_id (String.t):
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

get_phone_number_webhooks_paginated(connection, phone_id, opts \\ [])

@spec get_phone_number_webhooks_paginated(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, MailSlurpAPI.Model.PageWebhookProjection.t()} | {:error, Tesla.Env.t()}

Get paginated webhooks for a phone number

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • phone_id (String.t):
  • opts (KeywordList): [optional] Optional parameters
    • :page (integer()): Optional page index in list pagination
    • :size (integer()): Optional page size in list pagination
    • :sort (String.t): Optional createdAt sort direction ASC or DESC
    • :since (DateTime.t): Filter by created at after the given timestamp
    • :before (DateTime.t): Filter by created at before the given timestamp

Returns

} on success {:error, info} on failure

Link to this function

get_test_webhook_payload(connection, opts \\ [])

@spec get_test_webhook_payload(Tesla.Env.client(), keyword()) ::
  {:ok, MailSlurpAPI.Model.AbstractWebhookPayload.t()} | {:error, Tesla.Env.t()}

Get test webhook payload example. Response content depends on eventName passed. Uses EMAIL_RECEIVED as default.

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters
    • :event_name (String.t):

Returns

} on success {:error, info} on failure

Link to this function

get_test_webhook_payload_bounce(connection, opts \\ [])

@spec get_test_webhook_payload_bounce(Tesla.Env.client(), keyword()) ::
  {:ok, MailSlurpAPI.Model.WebhookBouncePayload.t()} | {:error, Tesla.Env.t()}

Get webhook test payload for bounce

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

get_test_webhook_payload_bounce_recipient(connection, opts \\ [])

@spec get_test_webhook_payload_bounce_recipient(Tesla.Env.client(), keyword()) ::
  {:ok, MailSlurpAPI.Model.WebhookBounceRecipientPayload.t()}
  | {:error, Tesla.Env.t()}

Get webhook test payload for bounce recipient

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

get_test_webhook_payload_delivery_status(connection, opts \\ [])

@spec get_test_webhook_payload_delivery_status(Tesla.Env.client(), keyword()) ::
  {:ok, MailSlurpAPI.Model.WebhookDeliveryStatusPayload.t()}
  | {:error, Tesla.Env.t()}

Get webhook test payload for delivery status event

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

get_test_webhook_payload_email_opened(connection, opts \\ [])

@spec get_test_webhook_payload_email_opened(Tesla.Env.client(), keyword()) ::
  {:ok, MailSlurpAPI.Model.WebhookEmailOpenedPayload.t()}
  | {:error, Tesla.Env.t()}

Get webhook test payload for email opened event

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

get_test_webhook_payload_email_read(connection, opts \\ [])

@spec get_test_webhook_payload_email_read(Tesla.Env.client(), keyword()) ::
  {:ok, MailSlurpAPI.Model.WebhookEmailReadPayload.t()}
  | {:error, Tesla.Env.t()}

Get webhook test payload for email opened event

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

get_test_webhook_payload_for_webhook(connection, webhook_id, opts \\ [])

@spec get_test_webhook_payload_for_webhook(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, MailSlurpAPI.Model.AbstractWebhookPayload.t()} | {:error, Tesla.Env.t()}

Get example payload for webhook

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • webhook_id (String.t):
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

get_test_webhook_payload_new_attachment(connection, opts \\ [])

@spec get_test_webhook_payload_new_attachment(Tesla.Env.client(), keyword()) ::
  {:ok, MailSlurpAPI.Model.WebhookNewAttachmentPayload.t()}
  | {:error, Tesla.Env.t()}

Get webhook test payload for new attachment event

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

get_test_webhook_payload_new_contact(connection, opts \\ [])

@spec get_test_webhook_payload_new_contact(Tesla.Env.client(), keyword()) ::
  {:ok, MailSlurpAPI.Model.WebhookNewContactPayload.t()}
  | {:error, Tesla.Env.t()}

Get webhook test payload for new contact event

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

get_test_webhook_payload_new_email(connection, opts \\ [])

@spec get_test_webhook_payload_new_email(Tesla.Env.client(), keyword()) ::
  {:ok, MailSlurpAPI.Model.WebhookNewEmailPayload.t()} | {:error, Tesla.Env.t()}

Get webhook test payload for new email event

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

get_test_webhook_payload_new_sms(connection, opts \\ [])

@spec get_test_webhook_payload_new_sms(Tesla.Env.client(), keyword()) ::
  {:ok, MailSlurpAPI.Model.WebhookNewSmsPayload.t()} | {:error, Tesla.Env.t()}

Get webhook test payload for new sms event

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

get_webhook(connection, webhook_id, opts \\ [])

@spec get_webhook(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, MailSlurpAPI.Model.WebhookDto.t()} | {:error, Tesla.Env.t()}

Get a webhook

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • webhook_id (String.t):
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

get_webhook_result(connection, webhook_result_id, opts \\ [])

@spec get_webhook_result(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, MailSlurpAPI.Model.WebhookResultDto.t()} | {:error, Tesla.Env.t()}

Get a webhook result for a webhook

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • webhook_result_id (String.t): Webhook Result ID
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

get_webhook_results(connection, webhook_id, opts \\ [])

@spec get_webhook_results(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, MailSlurpAPI.Model.PageWebhookResult.t()} | {:error, Tesla.Env.t()}

Get a webhook results for a webhook

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • webhook_id (String.t): ID of webhook to get results for
  • opts (KeywordList): [optional] Optional parameters
    • :page (integer()): Optional page index in list pagination
    • :size (integer()): Optional page size in list pagination
    • :sort (String.t): Optional createdAt sort direction ASC or DESC
    • :search_filter (String.t): Optional search filter
    • :since (DateTime.t): Filter by created at after the given timestamp
    • :before (DateTime.t): Filter by created at before the given timestamp
    • :unseen_only (boolean()): Filter for unseen exceptions only

Returns

} on success {:error, info} on failure

Link to this function

get_webhook_results_unseen_error_count(connection, opts \\ [])

@spec get_webhook_results_unseen_error_count(Tesla.Env.client(), keyword()) ::
  {:ok, MailSlurpAPI.Model.UnseenErrorCountDto.t()} | {:error, Tesla.Env.t()}

Get count of unseen webhook results with error status

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

get_webhooks(connection, inbox_id, opts \\ [])

@spec get_webhooks(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, [MailSlurpAPI.Model.WebhookDto.t()]} | {:error, Tesla.Env.t()}

Get all webhooks for an Inbox

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • inbox_id (String.t):
  • opts (KeywordList): [optional] Optional parameters

Returns

, ...]} on success {:error, info} on failure

Link to this function

redrive_webhook_result(connection, webhook_result_id, opts \\ [])

@spec redrive_webhook_result(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, MailSlurpAPI.Model.WebhookRedriveResult.t()} | {:error, Tesla.Env.t()}

Get a webhook result and try to resend the original webhook payload Allows you to resend a webhook payload that was already sent. Webhooks that fail are retried automatically for 24 hours and then put in a dead letter queue. You can retry results manually using this method.

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • webhook_result_id (String.t): Webhook Result ID
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

send_test_data(connection, webhook_id, opts \\ [])

@spec send_test_data(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, MailSlurpAPI.Model.WebhookTestResult.t()} | {:error, Tesla.Env.t()}

Send webhook test data

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • webhook_id (String.t):
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

update_webhook_headers(connection, webhook_id, webhook_headers, opts \\ [])

@spec update_webhook_headers(
  Tesla.Env.client(),
  String.t(),
  MailSlurpAPI.Model.WebhookHeaders.t(),
  keyword()
) :: {:ok, MailSlurpAPI.Model.WebhookDto.t()} | {:error, Tesla.Env.t()}

Update a webhook request headers

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • webhook_id (String.t):
  • webhook_headers (WebhookHeaders):
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

verify_webhook_signature(connection, verify_webhook_signature_options, opts \\ [])

Verify a webhook payload signature Verify a webhook payload using the messageId and signature. This allows you to be sure that MailSlurp sent the payload and not another server.

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • verify_webhook_signature_options (VerifyWebhookSignatureOptions):
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure