---
# @generated by sylphx-gen 0.1.0 from contracts@6a1bce71c4562366bcd933dde7dec01abbf14a9dde109a6ef2c4ea7c79f1fb3a. Do not edit.
title: "Put in Namespaces"
description: "`realtime.namespaces.put` (PUT /v1/namespaces/{name}): Creates or replaces a namespace's rules."
type: reference
product: realtime
summary: "Creates or replaces a namespace's rules."
updated: 2026-09-28
nav: false
---

Creates or replaces a namespace's rules. Existing channels follow the new rules from their next message; shortening history trims at the next publish.

**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** `PUT https://api.realtime.sylphx.com/v1/namespaces/name`
- **Scope** `realtime:write`
- **Effect** `write` — a successful call changes state.
- **Collection** [namespaces](/docs/api/namespaces)
- **Host** `https://api.realtime.sylphx.com`

## Request

| Field | Type | What it is |
| --- | --- | --- |
| `name` | `string` | The namespace name; see Namespace.name. Required. |
| `history` | `HistoryPreset` | How much history channels keep. One of `none`, `short`, `standard`. |
| `presence` | `bool` | Whether channels track presence. |
| `client_publish` | `bool` | Whether clients may publish. |

## Response

| Field | Type | What it is |
| --- | --- | --- |
| `name` | `string` | The namespace name: 1 to 32 characters of `a-z`, `0-9`, `-` and `_`, starting with a letter. It is the part of a channel before the first colon, and never changes. Required. |
| `history` | `HistoryPreset` | How much history channels keep. Default NONE. One of `none`, `short`, `standard`. |
| `presence` | `bool` | Whether channels track who is present. Default off. |
| `client_publish` | `bool` | Whether a client holding a token with the publish capability may publish. Default off: only servers publish. |
| `create_time` | `timestamp` | When the namespace was created. Output only. |
| `update_time` | `timestamp` | When the rules last changed. Output only. |

## 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.
- [`PLAN_LIMIT_REACHED`](/docs/api/errors/PLAN_LIMIT_REACHED) — The plan's limit is reached.

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

## Examples

**cURL**

```curl
curl -X PUT "https://api.realtime.sylphx.com/v1/namespaces/name" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

**TypeScript**

```ts
const response = await sylphx.realtime.namespaces.put({ name: 'name' })
```

**Rust**

```rust
let mut req = sylphx::realtime::PutNamespaceRequest::default();
req.name = "name".to_string();
let response = sx.realtime().namespaces().put(req).await?;
```

**MCP**

```json
{ "method_id": "realtime.namespaces.put", "args": {"name":"name"} }
```
