> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# PubSub

> PubSub API namespace for token creation.

[restclient]: /docs/server-sdks/reference/python/rest/client

Generate tokens for the SignalWire PubSub (publish-subscribe) real-time messaging
service. PubSub tokens authenticate client-side connections to subscribe to
channels and publish messages.

Access via `client.pubsub` on a [`RestClient`][restclient] instance.

## **Methods**

Create a PubSub token.

## **Example**

```python {4}
from signalwire.rest import RestClient

client = RestClient()
result = client.pubsub.create_token(channels=["notifications"])
```