> ## Documentation Index
> Fetch the complete documentation index at: https://upstash-fix-issues-on-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Topics and Endpoints

QStash allows you to group multiple APIs together into a single namespace,
called a `topic`. Read more about topics [here](/qstash/features/topics).

There are two ways to create endpoints and topics: The UI and the REST API.

## UI

Go to [console.upstash.com/qstash](https://console.upstash.com/qstash) and click
on the `Topics` tab. Afterwards you can create a new topic by giving it a name.
Keep in mind that topic names are restricted to alphanumeric, underscore, hyphen
and dot characters.

![](https://mintlify.s3-us-west-1.amazonaws.com/upstash-fix-issues-on-docs/img/qstash/create_topic.png)

After creating the topic, you can add endpoints to it:

![](https://mintlify.s3-us-west-1.amazonaws.com/upstash-fix-issues-on-docs/img/qstash/create_endpoint.png)

## API

You can create a topic and endpoint using the [console](https://console.upstash.com/qstash) or [REST API](/qstash/api/topics/add-endpoint).

<CodeGroup>
  ```bash cURL
  curl -XPOST https://qstash.upstash.io/v2/topics/:topicName/endpoints \
    -H "Authorization: Bearer <token>" \
    -H "Content-Type: application/json" \
    -d '{
      "endpoints": [
        {
          "name": "endpoint1",
          "url": "https://example.com"
        },
        {
          "name": "endpoint2",
          "url": "https://somewhere-else.com"
        }
      ]
    }'
  ```

  ```typescript Typescript
  import { Client } from "@upstash/qstash";

  const client = new Client({ token: "<QSTASH_TOKEN>" });
  const topics = client.topics();
  await topics.addEndpoints({
    name: "topicName",
    endpoints: [
      { name: "endpoint1", url: "https://example.com" },
      { name: "endpoint2", url: "https://somewhere-else.com" },
    ],
  });
  ```

  ```python Python
  from upstash_qstash import Client

  client = Client("<QSTASH_TOKEN>")
  topics = client.topics()
  topics.upsert_or_add_endpoints(
    {
      "name": "topic_name",
      "endpoints": [
        { "name": "endpoint1", "url": "https://example.com" },
        { "name": "endpoint2", "url": "https://somewhere-else.com" },
      ],
    }
  )
  ```
</CodeGroup>
