> ## Documentation Index
> Fetch the complete documentation index at: https://docs.streamnative.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Topic

In a StreamNative Cluster, topics are grouped into [tenants](/cloud/manage-data-streams/tenant) and [namespaces](/cloud/manage-data-streams/namespace). In this guide, we will use the existing `public/default` namespace.

## Authorize the Service Account

<Note title="Note">
  If you create a super-user service account, you can skip this step.
</Note>

Before configuring the producer and consumer clients, you need to authorize the service account to grant the necessary permissions for the service account to interact with your StreamNative Cloud cluster.

To grant the service account permissions on the namespace level, follow these steps:

<Tabs>
  <Tab title="Cloud Console">
    1. Navigate to the **Namespace Dashboard** page by [switching to the namespace workspace](/cloud/get-started/cloud-console#switch-a-namespace).

    2. On the **Namespace Dashboard** page, click **Configuration** on the left navigation pane.

    3. On the **Namespace configuration** page, click **ADD ROLE**, and select the service account that you want to authorize.

    4. On the drop-down menu below the service account, select the proper permissions to assign to the service account. There are six permissions in total:

    * `consume`: allow the service account to consume messages.
    * `produce`: allow the service account to publish messages.
    * `functions`: allow the service account to submit and manage functions.
    * `sinks`: allow the service account to create and manage sink connectors.
    * `sources`: allow the service account to create and manage source connectors.
    * `packages`: allow the service account to upload and manage pulsar packages. If you want to submit a customized function/connector, then you will need to upload the function/connector’s JAR/NAR/Python file first, which requires the `packages` permission.

          <img src="https://mintcdn.com/streamnative/leDK9vfVV1vzDfM1/media/authorize-sa.png?fit=max&auto=format&n=leDK9vfVV1vzDfM1&q=85&s=104b2ef6f69dd498ca2552ecb26221cf" alt="Authorize Service Account" width="3218" height="1802" data-path="media/authorize-sa.png" />
  </Tab>
</Tabs>

In this guide, we will authorize the service account with the `produce` and `consume` permissions for the `public/default` namespace.

## Create a Topic

Navigate to the **Namespace Dashboard** page of the `public/default` namespace and follow the instructions below to create a topic, `purchases`, which you will use to produce and consume events.

<Tabs>
  <Tab title="StreamNative Console">
    To create a topic, follow these steps.

    1. Navigate to the desired **Namespace Dashboard** page by [switching to the namespace workspace](/cloud/get-started/cloud-console#switch-a-namespace).

    2. On the left navigation pane, under **Resources**, click **Topics**.

    3. Click **New Topic**.

           <img src="https://mintcdn.com/streamnative/DYzjgCK90kxVTpdd/media/newtopic.png?fit=max&auto=format&n=DYzjgCK90kxVTpdd&q=85&s=d14806bbb2383142f109b55d426c1613" alt="screenshot of new topic dialog box" width="1036" height="750" data-path="media/newtopic.png" />

    4. Configure the topic, as outlined in the following table.

       | Item       | Description                                                                                                                                                                                                                                                                    |
       | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
       | Persistent | Configure the type of the topic. <br />- Persistent: messages in a persistent topic are durably persisted on the storage disk. <br />- Non-persistent: messages in a non-persistent topic are not persisted on the storage disk. <br /> By default, it is set to *Persistent*. |
       | Topic Name | Enter a name for the topic. It is a string of up to 40 characters, supporting lowercase letters (a-z), numeric characters (0-9), and the special character hyphen (-).                                                                                                         |
       | Partitions | (Optional) Configure the number of partitions for a partitioned topic. You can have from 1 up to 100 partitions per topic. It's recommended to have at least 1 partition.                                                                                                      |

    5. Click **Confirm**.
  </Tab>
</Tabs>
