Table of Contents

Class Webhook

Namespace
Mailtrap.Webhooks.Models
Assembly
Mailtrap.Abstractions.dll

Represents webhook details.

public record Webhook : IEquatable<Webhook>
Inheritance
Webhook
Implements
Derived

Properties

Active

Gets or sets a value indicating whether the webhook is active.

[JsonPropertyName("active")]
[JsonPropertyOrder(3)]
public bool Active { get; set; }

Property Value

bool

true when the webhook is active; false otherwise.

DomainId

Gets or sets the domain ID the webhook is scoped to.
Applicable only for email_sending webhooks; null means all domains.

[JsonPropertyName("domain_id")]
[JsonPropertyOrder(7)]
public long? DomainId { get; set; }

Property Value

long?

Domain identifier or null when scoped to all domains.

EventTypes

Gets or sets the list of event types the webhook is subscribed to.
Applicable only for email_sending webhooks.

[JsonPropertyName("event_types")]
[JsonPropertyOrder(8)]
[JsonObjectCreationHandling(JsonObjectCreationHandling.Populate)]
public IList<WebhookEventType> EventTypes { get; }

Property Value

IList<WebhookEventType>

List of event types.

Id

Gets or sets webhook identifier.

[JsonPropertyName("id")]
[JsonPropertyOrder(1)]
public long Id { get; set; }

Property Value

long

Webhook identifier.

PayloadFormat

Gets or sets the format of the webhook payload.

[JsonPropertyName("payload_format")]
[JsonPropertyOrder(5)]
public WebhookPayloadFormat PayloadFormat { get; set; }

Property Value

WebhookPayloadFormat

Webhook payload format. Allowed values: "json", "jsonlines".

SendingStream

Gets or sets sending stream the webhook is subscribed to.
Applicable only for email_sending webhooks.

[JsonPropertyName("sending_stream")]
[JsonPropertyOrder(6)]
public SendingStream? SendingStream { get; set; }

Property Value

SendingStream

Sending stream or null when not applicable.

Url

Gets or sets the URL that will receive webhook payloads.

[JsonPropertyName("url")]
[JsonPropertyOrder(2)]
public Uri? Url { get; set; }

Property Value

Uri

The URL that will receive webhook payloads.

WebhookType

Gets or sets webhook type.

[JsonPropertyName("webhook_type")]
[JsonPropertyOrder(4)]
public WebhookType WebhookType { get; set; }

Property Value

WebhookType

Webhook type. Allowed values: "email_sending", "audit_log".