Karta. Webhooks. Payload
(Karta v1.0.0)
What Karta's own webhook format (version 1) says about an event. The body of a request is a JSON object:
{
"type": "message.delivered",
"timestamp": "2026-12-02T10:15:00.000000Z",
"version": 1,
"data": {...}
}timestamp is when the event happened (UTC); data is the event's:
- every message event:
server_id;message-id,message_id(the header's),mail_from,from,subject,tag,tags,variables,size(bytes),created_at(when it was accepted);recipient-id,address; message.suppressed:suppression-reason(manual,unsubscribe,hard_bounceorcomplaint);message.delivered,message.deferred,message.bounced:delivery-attempt,status,code,enhanced_code,details,mx_host,remote_ip,local_ip,tls_version,tls_cipher,tls_policy, and formessage.deferrednext_attempt_at;message.complained:complaint-feedback_type(RFC 5965's type,abusefor one Karta does not know),user_agent,version,reported_domain,source_ipand the report's own and the quoted message's ids, as the report gave them;message.opened,message.clicked:tracking-ip_network(the client's network, never its address),user_agent, for an openfirst(true when no other open of the recipient was recorded before), and for a clickurlandlink_id;domain.dns_failed:server_id;server-name,slug,organisation(its slug);domain-id,name;checked_at;failed- the checks that turned tofailin this run;checks- every check with a result: itsstatus(pass,warn,fail,missing) and, unless it passed,problem(what was found, in a sentence);webhook.test:webhook_idandmessage, a sentence.
A field whose value Karta does not know is left out. Version 1 changes only by adding fields and event types: a receiver ignores what it does not know. Something incompatible would be a new version.
Summary
Functions
message.accepted for every recipient, and message.suppressed for
those on the suppression list (recipients: their id, address and
status), with the reason they are on it.
The JSON body of a request about an event (Karta.Webhooks.Event or event/0).
A spam complaint about a recipient's copy of a message (a feedback
report, Karta.Complaints.Complaint).
The outcome of a delivery attempt for a recipient: delivery is the
Karta.Outbound.Delivery row as written; next_attempt_at when it was
deferred.
A DNS health check of the domain turned to fail (failed: which);
checks are the domain's results after the run.
The test event sent to one webhook on request.
An open or a click (url: the link's) recorded for a recipient (an
open's first is looked up: call it in the transaction that records
the open).
A one-click unsubscribe of a recipient.
Types
@type event() :: %{type: String.t(), occurred_at: DateTime.t(), data: map()}
Functions
@spec accepted(Karta.Messages.Message.t(), [map()], DateTime.t()) :: [event()]
message.accepted for every recipient, and message.suppressed for
those on the suppression list (recipients: their id, address and
status), with the reason they are on it.
@spec body(%{type: String.t(), occurred_at: DateTime.t(), data: map()}) :: String.t()
The JSON body of a request about an event (Karta.Webhooks.Event or event/0).
@spec complaint( Karta.Messages.Message.t(), map(), Karta.Complaints.Complaint.t(), DateTime.t() ) :: event()
A spam complaint about a recipient's copy of a message (a feedback
report, Karta.Complaints.Complaint).
@spec delivery(Karta.Messages.Message.t(), map(), map(), DateTime.t() | nil) :: event()
The outcome of a delivery attempt for a recipient: delivery is the
Karta.Outbound.Delivery row as written; next_attempt_at when it was
deferred.
@spec dns_failed( Karta.Servers.Server.t(), Karta.Accounts.Organisation.t(), Karta.Domains.Domain.t(), [Karta.Domains.DNSCheck.t()], [atom()], DateTime.t() ) :: event()
A DNS health check of the domain turned to fail (failed: which);
checks are the domain's results after the run.
@spec test(Ecto.UUID.t(), Ecto.UUID.t(), DateTime.t()) :: event()
The test event sent to one webhook on request.
@spec tracking( Karta.Messages.Message.t(), map(), Karta.Tracking.Event.t(), String.t() | nil ) :: event()
An open or a click (url: the link's) recorded for a recipient (an
open's first is looked up: call it in the transaction that records
the open).
@spec unsubscribed(Karta.Messages.Message.t(), map(), DateTime.t()) :: event()
A one-click unsubscribe of a recipient.