A bulk ingest run finished. data.kind says which of the three it was.
articles: an import a creator started against their connected provider
finished the batch they picked. imported_count is the number that
actually landed.
subscribers: a pull of every active contact from the connected
provider finished. An uploaded CSV ends the same way, with source:
csv.
migration: the newsletter was flipped onto native sending. That is the
destructive step of the move off a provider, and after it Commune sends
the newsletter itself.
What this topic is for is invalidation. Every one of these runs writes
many rows at once, and none of them fans out into per-row events: an
import does not emit one article.published or one subscriber.created
per row it touched, because a provider migration of fifty thousand
contacts would bury a consumer. This is the single event that says the
shape of the newsletter just changed underneath you, so refetch.
Only a run that reached its end publishes here. Both import paths stream
their progress and swallow per-row failures, so a partial run still
finishes and still fires, with a lower imported_count and no separate
count of what it dropped. A run whose connection died mid-stream
produces nothing at all, and there is no import.failed to pair with
this.
There is no run identifier on this payload and no /imports/{id} to
look one up in. An import is a streamed request that ends by writing its
rows and closing the response: nothing persists a job row, so an id here
would reference something no consumer could ever fetch. What identifies
a run is the newsletter, the kind and the source, and the only thing to
do with one is refetch.
Every one of these is idempotent and safe to re-run, so a consumer should expect to see the same import kind more than once for one newsletter.
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
-
API version the payload conforms to. Same value as
api_versionin the envelope. -
Same value as
idin the envelope. The dedupe key. -
Same value as
typein the envelope. The topic name. -
HMAC over the raw request body. Verify before parsing.
-
Unix seconds the signature was produced at. Reject anything outside your tolerance window.
-
1 on the first attempt, incremented on each retry. Informational only. A consumer must be idempotent regardless of its value.
Minimum value is
1.
Body
Required
An article, subscriber or migration run finished.
-
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.
-
The topic name, identical to the channel address. Route on this.
Value is
import.completed. -
The
Commune-Versionvalue 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. -
RFC 3339 timestamp of the state change, not of the delivery attempt. Use it to order events, since delivery order is not guaranteed.
-
Who caused the change. ALWAYS
nulltoday 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.
-
ALWAYS
nulltoday. Once the public API accepts writes this carries theIdempotency-Keyheader 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. -
Event-specific body. Narrowed by each concrete event schema below.
Responses
-
The consumer accepted the delivery. Any 2xx acknowledges the message and it is not sent again.
-
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.
-
The consumer failed to handle the delivery. Retried with backoff. A timeout is the same case and is retried too.
{
"id": "018f2a92-3434-7000-8000-000000000034",
"type": "import.completed",
"api_version": "2026-08-26",
"occurred_at": "2026-08-26T20:03:41Z",
"newsletter_id": "7d3f1c02-58a1-4a4e-9a0b-2f6d1c9e4411",
"actor": null,
"idempotency_key": null,
"data": {
"kind": "subscribers",
"source": "kit",
"imported_count": 4820,
"started_at": "2026-08-26T19:58:12Z",
"completed_at": "2026-08-26T20:03:41Z"
}
}
{
"id": "018f2a92-3535-7000-8000-000000000035",
"type": "import.completed",
"api_version": "2026-08-26",
"occurred_at": "2026-08-26T20:21:09Z",
"newsletter_id": "7d3f1c02-58a1-4a4e-9a0b-2f6d1c9e4411",
"actor": null,
"idempotency_key": null,
"data": {
"kind": "articles",
"source": "kit",
"imported_count": 63,
"started_at": "2026-08-26T20:19:44Z",
"completed_at": "2026-08-26T20:21:09Z"
}
}
{
"id": "018f2a92-3636-7000-8000-000000000036",
"type": "import.completed",
"api_version": "2026-08-26",
"occurred_at": "2026-08-26T20:30:00Z",
"newsletter_id": "7d3f1c02-58a1-4a4e-9a0b-2f6d1c9e4411",
"actor": null,
"idempotency_key": null,
"data": {
"kind": "migration",
"source": null,
"imported_count": null,
"started_at": null,
"completed_at": "2026-08-26T20:30:00Z"
}
}