> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ensync.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Publish a Message

> Send events to one or multiple partners

<Info>
  Recipients are required for every publish. EnSync uses targeted delivery to ensure multi-tenant data isolation—you specify exactly which partners receive each event.
</Info>

## Usage

<Tabs>
  <Tab title="Node.js">
    ```javascript theme={null}
    await client.publish(
      "order/created",
      ["partner-app-id"],
      { orderId: "123", amount: 5000 }
    );
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    await client.publish(
      "order/created",
      ["partner-app-id"],
      {"order_id": "123", "amount": 5000}
    )
    ```
  </Tab>
</Tabs>

## Parameters

| Parameter    | Type       | Required | Description                        |
| ------------ | ---------- | -------- | ---------------------------------- |
| `eventName`  | `string`   | Yes      | Event path (e.g., `order/created`) |
| `recipients` | `string[]` | Yes      | Array of partner appIds            |
| `payload`    | `object`   | Yes      | Event data (JSON-serializable)     |
