Hoppa till innehållet

Webhook events

Sendora posts each event as JSON to the webhooks that take it. A delivery may arrive more than once, so key your handling on id, and verify Sendora-Signature before you trust the body. Webhooks shows how.

Every field of an event is always present. A field that can be null says so in its type.

Headers

POST /webhooks/sendora HTTP/1.1
Host: example.com
Content-Type: application/json
User-Agent: Sendora-Webhooks/1
Sendora-Event: delivered
Sendora-Delivery-Id: 9b2f4c1e-7a3d-4e5f-8c6b-1d2e3f4a5b6c
Sendora-Signature: t=1789473603,v1=<hex>

{
  "id": "9b2f4c1e-7a3d-4e5f-8c6b-1d2e3f4a5b6c",
  "attempt": 1,
  "event": "delivered",
  …
}
  • Sendora-Signatureheaderstring

    t= the Unix time of sending, then v1= an HMAC-SHA256 over <t>.<body> for each live secret of the webhook, the newest first. Verify one before you trust the body.

  • Sendora-Eventheaderstring

    The event, the same as event in the body.

  • Sendora-Delivery-Idheaderstring

    The delivery, the same as id in the body and on every retry of it.

  • User-Agentheaderstring

    Sendora-Webhooks/1.

  • 2XX your answer

    Acknowledges the delivery. Any other answer, or none within 10 seconds, is retried.

Message events

Every event in this group carries these fields:

  • idstring

    The delivery's id. A delivery may arrive more than once, so key your handling on it.

  • attemptinteger

    The attempt number, from 1.

  • messageIdstring

    The message the event is about.

  • recipientstring

    The recipient the event is about.

  • occurredAtstring (date-time)

    When it happened.

  • serverIdstring

    The server the message was sent from.

  • streamIdstring

    The stream the message went on.

  • broadcastIdstring or null

    The broadcast the message belongs to; null for a message sent on its own.

  • tagstring or null

    The tag you sent with the message.

  • metadatamap of string to string

    The metadata you sent with the message.

  • testboolean

    True for a test server's message: the event was simulated and nothing was sent.

delivered

SDK type DeliveredEvent

The receiver accepted the message for the recipient.

Example

{
  "id": "9b2f4c1e-7a3d-4e5f-8c6b-1d2e3f4a5b6c",
  "attempt": 1,
  "messageId": "5f432ffd-c005-499b-aa3a-5b8a088ea20e",
  "recipient": "anna@example.com",
  "occurredAt": "2026-09-15T12:00:03.000Z",
  "serverId": "0f8a1b2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c",
  "streamId": "3d1a2b4c-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "broadcastId": null,
  "tag": "invoice",
  "metadata": {
    "invoiceId": "2026-0912"
  },
  "test": false,
  "event": "delivered",
  "details": {
    "code": 250,
    "response": "2.0.0 OK"
  }
}
  • event"delivered"
  • detailsobject
    • codeinteger or null

      The SMTP status code the receiver answered; null when it gave none.

    • responsestring or null

      The receiver's response text.

bounced

SDK type BouncedEvent

The receiver refused the message for good, or Sendora gave up; the recipient is suppressed when hard.

Example

{
  "id": "9b2f4c1e-7a3d-4e5f-8c6b-1d2e3f4a5b6c",
  "attempt": 1,
  "messageId": "5f432ffd-c005-499b-aa3a-5b8a088ea20e",
  "recipient": "anna@example.com",
  "occurredAt": "2026-09-15T12:00:03.000Z",
  "serverId": "0f8a1b2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c",
  "streamId": "3d1a2b4c-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "broadcastId": null,
  "tag": "invoice",
  "metadata": {
    "invoiceId": "2026-0912"
  },
  "test": false,
  "event": "bounced",
  "details": {
    "code": 550,
    "response": "5.1.1 The email account that you tried to reach does not exist.",
    "classification": "InvalidRecipient",
    "hard": true,
    "expired": false
  }
}
  • event"bounced"
  • detailsobject
    • codeinteger or null

      The SMTP status code the receiver answered; null when it gave none.

    • responsestring or null

      The receiver's response text.

    • classificationstring or null

      How the bounce was classified, such as InvalidRecipient.

    • hardboolean

      True when the address is now on the suppression list.

    • expiredboolean

      True when the message expired after repeated deferrals rather than being refused.

