> ## Documentation index
> Fetch the complete documentation index at: https://upstash.com/docs/llms.txt
> Ask it with GET https://upstash.com/docs/ask?q=<keywords or question>. Short keywords rank best.
> Use these to discover all available pages before exploring further.
> Feature requests: https://upstash.com/docs/common/help/feature-requests.md lists what users asked for and how to vote for a request or add one.
> Page rating: `GET https://upstash.com/docs/feedback?path=/docs/api-reference/qstash/get-the-next-qstash-token&helpful={true|false}&comment={comment}` records whether this page helped. The `comment` (URL-encoded, at most 500 characters) says what helped, or what was missing or wrong; a `helpful=false` rating needs it. It is anonymous and needs no key. Comments hold no code, secrets or personal data.

# Get the Next QStash Token

> Returns the next token and next read-only token of the QStash user account,
creating them if they do not exist yet. Both the current and the next tokens
are accepted, so you can update your applications with the next token
without downtime, then call [Roll QStash Token](/api-reference/qstash/roll-qstash-token).

Calling this endpoint again returns the same pair until the token is rolled.
For a QStash account created through the Vercel Marketplace, the next token is
also written to the Vercel project's `QSTASH_TOKEN`; redeploy the project before rolling.


`POST /qstash/next-token/{id}`

## OpenAPI

````yaml devops/developer-api/openapi.yaml post /qstash/next-token/{id}
openapi: 3.0.4
info:
  title: Developer API - Upstash
  description: This is a documentation to specify Developer API endpoints based on
    the OpenAPI 3.0 specification.
  contact:
    name: Support Team
    email: support@upstash.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.0
servers:
  - url: https://api.upstash.com/v2
tags:
  - name: redis
    description: Manage redis databases.
    externalDocs:
      description: Find out more
      url: https://upstash.com/docs/devops/developer-api/introduction
  - name: teams
    description: Manage teams and team members.
    externalDocs:
      description: Find out more
      url: https://upstash.com/docs/devops/developer-api/introduction
  - name: vector
    description: Manage vector indices.
    externalDocs:
      description: Find out more
      url: https://upstash.com/docs/devops/developer-api/introduction
  - name: search
    description: Manage search indices.
    externalDocs:
      description: Find out more
      url: https://upstash.com/docs/devops/developer-api/introduction
  - name: qstash
    description: Manage QStash.
    externalDocs:
      description: Find out more
      url: https://upstash.com/docs/devops/developer-api/introduction
paths:
  /qstash/next-token/{id}:
    post:
      summary: Get the Next QStash Token
      description: >
        Returns the next token and next read-only token of the QStash user
        account,

        creating them if they do not exist yet. Both the current and the next
        tokens

        are accepted, so you can update your applications with the next token

        without downtime, then call [Roll QStash
        Token](/api-reference/qstash/roll-qstash-token).


        Calling this endpoint again returns the same pair until the token is
        rolled.

        For a QStash account created through the Vercel Marketplace, the next
        token is

        also written to the Vercel project's `QSTASH_TOKEN`; redeploy the
        project before rolling.
      operationId: getQStashNextToken
      tags:
        - qstash
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: QStash user ID
      responses:
        "200":
          description: The next token pair
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QStashNextToken"
        "400":
          description: >
            The request was refused: the account is in the middle of another
            change,

            your team role does not allow it, or the next token could not be
            written to Vercel.
          content:
            application/json:
              schema:
                type: string
                example: You are not allowed to do this operation
        "404":
          description: QStash user not found
          content:
            application/json:
              schema:
                type: string
                example: QStash user not found
      security:
        - basicAuth: []
components:
  schemas:
    QStashNextToken:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the QStash user account
          example: 99a4c327-31f0-490f-a594-043ade84085a
        next_token:
          type: string
          description: The next token. It is accepted alongside the current token until
            the token is rolled.
          example: ZXhhbXBsZUB1cHN0YXNoLmNvbTpuZXh0
        next_read_only_token:
          type: string
          description: The next read-only token
          example: ZXhhbXBsZUB1cHN0YXNoLmNvbTpuZXh0cm8=
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
````
