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

# Create a Topic

> This endpoint creates a new topic in QStash.

## Request

<ParamField body="name" type="string" required>
  The name of the topic Must only contain alphanumeric characters, underscores,
  dashes and periods. Regex: `^[a-zA-Z0-9-_.]+$`
</ParamField>

## Response

<ResponseField name="endpoints" type="Array<Endpoint>" required>
  <Expandable title="Endpoint">
    <ResponseField name="endpointId" type="string">
      The id of the endpoint.
    </ResponseField>

    <ResponseField name="topicId" type="string">
      The id of the topic this endpoint subscribes to.
    </ResponseField>

    <ResponseField name="url" type="string">
      The url where all requests will be sent to.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="name" type="string" required>
  A user given name must only contain alphanumeric, hyphen, underscore and
  periods.
</ResponseField>

<ResponseField name="topicId" type="string" required>
  Id for this topic
</ResponseField>

<RequestExample>
  ```shell curl
  curl -X PUT https://qstash.upstash.io/v1/topics/:topicId\
    -H "Authorization: Bearer <token>" \
    -d '{ "name": "test" }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200
  {
    "topicId": "tpc_7EfEryZiheEKzpMuvjYdhhhbNNJA",
    "name": "test",
    "endpoints": [
      {
        "endpointId": "ept_6j7BNZus3ZyPy6P7QtLUMCC3Rq7h",
        "url": "https://www.upstash.com",
        "topicId": "tpc_7EfEryZiheEKzpMuvjYdhhhbNNJA"
      }
    ]
  }
  ```
</ResponseExample>
