---
# @generated by sylphx-gen 0.1.0 from contracts@e145cc7cf1bc9605f2b27439e5e17ed76a1a2fd7e7021906a013f7565e4a0cd5. Do not edit.
title: "Issue token on a realtime channel"
description: "`events.realtime_channels.issue_token` (POST /v1/{name}:issueToken): Mints a subscribe token (`rtt_…`) for this channel alone, at most an hour long, for a browser or device that holds no key."
type: reference
product: realtime
summary: "Mints a subscribe token (`rtt_…`) for this channel alone, at most an hour long, for a browser or device that holds no key."
updated: 2026-09-28
nav: false
---

Mints a subscribe token (`rtt_…`) for this channel alone, at most an hour long, for a browser or device that holds no key. A token that names a client id enters the channel's presence while it is connected.

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

## Request

| Field | Type | What it is |
| --- | --- | --- |
| `name` | `string` | The name of the realtime channel. Required. |
| `ttl` | `duration` | How long the token lives; default and at most 1 hour, at least 1 minute. |
| `client_id` | `string` | The client this token is for; with it, the connection enters presence. |
| `client_data` | `value` | The client's presence data, at most 4 KiB as JSON. |

## Response

| Field | Type | What it is |
| --- | --- | --- |
| `token` | `string` | The token (`rtt_…`); present it as `Authorization: Bearer` or the `token` query parameter of the connect URI. Never returned again. |
| `expire_time` | `timestamp` | When it stops being accepted. |
| `connect_uri` | `string` | The URI to connect to with it. |

## 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.
- [`UNAVAILABLE`](/docs/api/errors/UNAVAILABLE) — The Resource store, the owning service's backend, or the key verifier's snapshot is unavailable; retry after Retry-After.

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:issueToken" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

**TypeScript**

```ts
const response = await sylphx.events.realtimeChannels.issueToken({ name: 'orgs/acme/projects/shop/envs/production/realtime_channels/realtime-channel' })
```

**Rust**

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

**CLI**

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

**MCP**

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