---
# @generated by sylphx-gen. Do not edit.
title: "Leave a realtime channel"
description: "`events.realtime_channels.leave` (POST /v1/{name}:leave): Leaves Chat while retaining durable read state."
type: reference
product: queues
summary: "Leaves Chat while retaining durable read state."
updated: 2026-09-28
nav: false
---

Leaves Chat while retaining durable read state.

- **Path** `POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/realtime_channels/realtime-channel:leave`
- **Scope** `events:write`
- **Effect** `write` — a successful call changes state.
- **Collection** [realtime_channels](/docs/api/realtime_channels)

## Request

| Field | Type | What it is |
| --- | --- | --- |
| `name` | `string` | Existing channel name. Required. |
| `client_id` | `string` | Authenticated member identity. Required. |

## Response

The call answers with an empty object.

## 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.
- [`RESOURCE_NOT_FOUND`](/docs/api/errors/RESOURCE_NOT_FOUND) — The named Resource does not exist or is not visible.
- [`INVALID_FIELD`](/docs/api/errors/INVALID_FIELD) — A field failed validation.
- [`INVALID_STATE`](/docs/api/errors/INVALID_STATE) — The Resource is in a state that forbids the call.

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

## Examples

**cURL**

```curl
curl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/realtime_channels/realtime-channel:leave" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"client_id":"…"}'
```

**TypeScript**

```ts
await sylphx.events.realtimeChannels.leave({ clientId: '…', name: 'orgs/acme/projects/shop/envs/production/realtime_channels/realtime-channel' })
```

**Rust**

```rust
let mut req = sylphx::events::LeaveRealtimeChannelRequest::default();
req.client_id = "…".to_string();
req.name = "orgs/acme/projects/shop/envs/production/realtime_channels/realtime-channel".to_string();
sx.events().realtime_channels().leave(req).await?;
```

**CLI**

```bash
sylphx events realtime-channels leave orgs/acme/projects/shop/envs/production/realtime_channels/realtime-channel
```

**MCP**

```json
{ "method_id": "events.realtime_channels.leave", "args": {"client_id":"…","name":"orgs/acme/projects/shop/envs/production/realtime_channels/realtime-channel"} }
```
