***

title: PubSub
slug: /reference/python/rest/pubsub
description: PubSub API namespace for token creation.
max-toc-depth: 3
---------------------

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

[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**

<CardGroup cols={3}>
  <Card title="create_token" href="/docs/server-sdks/reference/python/rest/pubsub/create-token">
    Create a PubSub token.
  </Card>
</CardGroup>

## **Example**

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

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