deferred

SDK type DeferredEvent

The receiver asked Sendora to try later; several may follow.

Example

{
  "id": "9b2f4c1e-7a3d-4e5f-8c6b-1d2e3f4a5b6c",
  "attempt": 1,
  "messageId": "5f432ffd-c005-499b-aa3a-5b8a088ea20e",
  "recipient": "anna@example.com",
  "occurredAt": "2026-09-15T12:00:03.000Z",
  "serverId": "0f8a1b2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c",
  "streamId": "3d1a2b4c-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "broadcastId": null,
  "tag": "invoice",
  "metadata": {
    "invoiceId": "2026-0912"
  },
  "test": false,
  "event": "deferred",
  "details": {
    "code": 451,
    "response": "4.7.1 Greylisted, try again later"
  }
}
  • event"deferred"
  • detailsobject
    • codeinteger or null

      The SMTP status code the receiver answered; null when it gave none.

    • responsestring or null

      The receiver's response text.

spam_complaint

SDK type SpamComplaintEvent

The recipient reported the message as spam; only Sendora support lifts that suppression.

Example

{
  "id": "9b2f4c1e-7a3d-4e5f-8c6b-1d2e3f4a5b6c",
  "attempt": 1,
  "messageId": "5f432ffd-c005-499b-aa3a-5b8a088ea20e",
  "recipient": "anna@example.com",
  "occurredAt": "2026-09-15T12:00:03.000Z",
  "serverId": "0f8a1b2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c",
  "streamId": "3d1a2b4c-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "broadcastId": null,
  "tag": "invoice",
  "metadata": {
    "invoiceId": "2026-0912"
  },
  "test": false,
  "event": "spam_complaint",
  "details": {
    "feedbackType": "abuse"
  }
}
  • event"spam_complaint"
  • detailsobject
    • feedbackTypestring or null

      The feedback type the receiver reported, such as abuse.

unsubscribed

SDK type UnsubscribedEvent

The recipient unsubscribed through the link or their mail client's one-click button; only Sendora support lifts that suppression.

Example

{
  "id": "9b2f4c1e-7a3d-4e5f-8c6b-1d2e3f4a5b6c",
  "attempt": 1,
  "messageId": "5f432ffd-c005-499b-aa3a-5b8a088ea20e",
  "recipient": "anna@example.com",
  "occurredAt": "2026-09-15T12:00:03.000Z",
  "serverId": "0f8a1b2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c",
  "streamId": "3d1a2b4c-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "broadcastId": "2c4e6a8b-0d1f-4a3b-8c5d-7e9f1a3b5c7d",
  "tag": "newsletter",
  "metadata": {},
  "test": false,
  "event": "unsubscribed",
  "details": {
    "source": "one_click"
  }
}
  • event"unsubscribed"
  • detailsobject
    • source"link" | "one_click"

      link for the page's button, one_click for a mail client's request.

opened

SDK type OpenedEvent

The pixel of a tracked copy loaded, for a person or a machine; automated says which. A webhook gets this event only if it names it.

