Delivery marked as spam Webhook

Add MCP server to your AI tool

Allow AI tools and LLMs to interact with the API documentation portal through MCP.

MCP server URL

https://api-reference.usecommune.dev/mcp

Standard setup for AI tools providing an mcp.json file

mcp.json
{
  "REST API MCP server": {
    "url": "https://api-reference.usecommune.dev/mcp"
  }
}

Close
POST https://webhook.example.com

The recipient reported the message as spam. From the email.complained ingest branch.

Treated as more severe than a bounce and never overridden: the subscriber is flipped to complained and must not be mailed again, which also emits subscriber.unsubscribed with reason: complained.

Delivered as a single HTTPS POST to the consumer's registered endpoint, with the message as the JSON request body. Respond 2xx to acknowledge. Anything else, or a timeout, is retried with backoff, so acknowledge fast and do the work afterwards.

Headers

  • Commune-Version string Required

    API version the payload conforms to. Same value as api_version in the envelope.

  • Commune-Event-Id string(uuid) Required

    Same value as id in the envelope. The dedupe key.

  • Commune-Event-Type string Required

    Same value as type in the envelope. The topic name.

  • Commune-Signature string Required

    HMAC over the raw request body. Verify before parsing.

  • Commune-Timestamp string Required

    Unix seconds the signature was produced at. Reject anything outside your tolerance window.

  • Commune-Delivery-Attempt integer

    1 on the first attempt, incremented on each retry. Informational only. A consumer must be idempotent regardless of its value.

    Minimum value is 1.

application/json

Body Required

The recipient reported the message as spam.

  • id string(uuid) Required

    Unique id for this event. Stable across redeliveries, so it is the dedupe key. It is the primary key of the row the publisher wrote, which means it is assigned when the state change is recorded, not when the message is dispatched.

  • type string Required

    The topic name, identical to the channel address. Route on this.

    Value is delivery.complained.

  • api_version string Required

    The Commune-Version value this payload conforms to. Present on the message itself, not only on the request header, so an event persisted to a consumer's own store stays self-describing.

  • occurred_at string(date-time) Required

    RFC 3339 timestamp of the state change, not of the delivery attempt. Use it to order events, since delivery order is not guaranteed.

  • newsletter_id string(uuid) | null Required

    The newsletter the change belongs to. This is the tenant boundary: a consumer only ever receives events for newsletters its credential can read. Null only for events that are genuinely not newsletter-scoped, which none of the 21 topics currently are.

  • actor object | null Required

    Who caused the change. ALWAYS null today and consumers must treat it that way: the public API is currently read-only, so nothing that reaches this catalog was triggered through it, and Commune does not backfill an actor for changes made in the product UI or by a cron. The field exists now so that populating it, once writes exist, is an additive change rather than a new envelope version.

    Additional properties are NOT allowed.

    Hide actor attributes Show actor attributes object | null
    • type string Required

      user for a change a person made through an authenticated session, api_key for a public API write, system for a cron or webhook ingest with no human behind it.

      Values are user, api_key, or system.

    • id string Required

      Identifier of the actor within its type. A user id for user, a key id (never the secret) for api_key, a stable job name for system.

    • label string | null

      Human-readable name for display. Best effort, may be null.

  • idempotency_key string | null Required

    ALWAYS null today. Once the public API accepts writes this carries the Idempotency-Key header of the write that caused the change, so a consumer can tie an event back to its own request and collapse the duplicates a retried write would otherwise produce. Null stays a legitimate value even then: a change made in the product UI or by a cron has no originating request to key on.

    Maximum length is 255.

  • data object Required

    Event-specific body. Narrowed by each concrete event schema below.

    Hide data attributes Show data attributes object
    • delivery_id string(uuid) Required

      The article_deliveries row.

    • article_id string(uuid) Required
    • send_id string(uuid) Required

      The send run this delivery belonged to.

    • subscriber_id string(uuid) Required
    • email string(email) Required

      The address as it was at send time. Snapshotted onto the delivery row, so it does not follow a later change to the subscriber.

    • provider_message_id string | null

      The email provider's id for this message, the correlator the inbound webhook matched on. Null only if the row was written without one.

    • status string Required

      The delivery row's status after this event was applied. Because the state machine is forward-only, it is not always the event's own name: an open recorded after a click leaves the row on clicked.

      Values are queued, sent, delivered, opened, clicked, bounced, complained, or failed.

    • reason string | null Required

      Why the row settled as a complaint. Providers rarely elaborate, so expect a constant string.

      Maximum length is 1000.

Responses

  • 200

    The consumer accepted the delivery. Any 2xx acknowledges the message and it is not sent again.

  • 4XX

    The consumer rejected the delivery. Handled exactly like a 5xx: the message is retried with backoff, because a rejection cannot be told apart from a consumer that is briefly misconfigured.

  • 5XX

    The consumer failed to handle the delivery. Retried with backoff. A timeout is the same case and is retried too.

POST delivery.complained
Request example
{
  "id": "018f2a90-8888-7000-8000-000000000008",
  "type": "delivery.complained",
  "api_version": "2026-08-26",
  "occurred_at": "2026-08-26T11:02:19Z",
  "newsletter_id": "7d3f1c02-58a1-4a4e-9a0b-2f6d1c9e4411",
  "actor": null,
  "idempotency_key": null,
  "data": {
    "delivery_id": "1f2e3d4c-5b6a-4978-8695-a4b3c2d1e0f9",
    "article_id": "4c9e2f81-0b7a-4d13-8e55-1a2b3c4d5e6f",
    "send_id": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
    "subscriber_id": "33445566-7788-4990-a1b2-c3d4e5f60718",
    "email": "annoyed@example.com",
    "provider_message_id": "4ef9f2b1-0c33-4c1b-8f9a-77c2e5d1a3b4",
    "status": "complained",
    "reason": "Spam complaint"
  }
}