PlatformXeDocs
Get API Key

Custom Events Federation

Push your registered custom events to peer Enterprise organisations and partner webhooks through bus-level fan-out. Enterprise-only.

The client.events.custom.federation namespace lets ENTERPRISE tenants share live event traffic — not just schemas — with peer ENTERPRISE orgs and with partner webhooks. An owner organisation creates a federation group, invites peer orgs (or adds partner URLs), and declares per-version pushes. When the owner emits a pushed event, the platform re-emits it to each accepted peer as a federated type named after the owner — fed-<ownerOrg>.<namespace>.<name> — so peer subscribers (webhooks, workflows) receive it without it ever landing on the peer's own event types.

This is distinct from client.permissions.federation, which is the v1.x.x admin-permission cross-app sync surface. Different concept, different access path:

Custom Event Federation (this page, Phase 9D)Permission Federation (v1.x.x)
What flowsLive tenant emit messagesAdmin permission modules / role grants
API key scopeevents:federate for changes, events:read for readspermissions:manage / permissions:check
Bus prefixCUSTOM_EVENT_FEDERATION_*FEDERATION_*
PlanEnterprise onlyEnterprise only
SDKInstallNamespace
TypeScriptnpm install @caldera/platformxe-sdk@^1.5.0client.events.custom.federation
Pythonpip install "platformxe @ git+https://github.com/calderaxe/platformxe-python@v1.7.0" (not on PyPI yet)client.events.custom.federation (sync client; the async client has no custom-events surface)
Gogo get github.com/calderaxe/platformxe-go@v1.7.0client.Events.Custom.Federation
Terraformsource = "calderaxe/platformxe" ≥ 1.5.0platformxe_event_federation_group, platformxe_event_federation_push, platformxe_event_federation_external_peer

The member pause / resume / remove calls, the relay log and federatedTypeName (2026-11-17) are in the Python and Go SDKs on this repository's master; the TypeScript SDK follows in its own release.

Scopes

Every change (create, archive, invite, accept, leave, remove, pause, resume, declare, undeclare, add, pause or remove an external peer) needs the events:federate scope; reads (GET) need events:read.

An events:manage key also holds events:federate (an alias, kept until a narrower emit-only scope exists). Today every key that can emit or register can therefore also federate: withholding events:federate from an events:manage key does not stop it. Keep events:manage keys to the services you trust with federation, and rotate one that leaks.

Plan tiers

CapabilityFreeBasicProEnterprise
Create a group———✅ (owner)
Accept an invitation———✅ (member)
Receive relays———✅ (member)
Declare a push———✅ (owner)
Browse / introspect———✅ (owner + member)

Federation requires ENTERPRISE on both sides — the owner and every member — at every step: a non-Enterprise caller of a federation route receives 402 FEDERATION_NOT_AVAILABLE (except the exit and erasure actions, see Remove, revoke, pause), and an emit is not relayed while the owner or a member is not eligible (Enterprise, active, subscription not cancelled; a first-party Caldera tenant always is). See Plan changes.

