# Delete a message

`DELETE https://rest.wordplus.cloud/wordplus/realtime/streams/{name}/chat/{id}`

Deletes a message of the chat for everyone watching, and unpins it when it was pinned.

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

## Parameters

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

## Answer

Whether the message was there.

```json
{
  "ok": true,
  "deleted": 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.

## 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 DELETE '/wordplus/realtime/streams/show%3Amugs/chat/1791638400000-0'
```

**Node**

```js
const { deleted } = await wordplus('DELETE', `/wordplus/realtime/streams/${encodeURIComponent('show:mugs')}/chat/1791638400000-0`);
```

**Python**

```python
deleted = wordplus("DELETE", f"/wordplus/realtime/streams/{quote('show:mugs', safe='')}/chat/1791638400000-0")["deleted"]
```

**PHP**

```php
$deleted = wordplus('DELETE', '/wordplus/realtime/streams/'.rawurlencode('show:mugs').'/chat/1791638400000-0')['deleted'];
```

**Go**

```go
answer, err := app.Request("DELETE", "/wordplus/realtime/streams/"+url.PathEscape("show:mugs")+"/chat/1791638400000-0", nil)
```