Example (27 lines)
{
  "id": "9b2f4c1e-7a3d-4e5f-8c6b-1d2e3f4a5b6c",
  "attempt": 1,
  "messageId": "5f432ffd-c005-499b-aa3a-5b8a088ea20e",
  "recipient": "anna@example.com",
  "occurredAt": "2026-09-15T12:00:03.000Z",
  "serverId": "0f8a1b2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c",
  "streamId": "3d1a2b4c-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "broadcastId": null,
  "tag": "invoice",
  "metadata": {
    "invoiceId": "2026-0912"
  },
  "test": false,
  "event": "opened",
  "details": {
    "automated": "unknown",
    "agent": "apple_privacy",
    "reasons": [
      "privacy_proxy"
    ],
    "client": "apple_mail",
    "device": null,
    "first": true,
    "firstHuman": false
  }
}
  • event"opened"
  • detailsobject
    • automated"likely" | "unlikely" | "unknown"

      Whether a machine rather than a person did it: likely, unlikely, or unknown where nobody can tell, as with Apple's privacy protection.

    • agent"apple_privacy" | "gmail_prefetch" | "gmail_proxy" | "yahoo_proxy" | "outlook_prefetch" | "proton_proxy" | "scanner" | "crawler" or null

      The proxy or machine it came through, where Sendora knows it.

    • reasonsarray of "privacy_proxy" | "prefetch_signature" | "delivery_timing" | "link_burst" | "scanner_network" | "bot_user_agent" | "many_networks"

      Why it was labelled a machine's.

    • client"apple_mail" | "gmail" | "outlook" | "yahoo" | "thunderbird" | "proton" | "browser" | "other" or null

      The mail program, where Sendora knows it.

    • device"desktop" | "mobile" | "tablet" or null

      The kind of device, where Sendora knows it.

    • firstboolean

      The recipient's first event of this kind.

    • firstHumanboolean

      The recipient's first event of this kind that was likely a person's.

clicked

SDK type ClickedEvent

A tracked link was followed, by a person or a machine; automated says which. A webhook gets this event only if it names it.

Example (29 lines)
{
  "id": "9b2f4c1e-7a3d-4e5f-8c6b-1d2e3f4a5b6c",
  "attempt": 1,
  "messageId": "5f432ffd-c005-499b-aa3a-5b8a088ea20e",
  "recipient": "anna@example.com",
  "occurredAt": "2026-09-15T12:00:03.000Z",
  "serverId": "0f8a1b2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c",
  "streamId": "3d1a2b4c-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "broadcastId": null,
  "tag": "invoice",
  "metadata": {
    "invoiceId": "2026-0912"
  },
  "test": false,
  "event": "clicked",
  "details": {
    "automated": "unlikely",
    "agent": null,
    "reasons": [],
    "client": "browser",
    "device": "desktop",
    "first": true,
    "firstHuman": true,
    "link": {
      "index": 0,
      "url": "https://example.se/invoices/2026-0912"
    }
  }
}
  • event"clicked"
  • detailsobject
    • automated"likely" | "unlikely" | "unknown"

      Whether a machine rather than a person did it: likely, unlikely, or unknown where nobody can tell, as with Apple's privacy protection.

    • agent"apple_privacy" | "gmail_prefetch" | "gmail_proxy" | "yahoo_proxy" | "outlook_prefetch" | "proton_proxy" | "scanner" | "crawler" or null

      The proxy or machine it came through, where Sendora knows it.

    • reasonsarray of "privacy_proxy" | "prefetch_signature" | "delivery_timing" | "link_burst" | "scanner_network" | "bot_user_agent" | "many_networks"

      Why it was labelled a machine's.

    • client"apple_mail" | "gmail" | "outlook" | "yahoo" | "thunderbird" | "proton" | "browser" | "other" or null

      The mail program, where Sendora knows it.

    • device"desktop" | "mobile" | "tablet" or null

      The kind of device, where Sendora knows it.

    • firstboolean

      The recipient's first event of this kind.

    • firstHumanboolean

      The recipient's first event of this kind that was likely a person's.

    • linkobject

      The link that was followed.

      • indexinteger

        The link's position in the HTML, the same in every copy, counting from 0.

      • urlstring or null

        Where the link led; null once it has gone with the message's text and HTML.

tracking_opted_out

SDK type TrackingOptedOutEvent

The recipient asked not to be tracked, on the page that {{ tracking_opt_out_url }} links to, so the address is on the server's not-tracked list. A webhook that leaves out events gets this event. None goes when the recipient asks from mail that has left the log or after an erasure, since it could name nobody.

Example

