---
# @generated by sylphx-gen 0.1.0 from contracts@6a1bce71c4562366bcd933dde7dec01abbf14a9dde109a6ef2c4ea7c79f1fb3a. Do not edit.
title: "Publish in Channels"
description: "`realtime.channels.publish` (POST /v1/channels:publish): Publishes a message to a channel."
type: reference
product: realtime
summary: "Publishes a message to a channel."
updated: 2026-09-28
nav: false
---

Publishes a message to a channel. The namespace must exist. The server publishes regardless of `client_publish`. A repeated Sylphx-Effect-Id publishes once.

**Not available yet.** Sylphx Realtime is declared in the registry but no backend serves it: every call answers `501` with the problem code `UNIMPLEMENTED`.

- **Path** `POST https://api.realtime.sylphx.com/v1/channels:publish`
- **Scope** `realtime:publish`
- **Effect** `write` — a successful call changes state.
- **Collection** [channels](/docs/api/channels)
- **Host** `https://api.realtime.sylphx.com`

## Request

| Field | Type | What it is |
| --- | --- | --- |
| `channel` | `string` | The channel, `namespace:name`: the name is 1 to 128 characters of `a-z A-Z 0-9 - _. =` and no `*`. Required. |
| `event` | `string` | The application's event name, 1 to 64 characters. Required. |
| `data` | `value` | The JSON payload, at most 64 KiB encoded. |

## Response

| Field | Type | What it is |
| --- | --- | --- |
| `message` | `Message` | The published message; its cursor is empty in an ephemeral namespace. |

### Message

| Field | Type | What it is |
| --- | --- | --- |
| `channel` | `string` | The channel, `namespace:name`. |
| `cursor` | `string` | The message's cursor: opaque, ordered within the channel, and the value to resume from. Empty in an ephemeral namespace. |
| `event` | `string` | The application's event name, for example `move`. 1 to 64 characters. |
| `data` | `value` | The JSON payload, at most 64 KiB encoded. |
| `publisher` | `string` | The user id of the publisher; empty when a server published without one. |
| `publish_time` | `timestamp` | When the service accepted the message. |

## Errors

- [`UNAUTHENTICATED`](/docs/api/errors/UNAUTHENTICATED) — No valid key or token was presented.
- [`PERMISSION_DENIED`](/docs/api/errors/PERMISSION_DENIED) — The key lacks the method's permission.
- [`INVALID_FIELD`](/docs/api/errors/INVALID_FIELD) — A field failed validation.
- [`RESOURCE_NOT_FOUND`](/docs/api/errors/RESOURCE_NOT_FOUND) — The named Resource does not exist or is not visible.

Every error arrives in the body [Errors](/docs/platform/errors) describes.

## Examples

**cURL**

```curl
curl -X POST "https://api.realtime.sylphx.com/v1/channels:publish" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"channel":"…","event":"…"}'
```

**TypeScript**

```ts
const response = await sylphx.realtime.channels.publish({ channel: '…', event: '…' })
```

**Rust**

```rust
let mut req = sylphx::realtime::PublishRequest::default();
req.channel = "…".to_string();
req.event = "…".to_string();
let response = sx.realtime().channels().publish(req).await?;
```

**MCP**

```json
{ "method_id": "realtime.channels.publish", "args": {"channel":"…","event":"…"} }
```