Concepts

            ┌─────────────────────────────────────────────────────────┐
            │  Owner org (Enterprise)  org_owner                      │
            │                                                         │
            │   1. createGroup(...)              → group id           │
            │   2. invite(group, peer)           → member (pending)   │
            │   3. declarePush(group, regId)     → push id (active)   │
            │                                                         │
            │   emit("lettings.property.favorited") ───────┐          │
            └──────────────────────────────────────────────│──────────┘
                                                           │ emit path
                                                           │ + Inngest relay
                                                           ▼
            ┌──────────────────────────────────────────────────────────────┐
            │  Peer org (Enterprise, has accepted the invitation)          │
            │                                                              │
            │   client.events.custom.subscribe({                           │
            │     name: 'fed-org_owner.lettings.property.favorited', ... }) │
            │       ↳ receives TENANT_CUSTOM:peer:fed-org_owner.lettings.   │
            │         property.favorited@1.0.0 — never the peer's own       │
            │         lettings.property.favorited                           │
            └──────────────────────────────────────────────────────────────┘
  • Group: an owner-org-scoped container of peers + pushes. One owner, many members.
  • Member: a peer org's relationship to a group. Lifecycle: pending → accepted ⇄ paused, and removed (left, removed by the owner, or an invitation revoked). Only accepted members receive relays.
  • Push: a declaration that a specific (namespace, name, version) of one of the owner's registrations is relayed to every accepted member. Per-version — pushing v1.0.0 doesn't push v1.1.0. The generic catch-all event (platformxe.generic) and federated types cannot be pushed (400 EVENT_NOT_PUSHABLE).
  • Federated type: what a member receives. The push's federatedTypeName is fed-<ownerOrg>.<namespace>.<name>; when a member accepts (or a push is declared or re-declared while it is a member), that type is registered on the member, published, so it can subscribe. The fed-* namespaces are reserved: no organisation can register under them, so an owner can never write into a member's own event types. If a member already holds the federated type with a different schema, the accept or the push is refused with 409 FEDERATED_TYPE_CONFLICT and nothing changes.
  • Relay: one delivery of one emit to one peer, retried on the shared delivery ladder (6 attempts, 2 / 4 / 8 / 16 / 32 minutes ± 20 %). Every attempt re-checks the member, the push, the group and both plans, and stops when one is no longer live (removed, paused, undeclared, archived, downgraded). Audited in the relay log (90-day retention); read it with listRelays.
  • Schema snapshot: when a push is declared, the source schema is copied onto the push row. Members see a stable view even if the owner archives or replaces the registration.
  • Ids: group, member and push ids are plain cuid2 strings with no prefix (such as h8w3k2p9x7q1m5n4t6r0v2ya). The prefixed kinds are registration ids (cer_…), emit ids (cee_…), marketplace listing ids (mkl_…) and fork ids (mkf_…).

Quick start — owner side

// 1. Create a group
const group = await client.events.custom.federation.createGroup({
  name: 'Trusted partners',
  description: 'Lettings partners receiving live property events',
});

// 2. Invite a peer Enterprise org by id (it receives CUSTOM_EVENT_FEDERATION_MEMBER_INVITED)
await client.events.custom.federation.invite(group.id, {
  memberOrganizationId: 'org_partner_123',
});
// — peer side calls .accept(group.id) on their own API key —

// 3. Declare a per-version push (your registration must be status='published')
const push = await client.events.custom.federation.declarePush(group.id, {
  registrationId: 'cer_propertyfavorited_v1',
});
console.log(push.federatedTypeName); // 'fed-org_owner.lettings.property.favorited'

// 4. Emit normally — fan-out is automatic
await client.events.custom.emit({
  name: 'lettings.property.favorited',
  payload: { propertyId: 'p_1', userId: 'u_1' },
});
group = client.events.custom.federation.create_group(
    name="Trusted partners",
    description="Lettings partners receiving live property events",
)
client.events.custom.federation.invite(group["data"]["id"], "org_partner_123")
# peer accepts via their own client:
#   peer_client.events.custom.federation.accept(group["data"]["id"])
client.events.custom.federation.declare_push(group["data"]["id"], "cer_propertyfavorited_v1")
client.events.custom.emit("lettings.property.favorited", {"propertyId": "p_1"})
group, _ := client.Events.Custom.Federation.CreateGroup(platformxe.CreateEventFederationGroupInput{
    Name:        "Trusted partners",
    Description: ptr("Lettings partners receiving live property events"),
})
_, _ = client.Events.Custom.Federation.Invite(group.ID, platformxe.InviteEventFederationMemberInput{
    MemberOrganizationID: "org_partner_123",
})
_, _ = client.Events.Custom.Federation.DeclarePush(group.ID, platformxe.DeclareEventFederationPushInput{
    RegistrationID: "cer_propertyfavorited_v1",
})
resource "platformxe_event_federation_group" "partners" {
  name        = "Trusted partners"
  description = "Lettings partners receiving live property events"
}

resource "platformxe_event_federation_push" "favorited" {
  group_id        = platformxe_event_federation_group.partners.id
  registration_id = platformxe_custom_event.property_favorited.id
}

Quick start — member side

// You were invited: subscribe to CUSTOM_EVENT_FEDERATION_MEMBER_INVITED (it is
// delivered to your organisation), or poll listGroups() for callerRole 'pending'.
await client.events.custom.federation.accept('h8w3k2p9x7q1m5n4t6r0v2ya');