{
  "id": "9b2f4c1e-7a3d-4e5f-8c6b-1d2e3f4a5b6c",
  "attempt": 1,
  "messageId": "5f432ffd-c005-499b-aa3a-5b8a088ea20e",
  "recipient": "anna@example.com",
  "occurredAt": "2026-09-15T12:00:03.000Z",
  "serverId": "0f8a1b2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c",
  "streamId": "3d1a2b4c-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "broadcastId": null,
  "tag": "invoice",
  "metadata": {
    "invoiceId": "2026-0912"
  },
  "test": false,
  "event": "tracking_opted_out"
}
  • event"tracking_opted_out"

The monthly cap

Every event in this group carries these fields:

  • idstring

    The delivery's id. A delivery may arrive more than once, so key your handling on it.

  • attemptinteger

    The attempt number, from 1.

  • scope"account" | "server" | "test"

    Whose cap it is: account for the account's, server for a server's own, test for the cap the account's test servers share.

  • serverIdstring or null

    The server whose cap it is; null for the account's or the test servers' cap.

  • capinteger

    Emails the scope may send in the month.

  • usedinteger

    Emails sent in the month so far.

  • periodStartstring (date-time)

    When the month the counts are for began. A paying account's live servers count months from the day and time of its first payment, and the rest count calendar months in UTC.

  • periodEndstring (date-time)

    When that month ends and the count starts again.

  • occurredAtstring (date-time)

    When it happened.

cap_warning

SDK type CapWarningEvent

80 percent of the monthly cap is used.

Example

{
  "id": "4d6f8a0b-2c4e-4f6a-8b0c-2d4e6f8a0b1c",
  "attempt": 1,
  "scope": "account",
  "serverId": null,
  "cap": 50000,
  "periodStart": "2026-09-01T00:00:00.000Z",
  "periodEnd": "2026-10-01T00:00:00.000Z",
  "used": 40000,
  "occurredAt": "2026-09-24T09:30:00.000Z",
  "event": "cap_warning"
}
  • event"cap_warning"

cap_reached

SDK type CapReachedEvent

A send was refused because the monthly cap is used up.

Example

{
  "id": "4d6f8a0b-2c4e-4f6a-8b0c-2d4e6f8a0b1c",
  "attempt": 1,
  "scope": "account",
  "serverId": null,
  "cap": 50000,
  "periodStart": "2026-09-01T00:00:00.000Z",
  "periodEnd": "2026-10-01T00:00:00.000Z",
  "used": 50000,
  "occurredAt": "2026-09-29T16:05:00.000Z",
  "event": "cap_reached"
}
  • event"cap_reached"

Received mail

inbound

SDK type InboundEvent

A message was received on an inbound stream: the reference, or the reference and the message itself, as the webhook asks.

