# Pin a message

`POST https://rest.wordplus.cloud/wordplus/realtime/streams/{name}/pin`

Pins a message of the chat over it for everyone watching, in place of the one pinned before. `null` unpins it.

In the packages: `realtime.stream( name ).pin( id )`.

## Parameters

| Name | In | |
|---|---|---|
| `name` (required) | path | The stream name, percent-encoded: `show:mugs` is `show%3Amugs`. |

## Request

```json
{
  "id": "1791638400000-0"
}
```

## Answer

Done.

```json
{
  "ok": true
}
```

## Refusals

- **400**: `bad_request`, `bad_room`: the request is not one the API takes. `reserved`: an event name kept for the room itself.
- **401**: `missing_signature`, `stale_signature` (a clock off by more than 5 minutes), `unknown_site`, `bad_signature` (a wrong secret, or a body or path other than the one signed).
- **403**: `not_included`: your plan does not include it.
- **404**: `not_found`: nothing by that name or id now.

## Examples

`wordplus()` (in Go `app.Request()`) signs and sends the request: https://docs.wordplus.cloud/api/signing/ has it in each language.

**curl**

```bash
wordplus POST '/wordplus/realtime/streams/show%3Amugs/pin' '{"id":"1791638400000-0"}'
```

**Node**

```js
await wordplus('POST', `/wordplus/realtime/streams/${encodeURIComponent('show:mugs')}/pin`, { id: '1791638400000-0' });
```

**Python**

```python
wordplus("POST", f"/wordplus/realtime/streams/{quote('show:mugs', safe='')}/pin", {"id": "1791638400000-0"})
```

**PHP**

```php
wordplus('POST', '/wordplus/realtime/streams/'.rawurlencode('show:mugs').'/pin', ['id' => '1791638400000-0']);
```

**Go**

```go
_, err := app.Request("POST", "/wordplus/realtime/streams/"+url.PathEscape("show:mugs")+"/pin", map[string]any{"id": "1791638400000-0"})
```