// Subscribe to the FEDERATED type (the push's federatedTypeName):
await client.events.custom.subscribe({
  name: 'fed-org_owner.lettings.property.favorited',
  version: '1.0.0',                        // the pushed version
  webhookUrl: 'https://your-app.com/webhooks/federation',
});

// Deliveries carry the original payload, `isFederationRelay: true`,
// `sourceOrganizationId` (the owner) and `federatedTypeName`.

To leave a group voluntarily, or to stop receiving for a while:

await client.events.custom.federation.leave('h8w3k2p9x7q1m5n4t6r0v2ya');
await client.events.custom.federation.pauseMember('h8w3k2p9x7q1m5n4t6r0v2ya', 'org_me');   // your own membership
await client.events.custom.federation.resumeMember('h8w3k2p9x7q1m5n4t6r0v2ya', 'org_me');

Browse + introspect

// Groups you own + groups you're a live member of
const { groups } = await client.events.custom.federation.listGroups();
// add { includeArchived: true } and / or { includeRemoved: true } for history
for (const g of groups) {
  console.log(g.id, g.callerRole, g.memberCount, g.pushCount);
  // callerRole is 'owner' | 'pending' | 'accepted' | 'paused' | 'removed'
}

const detail = await client.events.custom.federation.getGroup('h8w3k2p9x7q1m5n4t6r0v2ya');
detail.pushes.forEach((p) => console.log(p.federatedTypeName, p.isActive));

const { pushes } = await client.events.custom.federation.listPushes('h8w3k2p9x7q1m5n4t6r0v2ya', {
  includeInactive: true,                   // include unpushed history
});

// Owner: the relay log of a push (one row per emit and peer, latest attempt)
const { relays } = await client.events.custom.federation.listRelays('p4m8z1x6c3v9b2n7q5w0e8ra', { status: 'failed' });

What a caller reads depends on its role:

CallergetGroup membersExternal peer URL / header names
Ownerevery member (removed included)✅ (header names only, never values)
Accepted or paused memberlive members— (label only)
Pending inviteenone (group + pushes only)—
Removed member, any other org404 GROUP_NOT_FOUND—

A caller with no live relationship to a group gets 404 for every operation on it (never 403), so ids are not an existence oracle; a member attempting an owner-only action gets 403 FORBIDDEN.

Remove, revoke, pause

// Owner removes a member — or revokes a pending invitation
await client.events.custom.federation.removeMember('h8w3k2p9x7q1m5n4t6r0v2ya', 'org_partner_123');

// Owner (or the member itself) pauses a membership; the side that paused resumes it
await client.events.custom.federation.pauseMember('h8w3k2p9x7q1m5n4t6r0v2ya', 'org_partner_123');
await client.events.custom.federation.resumeMember('h8w3k2p9x7q1m5n4t6r0v2ya', 'org_partner_123');

// Stop relaying a specific version (audit trail preserved)
await client.events.custom.federation.undeclarePush('p4m8z1x6c3v9b2n7q5w0e8ra');

// Archive the entire group (stops all fan-out, preserves history)
await client.events.custom.federation.archiveGroup('h8w3k2p9x7q1m5n4t6r0v2ya');
fed = client.events.custom.federation
fed.remove_member("h8w3k2p9x7q1m5n4t6r0v2ya", "org_partner_123")
fed.pause_member("h8w3k2p9x7q1m5n4t6r0v2ya", "org_partner_123")
fed.resume_member("h8w3k2p9x7q1m5n4t6r0v2ya", "org_partner_123")
fed.list_relays("p4m8z1x6c3v9b2n7q5w0e8ra", status="failed")
fed := client.Events.Custom.Federation
_, _ = fed.RemoveMember("h8w3k2p9x7q1m5n4t6r0v2ya", "org_partner_123")
_, _ = fed.PauseMember("h8w3k2p9x7q1m5n4t6r0v2ya", "org_partner_123")
_, _ = fed.ResumeMember("h8w3k2p9x7q1m5n4t6r0v2ya", "org_partner_123")