Both forms carry these fields:

  • idstring

    The delivery's id. A delivery may arrive more than once, so key your handling on it.

  • attemptinteger

    The attempt number, from 1.

  • event"inbound"
  • inboundMessageIdstring

    The received message; GET /v1/inbound/{id} reads it.

  • serverIdstring

    The server whose stream received it.

  • streamIdstring

    The inbound stream that received it.

  • receivedAtstring (date-time)

    When the message was accepted from the sending server.

  • envelopeRecipientstring

    The address of yours the message was sent to.

  • mailboxHashstring or null

    The text after + in the local part of that address, when the sender used one.

  • sizeBytesinteger

    The size of the message as received, in bytes.

  • attachmentCountinteger
  • hasTextboolean
  • hasHtmlboolean
  • authenticationobject

    What Sendora found when it checked the message's authentication; unchecked until the checks have run.

    • spf"pass" | "fail" | "softfail" | "neutral" | "none" | "temperror" | "permerror" | "unchecked"

      SPF for the address in MAIL FROM.

    • spfHelo"pass" | "fail" | "softfail" | "neutral" | "none" | "temperror" | "permerror" | "unchecked"

      SPF for the name the sending server gave in HELO.

    • dkim"pass" | "fail" | "none" | "temperror" | "permerror" | "unchecked"
    • dmarc"pass" | "fail" | "none" | "temperror" | "permerror" | "unchecked"
    • dmarcPolicy"none" | "quarantine" | "reject" or null

      What the sender's domain asks for; told only when DMARC failed.

    • arc"none" | "pass" | "fail" | "unchecked"
    • checkedAtstring (date-time) or null

      When the checks ran; null until they have.

  • parseIssuestring or null

    What the parser met; null when the message parsed clean. A hard issue empties the parsed parts, and the raw message stays: no_headers, header_block_too_large, too_many_headers, too_many_parts, nesting_too_deep, missing_boundary, decoded_too_large, parse_timeout, parser_error. A soft issue keeps them and says what was changed or dropped: truncated_multipart, too_many_attachments, unknown_transfer_encoding, undecodable_container, filename_sanitised, control_chars_stripped, multiple_from, duplicate_header, malformed_header_dropped, address_list_truncated, header_value_truncated. A message with several names the hard one, or the first soft one in this order.

  1. The reference to the received message, for a webhook with inboundContent reference.

    Example

    {
      "id": "6e8a0c2e-4a6c-4e8a-8c0e-2a4c6e8a0c2e",
      "attempt": 1,
      "event": "inbound",
      "inboundMessageId": "1b3d5f7a-9c1e-4b3d-8f7a-9c1e3b5d7f9a",
      "serverId": "0f8a1b2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c",
      "streamId": "8a0c2e4a-6c8e-4a0c-8e4a-6c8e0a2c4e6a",
      "receivedAt": "2026-09-15T12:00:00.000Z",
      "envelopeRecipient": "support@example.se",
      "mailboxHash": null,
      "sizeBytes": 18432,
      "attachmentCount": 1,
      "hasText": true,
      "hasHtml": true,
      "authentication": {
        "spf": "pass",
        "spfHelo": "pass",
        "dkim": "pass",
        "dmarc": "pass",
        "dmarcPolicy": null,
        "arc": "none",
        "checkedAt": "2026-09-15T12:00:00.000Z"
      },
      "parseIssue": null
    }
  2. The reference and the message itself, for a webhook with inboundContent full.

    Example (74 lines)
    {
      "id": "6e8a0c2e-4a6c-4e8a-8c0e-2a4c6e8a0c2e",
      "attempt": 1,
      "event": "inbound",
      "inboundMessageId": "1b3d5f7a-9c1e-4b3d-8f7a-9c1e3b5d7f9a",
      "serverId": "0f8a1b2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c",
      "streamId": "8a0c2e4a-6c8e-4a0c-8e4a-6c8e0a2c4e6a",
      "receivedAt": "2026-09-15T12:00:00.000Z",
      "envelopeRecipient": "support@example.se",
      "mailboxHash": null,
      "sizeBytes": 18432,
      "attachmentCount": 1,
      "hasText": true,
      "hasHtml": true,
      "authentication": {
        "spf": "pass",
        "spfHelo": "pass",
        "dkim": "pass",
        "dmarc": "pass",
        "dmarcPolicy": null,
        "arc": "none",
        "checkedAt": "2026-09-15T12:00:00.000Z"
      },
      "parseIssue": null,
      "envelope": {
        "sender": "anna@example.com"
      },
      "from": {
        "address": "anna@example.com",
        "name": "Anna Andersson"
      },
      "replyTo": [],
      "to": [
        {
          "address": "support@example.se",
          "name": null
        }
      ],
      "toCount": 1,
      "cc": [],
      "ccCount": 0,
      "subject": "A question about the invoice",
      "date": "2026-09-15T11:59:58.000Z",
      "messageIdHeader": "<20260915115958.a1b2@example.com>",
      "inReplyTo": null,
      "references": [],
      "headers": [
        {
          "name": "From",
          "value": "Anna Andersson <anna@example.com>"
        },
        {
          "name": "To",
          "value": "support@example.se"
        },
        {
          "name": "Subject",
          "value": "A question about the invoice"
        }
      ],
      "text": "Hi! I have a question about the invoice for September.",
      "html": "<p>Hi! I have a question about the invoice for September.</p>",
      "attachments": [
        {
          "position": 0,
          "name": "invoice.pdf",
          "contentType": "application/pdf",
          "contentId": null,
          "size": 15360,
          "inline": false
        }
      ],
      "contentOmitted": null
    }
    • envelopeobject or null

      The envelope sender; null for a bounce.

      • senderstring or null
    • fromobject or null
      • addressstring
      • namestring or null
    • replyToarray of object
      • addressstring
      • namestring or null
    • toarray of object

      Up to 100 entries; toCount is the whole number.

      • addressstring
      • namestring or null
    • toCountinteger
    • ccarray of object

      Up to 100 entries; ccCount is the whole number.

      • addressstring
      • namestring or null
    • ccCountinteger
    • subjectstring or null
    • datestring (date-time) or null

      The sender's Date header, when it was a real moment.

    • messageIdHeaderstring or null
    • inReplyTostring or null
    • referencesarray of string
    • headersarray of object
      • namestring
      • valuestring
    • textstring or null

      The plain-text body; null when there is none, or over 1 MiB.

    • htmlstring or null

      The HTML body; null when there is none, or over 2 MiB.

    • attachmentsarray of object

      Each attachment, without its bytes.

      • positioninteger

        Its place among the message's attachments, from 0.

      • namestring
      • contentTypestring
      • contentIdstring or null

        The Content-ID an HTML body refers to with cid:, when it has one.

      • sizeinteger
      • inlineboolean

        True for a part shown in the body rather than offered as a file.

    • contentOmitted"too_large" | "expired" or null

      too_large when text or HTML was left out for size; expired when the content window has passed and the reference is all that remains.

