POST
/
v2
/
topics
/
{topicName}
/
endpoints
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"
      }
    ]
  }'

If the topic does not exist, it will be created. If the endpoint does not exist, it will be created.

Request

topicName
string
required

The name of your topic. If it doesn’t exist yet, it will be created.

endpoints
Array
required

The endpoints to add to the topic.

Response

This endpoint returns 200 if the endpoints are added successfully.

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"
      }
    ]
  }'