Removal, a pause, an undeclare and an archive also stop relays already in flight: every retry re-checks the member, push and group first. A removed organisation can be invited again. When a member leaves or is removed, a push is undeclared or a group archived, the federated types no live membership still needs are archived on the member (they stop counting toward its 500 federated types); declaring the push again republishes them.

Leaving and erasing need no Enterprise plan. Leave, remove a member or revoke an invitation, pause a membership, remove or pause an external peer (which wipes or keeps the partner's credentials) and archive a group work for any active organisation that holds the relationship, even after it dropped off Enterprise — a downgrade never traps an organisation in a feed or keeps a partner's token stored against its will.

A member reading the group sees other members' actor fields (invitedBy, acceptedBy, pausedBy, removedBy) as null; they are the owner's to see (and each member sees its own). Archived groups cannot accept new members or declare new pushes and cannot be reactivated (create a new group instead).

Limits

LimitValue
Live groups an organisation owns50
Member organisations per group (pending, accepted, paused)100
External webhook peers per group20
External webhook peers per organisation (all its groups)100
External webhook peers per host per organisation5
Active pushes per group100
Relays in flight per external peer / per tenant peer5 / 10, and at most 600 relay runs a minute per external peer

Beyond a limit the change is refused with 409 LIMIT_REACHED.

Pattern 3 — external webhook peers (added in 1.5.0)

By default a federation peer is another PlatformXe ENTERPRISE tenant org (peer ID + accept handshake). Pattern 3 lets the owner add an arbitrary HTTPS endpoint as a peer instead — useful when the receiving system isn't on PlatformXe (a partner SaaS, an OTA integration, an on-prem listener).

The owner adds the peer with a label + URL + optional static headers. The platform returns a one-time signing secret (whsec_…) that the receiver uses to verify X-Caldera-Signature-V2 on inbound POSTs. The secret and the static headers (e.g. a partner bearer token) are stored sealed under the key-management envelope, bound to that peer, read only when a relay is sent, never placed in a queued job, and wiped when the peer is removed (only the secret's hash is kept, for diagnostics). Only the header NAMES are echoed back, and only to the owner.

The secret is shown ONCE — it is not stored for an idempotent replay either. Capture it at create time. Rotate by removing and re-adding the peer; in-flight retries stop at removal and never send with the old secret.

To stop a partner for a while without re-provisioning it, pause it (pauseExternalPeer / pause_external_peer / PauseExternalPeer) and resume it later; the secret and headers are kept.

Rotate partner tokens set before 2026-11-17. Static headers added before then were stored, and placed in queued relay jobs, unsealed. PlatformXe has sealed every stored value (and wiped removed peers' credentials); a token that was stored before that date should still be rotated with the partner.

Static headers: at most 10, HTTP token names, no hop-by-hop or framing names (Host, Content-Length, Transfer-Encoding, Connection, …), no X-Caldera-* / X-Forwarded-* names, values without CR/LF and at most 1 KiB each (400 BAD_REQUEST otherwise).

const result = await client.events.custom.federation.addExternalPeer(group.id, {
  label: 'Partner OTA',
  webhookUrl: 'https://partner.example.com/inbound/platformxe',
  headers: { Authorization: 'Bearer xyz' },     // optional, sealed, sent on every relay
});
console.log(result.secret);  // 'whsec_KQYf_w-Z2jL4P6n1B…' — store immediately
console.log(result.peer.peerType);  // 'external_webhook'
console.log(result.peer.status);    // 'accepted' (auto-accepted, no handshake)

// Remove later:
await client.events.custom.federation.removeExternalPeer(result.peer.id);
result = client.events.custom.federation.add_external_peer(
    group["data"]["id"],
    label="Partner OTA",
    webhook_url="https://partner.example.com/inbound/platformxe",
    headers={"Authorization": "Bearer xyz"},
)
secret = result["data"]["secret"]  # whsec_… — store immediately
client.events.custom.federation.remove_external_peer(result["data"]["peer"]["id"])
result, _ := client.Events.Custom.Federation.AddExternalPeer(
    group.ID,
    platformxe.AddEventFederationExternalPeerInput{
        Label:      "Partner OTA",
        WebhookURL: "https://partner.example.com/inbound/platformxe",
        Headers:    map[string]string{"Authorization": "Bearer xyz"},
    },
)
fmt.Println(result.Secret)               // whsec_… — store immediately
fmt.Println(result.Peer.PeerType)         // platformxe.EventFederationPeerTypeExternalWebhook
_, _ = client.Events.Custom.Federation.RemoveExternalPeer(result.Peer.ID)
resource "platformxe_event_federation_external_peer" "partner" {
  group_id    = platformxe_event_federation_group.partners.id
  label       = "Partner OTA"
  webhook_url = "https://partner.example.com/inbound/platformxe"

  headers = {
    Authorization = var.partner_inbound_token
  }
}

# secret is computed + sensitive — encrypt your state at rest.
output "partner_signing_secret" {
  value     = platformxe_event_federation_external_peer.partner.secret
  sensitive = true
}

Wire format — what your endpoint receives

Each relay arrives as a POST with the canonical JSON body:

{
  "eventType": "TENANT_CUSTOM:extwh:<memberId>:lettings.property.favorited@1.0.0",
  "sourceOrganizationId": "org_…",
  "namespace": "lettings",
  "name": "property.favorited",
  "version": "1.0.0",
  "payload": { "propertyId": "p_1", "userId": "u_1" },
  "federationPushId": "p4m8z1x6c3v9b2n7q5w0e8ra",
  "emitId": "cee_e7r2t9y4u1i6o3p8a5s0d2fg",
  "isFederationRelay": true,
  "timestamp": "2026-05-06T21:40:48.000Z"
}

The timestamp field is inside the body, so it is covered by the signature. Since 2026-10-25 the relay also sends X-Caldera-Timestamp and a timestamped signature, X-Caldera-Signature-V2 (see the dual-send window below).

…and these headers (in addition to any static headers you supplied at create time, e.g. Authorization; a static header can never replace one of these):

HeaderValue
Content-Typeapplication/json
X-Caldera-Event-TypeTENANT_CUSTOM:extwh:<memberId>:<namespace>.<name>@<version> (the same as eventType in the body)
X-Caldera-Signaturesha256=<hex> — HMAC-SHA256 of the raw body bytes only (no timestamp prefix); until 2027-04-30
X-Caldera-Signature-V2sha256=<hex> — HMAC-SHA256 of ${X-Caldera-Timestamp}.${rawBody} (the portfolio contract)
X-Caldera-TimestampUnix seconds when the relay was signed
X-Caldera-Delivery-Id<pushId>:<emitId>:<memberId>, the same on every retry
X-Caldera-Federation-Push-IdThe push id (a cuid2, no prefix)
X-Caldera-Emit-IdThe emit id (cee_…), the business idempotency key
User-AgentPlatformXe-Federation-Relay/1.0

The V2 headers are the same scheme event-subscription and webhook deliveries use (sha256= HMAC over ${timestamp}.${rawBody}, sent as X-Caldera-Signature / -Timestamp / -Delivery-Id there), so one verifier serves every surface; only the relay names its timestamped signature X-Caldera-Signature-V2 until the body-only X-Caldera-Signature is retired on 2027-04-30.

Verifying the inbound signature

Verify the V2 headers. The canonical signature is X-Caldera-Signature-V2: sha256=<hex>, the HMAC-SHA256 (keyed with your whole whsec_… secret) of ${X-Caldera-Timestamp}.${rawBody}. Refuse the request when the timestamp is more than 5 minutes from your clock, compare in constant time, and keep X-Caldera-Delivery-Id (the same on every retry of one relay) as your replay / idempotency key for at least the 5-minute window. X-Caldera-Emit-Id stays the business idempotency key: at-least-once delivery means the same emit may arrive more than once.

The legacy body-only signature is replayable: do not rely on it. X-Caldera-Signature currently carries HMAC-SHA256 of the raw body alone, with no time in it, so a captured relay verifies forever. It is sent for compatibility only until 2027-04-30; on that date X-Caldera-Signature switches to the V2 value and the body-only form is no longer sent.

import crypto from 'node:crypto';

const WINDOW_SEC = 300;

function verifyCalderaRelay(req: Request, secret: string, rawBody: string, seen: Set<string>): boolean {
  const header = req.headers.get('x-caldera-signature-v2') ?? '';
  const ts = req.headers.get('x-caldera-timestamp') ?? '';
  const deliveryId = req.headers.get('x-caldera-delivery-id') ?? '';
  if (!header.startsWith('sha256=') || !/^\d{1,12}$/.test(ts) || !deliveryId) return false;
  if (Math.abs(Math.floor(Date.now() / 1000) - Number(ts)) > WINDOW_SEC) return false;
  const expected = crypto.createHmac('sha256', secret).update(`${ts}.${rawBody}`).digest('hex');
  const provided = header.slice('sha256='.length);
  if (provided.length !== expected.length) return false;
  if (!crypto.timingSafeEqual(Buffer.from(provided), Buffer.from(expected))) return false;
  if (seen.has(deliveryId)) return false; // replay inside the window
  seen.add(deliveryId);                   // keep >= WINDOW_SEC (a TTL cache in production)
  return true;
}
import hmac, hashlib, re, time

WINDOW_SEC = 300

def verify_caldera_relay(headers: dict, secret: str, raw_body: bytes, seen: set) -> bool:
    header = headers.get("X-Caldera-Signature-V2", "")
    ts = headers.get("X-Caldera-Timestamp", "")
    delivery_id = headers.get("X-Caldera-Delivery-Id", "")
    if not header.startswith("sha256=") or not re.fullmatch(r"\d{1,12}", ts) or not delivery_id:
        return False
    if abs(int(time.time()) - int(ts)) > WINDOW_SEC:
        return False
    expected = hmac.new(secret.encode(), ts.encode() + b"." + raw_body, hashlib.sha256).hexdigest()
    if not hmac.compare_digest(header[len("sha256="):], expected):
        return False
    if delivery_id in seen:
        return False
    seen.add(delivery_id)
    return True
import (
    "crypto/hmac"
    "crypto/sha256"
    "encoding/hex"
    "net/http"
    "regexp"
    "strconv"
    "strings"
    "time"
)

var tsShape = regexp.MustCompile(`^\d{1,12}$`)

func VerifyCalderaRelay(r *http.Request, secret string, rawBody []byte, seen map[string]bool) bool {
    h := r.Header.Get("X-Caldera-Signature-V2")
    ts := r.Header.Get("X-Caldera-Timestamp")
    id := r.Header.Get("X-Caldera-Delivery-Id")
    if !strings.HasPrefix(h, "sha256=") || !tsShape.MatchString(ts) || id == "" {
        return false
    }
    sec, _ := strconv.ParseInt(ts, 10, 64)
    if d := time.Now().Unix() - sec; d > 300 || d < -300 {
        return false
    }
    mac := hmac.New(sha256.New, []byte(secret))
    mac.Write([]byte(ts + "."))
    mac.Write(rawBody)
    expected := hex.EncodeToString(mac.Sum(nil))
    if !hmac.Equal([]byte(strings.TrimPrefix(h, "sha256=")), []byte(expected)) || seen[id] {
        return false
    }
    seen[id] = true
    return true
}

A Caldera service verifies with @caldera/keys-service verifyWebhook (pass X-Caldera-Signature-V2 as the signature until the sunset).

Peers created before migration 0029_federation_webhook_secret_encrypted have no stored signing secret, so the relay refuses to sign their deliveries (they fail instead of arriving with a signature you cannot verify). Remove and re-add such a peer to receive a signing secret. There is no other signing scheme.

Pattern 3 vs tenant peers — at a glance

peerType='tenant_org' (Phase 9D)peerType='external_webhook' (1.5.0, Pattern 3)
AddressOther PlatformXe org idHTTPS endpoint URL (public host; checked at create and before every send)
Onboardinginvite → peer acceptsowner adds, auto-accepted
Receiving planENTERPRISEany (no platform account required)
Receivesthe federated type fed-<owner>.<ns>.<name> on its own busa signed POST
AuthenticationPeer's own API keyHMAC-SHA256 of {timestamp}.{body} on X-Caldera-Signature-V2 (the body-only X-Caldera-Signature until 2027-04-30)
Static headersn/aoptional map (e.g. Authorization), sealed, wiped on removal
DiscoverableYes — peer sees the group via listGroups()No — owner-managed only
memberOrganizationIdpopulatednull
externalWebhookUrl / externalWebhookHeaderNamesnullpopulated for the owner only

Both peer types receive the SAME relays for any push declared on the group.

Plan changes

Federation needs Enterprise on both sides, enforced at three points:

  1. Routes — a caller that is not on Enterprise gets 402 FEDERATION_NOT_AVAILABLE.
  2. Every emit and every relay attempt — nothing is relayed while the owner or a tenant member is not eligible (effective plan Enterprise, organisation active, subscription not cancelled; a first-party Caldera tenant always is).
  3. The daily reconcile (/api/cron/event-federation-reconcile, 03:30 UTC) — an accepted membership whose owner or member is no longer eligible is paused (pausedBy: 'system:plan_downgrade'), and resumed automatically when both sides are eligible again. Groups are never archived for a plan change, so a lapse in payment loses no group, member or push. A plan pause cannot be resumed by hand (409 INVALID_STATE).

Reference — wire shapes

CreateFederationGroupRequest:

{
  name: string;             // 3–80 chars, owner-scope-unique
  description?: string;     // at most 2,000 chars
}

FederationGroupSummary:

{
  id: string;
  ownerOrganizationId: string;
  name: string;
  description: string | null;
  createdBy: string | null;                // the owner organisation only; null for every member
  createdAt: string;
  updatedAt: string;
  archivedAt: string | null;
  callerRole: 'owner' | 'pending' | 'accepted' | 'paused' | 'removed';
  memberCount: number;                     // members not removed (0 for a removed caller)
  pushCount: number;                       // active pushes (0 for a removed caller)
}

FederationGroupDetail extends summary with:

{
  members: FederationMemberSummary[];      // per role — see Browse + introspect
  pushes: FederationPushSummary[];
}

FederationMemberSummary (polymorphic on peerType):

{
  id: string;
  groupId: string;
  peerType: 'tenant_org' | 'external_webhook';
  memberOrganizationId: string | null;     // populated when peerType='tenant_org'
  externalWebhookUrl: string | null;       // external peers, owner only
  externalWebhookLabel: string | null;     // external peers
  externalWebhookHeaderNames: string[] | null;  // header NAMES only, owner only
  status: 'pending' | 'accepted' | 'paused' | 'removed';
  invitedBy: string;
  invitedAt: string;
  acceptedBy: string | null;
  acceptedAt: string | null;
  pausedBy: string | null;                 // 'owner:<caller>' | 'member:<caller>' | 'system:plan_downgrade'
  pausedAt: string | null;
  removedBy: string | null;
  removedAt: string | null;
}

FederationPushSummary:

{
  id: string;                              // cuid2, no prefix
  groupId: string;
  sourceRegistrationId: string | null;     // null if source registration was deleted
  sourceOrganizationId: string;
  namespace: string;
  name: string;
  version: string;
  sourceCanonicalName: string;             // TENANT_CUSTOM:owner-org:ns.name@v
  federatedTypeName: string;               // fed-<owner-org>.<ns>.<name> — what members subscribe to
  pushedBy: string | null;                 // the push's source organisation only; null for members
  pushedAt: string;
  unpushedBy: string | null;               // the source organisation only (null otherwise, or while active)
  unpushedAt: string | null;
  isActive: boolean;
}

FederationRelayLogEntry (listRelays):

{
  id: string;
  pushId: string;
  emitId: string;
  peer: string;                            // peer org id, or 'extwh:<memberId>'
  peerType: 'tenant_org' | 'external_webhook';
  status: 'queued' | 'relayed' | 'failed';
  errorMessage: string | null;             // names an external peer by label or host, never its URL
  relayedAt: string | null;
  createdAt: string;
}

Reference — error codes

Since 2026-11-17 every code is SCREAMING_SNAKE (before, the service codes were lowercase: group_not_found, forbidden, …; match the new names).

CodeStatusCause
BAD_REQUEST400Body not JSON, a field missing or invalid (name 3–80, label 2–80, headers), the owner inviting itself or accepting / leaving its own group, an invalid query
UNAUTHORIZED401API key missing, invalid or inactive
FEDERATION_NOT_AVAILABLE402The caller is not on the Enterprise plan
FORBIDDEN403Scope missing (events:federate / events:read) or no organisation on the key; a member attempting an owner-only action; pausing / resuming another member; resuming a pause the other side made
NOT_FOUND404The calling organisation does not exist
GROUP_NOT_FOUND404Unknown group, or the caller has no live relationship to it (removed included)
MEMBER_NOT_FOUND404That organisation is not a member
PUSH_NOT_FOUND404Unknown push, or no live relationship to its group
PEER_NOT_FOUND404Unknown external peer, or no live relationship to its group
ORGANIZATION_NOT_FOUND404The organisation to invite does not exist
REGISTRATION_NOT_FOUND404The push names a registration the owner does not have
EVENT_NOT_PUSHABLE400The generic event, or a federated (fed-*) type
GROUP_ARCHIVED409Changing an archived group
DUPLICATE409Group name taken; a live membership; external peer URL already in the group; push already active
INVALID_STATE409Not pending (accept), not accepted (pause), not paused or a plan pause (resume), already removed, push already inactive, registration not published
LIMIT_REACHED409A limit
FEDERATED_TYPE_CONFLICT409A member already holds the federated type with a different schema; nothing changed
RATE_LIMITED429Per-key rate limit
INTERNAL_ERROR500Retry later
KMS_UNAVAILABLE503The signing secret could not be sealed

Reference — bus events

Every state transition emits a typed event on the bus, delivered to each organisation it concerns (the owner and the member, or the source and the tenant peer), so you can subscribe to it on your own key. The 9 federation lifecycle events:

EventDelivered toPayload highlights
CUSTOM_EVENT_FEDERATION_GROUP_CREATEDownerownerOrganizationId, groupId, name, createdBy
CUSTOM_EVENT_FEDERATION_GROUP_ARCHIVEDowner + live membersgroupId, archivedBy
CUSTOM_EVENT_FEDERATION_MEMBER_INVITEDowner + inviteegroupId, memberOrganizationId, invitedBy
CUSTOM_EVENT_FEDERATION_MEMBER_ACCEPTEDowner + membergroupId, memberOrganizationId, acceptedBy
CUSTOM_EVENT_FEDERATION_MEMBER_REMOVEDowner + membergroupId, memberOrganizationId, removedBy, reason (owner_removed / member_left)
CUSTOM_EVENT_FEDERATION_PUSH_DECLAREDowner + accepted / paused membersgroupId, pushId, sourceRegistrationId, namespace, name, version
CUSTOM_EVENT_FEDERATION_PUSH_UNDECLAREDowner + accepted / paused membersgroupId, pushId, unpushedBy
CUSTOM_EVENT_FEDERATION_RELAYEDsource + tenant peerpushId, emitId, peerOrganizationId, peerCanonicalName, relayedAt
CUSTOM_EVENT_FEDERATION_RELAY_FAILEDsource + tenant peerpushId, emitId, peerOrganizationId, peerCanonicalName, errorMessage

Each copy carries organizationId (the organisation it was delivered to). External peers are named extwh:<memberId> and receive no bus events. Pausing and resuming emit no bus event yet.

Operational notes

  • Delivery semantics: deduplicated per (emit, peer): one relay job per peer per emit, whatever group carries the push, and a relay already delivered is never sent again. A tenant peer's copy is logged and handed to each of its subscriptions through the same durable path as an emit: a failing step is retried on the delivery ladder (each subscription receives the copy once across retries) and the relay is recorded relayed only after every step succeeded, else failed.
  • What a queued relay holds: ids only (the emit, the push, the peer). The payload is read from the emit's stored copy when the relay runs, and credentials from the peer row — neither sits in the job queue.
  • Loop prevention: a relay lands on the peer's federated type; a fed-* type can never be pushed on, so there is no second-level fan-out.
  • Schema drift: the schema is snapshotted at push-declaration time. Members see a stable view; to push v2.0.0 declare a new push for the new version.
  • Plan changes: see Plan changes.
  • Retention: archived groups and removed members stay for audit. The relay log is kept 90 days.