inbound_cap_warning

SDK type InboundCapWarningEvent

80 percent of the monthly cap on received mail is used.

Example

{
  "id": "6f8a0b2c-4e6f-4a8b-9c0d-2e4f6a8b0c1d",
  "attempt": 1,
  "cap": 50000,
  "periodStart": "2026-09-01T00:00:00.000Z",
  "periodEnd": "2026-10-01T00:00:00.000Z",
  "used": 40000,
  "occurredAt": "2026-09-24T09:30:00.000Z",
  "event": "inbound_cap_warning"
}
  • idstring

    The delivery's id. A delivery may arrive more than once, so key your handling on it.

  • attemptinteger

    The attempt number, from 1.

  • capinteger

    Emails the account may receive in the month.

  • usedinteger

    Emails received in the month so far.

  • periodStartstring (date-time)

    When the month the counts are for began. A paying account counts months from the day and time of its first payment, and any other account calendar months in UTC.

  • periodEndstring (date-time)

    When that month ends and received mail is counted from 0 again.

  • occurredAtstring (date-time)

    When it happened.

  • event"inbound_cap_warning"

inbound_cap_reached

SDK type InboundCapReachedEvent

The monthly cap on received mail is used up. Mail to the account is refused for now, and senders retry, until the month ends or the cap is raised.

Example

{
  "id": "6f8a0b2c-4e6f-4a8b-9c0d-2e4f6a8b0c1d",
  "attempt": 1,
  "cap": 50000,
  "periodStart": "2026-09-01T00:00:00.000Z",
  "periodEnd": "2026-10-01T00:00:00.000Z",
  "used": 50000,
  "occurredAt": "2026-09-29T16:05:00.000Z",
  "event": "inbound_cap_reached"
}
  • idstring

    The delivery's id. A delivery may arrive more than once, so key your handling on it.

  • attemptinteger

    The attempt number, from 1.

  • capinteger

    Emails the account may receive in the month.

  • usedinteger

    Emails received in the month so far.

  • periodStartstring (date-time)

    When the month the counts are for began. A paying account counts months from the day and time of its first payment, and any other account calendar months in UTC.

  • periodEndstring (date-time)

    When that month ends and received mail is counted from 0 again.

  • occurredAtstring (date-time)

    When it happened.

  • event"inbound_cap_reached"