Skip to main content
Webhooks belong to the Carrier & MGA API. This event fires about an agency you appoint, and only a credential on that surface (carrier, MGA or wholesaler) can subscribe to it.

Overview

The DOWNSTREAM_ENTITY_DELETED webhook is triggered when an agency relationship leaves your account, by either of the two mechanisms Turris uses. It is the counterpart to Agency Created. Because that event fires as soon as you add or invite an agency, before the agency has done anything, some announced agencies are later withdrawn. Without this event you would be left holding an id that no longer resolves, with nothing to tell you why. Webhook type: DOWNSTREAM_ENTITY_DELETED

Triggers

This webhook fires when:
  • an agency relationship is removed: the record is deleted outright. This happens when an invited agency that never completed its first onboarding step is deleted from the app. The id will not resolve again.
  • an agency relationship is archived: the record is marked deleted. It stops appearing in List Associations and is no longer active, but it still exists internally. Archiving a branch also detaches it from its parent, so an archived record is always reported as a top-level agency.
deletionType tells you which one happened. If the distinction does not matter to you, treat both the same way: the agency is no longer active in your account.
One deletion produces one delivery. A given delete either archives the record or erases it, never both, so you receive a single event carrying whichever deletionType applies.Treat deliveries as idempotent by downstreamEntityAssociationId regardless, as you should for any webhook. In the event that you ever receive both types for the same association, removed describes the authoritative final state.
This webhook is sent immediately, with no debouncing.

Payload Example

An archived delivery always has this shape, whether the agency was a branch or a top-level agency before it was archived: level is 0, path holds only the association’s own id, parentAssociationId is null and ultimateParentAssociationId equals downstreamEntityAssociationId. If you need the parent a branch had, keep it from the earlier Agency Created or Agency Updated event. A removed delivery reports the hierarchy the record had when it was deleted, so a branch removed while it was active still carries its parent.

Field Reference

Payload Fields

This payload is intentionally smaller than the Agency Created one. It carries identification and hierarchy so you can find the record on your side and mark it, not a full description of an agency you already hold. For a removed deletion the agency record is deleted in the same operation, so a name lookup would return nothing anyway.
Restoring an archived agency is not signalled. If an archived relationship is later restored it simply reappears in List Associations; no webhook is sent. It comes back as a top-level agency, even if it was a branch before it was archived. This is rare in practice. If your records must survive it, reconcile against that endpoint rather than relying on events alone.
Subscriptions are per event type. Subscribing to Agency Created without also subscribing to Agency Deleted leaves you with agencies in your records that no longer exist in Turris, and nothing will tell you.