> ## Documentation index
> Fetch the complete documentation index at: https://upstash.com/docs/llms.txt
> Search it with GET https://upstash.com/docs/search?q=<query>.
> Use these to discover all available pages before exploring further.

# Retry a Message Now

> Deliver a delayed message, or a message waiting for its next retry, immediately

`POST /v2/messages/{messageId}/retry`

This endpoint skips the remaining wait of a waiting message and delivers it right away. It works for:

- **Delayed messages**, published with `Upstash-Delay` or `Upstash-Not-Before`, including sleeping workflow steps.
- **Retrying messages**, whose last delivery failed and which are waiting out the retry delay before the next attempt.

Retrying now does not add an extra attempt. It moves the already scheduled retry forward, so the retry count and the remaining retries stay the same.

You can find messages waiting for a retry by listing the [logs](/qstash/api-reference/logs/list-logs) with `state=RETRY`.

With the TypeScript SDK, use `client.messages.runNow("<MESSAGE_ID>")`.

See [Run a Delayed Message Now](/qstash/howto/retry-now) for more details.

<Note>
Messages published to a [queue](/qstash/features/queues) can not be rescheduled to retry now. The request returns `400` for them.
</Note>

## OpenAPI

````yaml qstash/openapi.yaml post /v2/messages/{messageId}/retry
openapi: 3.1.0
info:
  title: QStash REST API
  description: |
    QStash is a message queue and scheduler built on top of Upstash Redis.
  version: 2.0.0
  contact:
    name: Upstash
    url: https://upstash.com
servers:
  - url: https://qstash-{region}.upstash.io
    description: Regional
    variables:
      region:
        default: eu-central-1
        enum:
          - us-east-1
          - eu-central-1
security:
  - bearerAuth: []
  - bearerAuthQuery: []
tags:
  - name: Messages
    description: Publish and manage messages
  - name: Queues
    description: Manage message queues
  - name: Schedules
    description: Create and manage scheduled messages
  - name: URL Groups
    description: Manage URL groups and endpoints
  - name: DLQ
    description: Dead Letter Queue operations
  - name: Logs
    description: Log operations
  - name: Signing Keys
    description: Manage signing keys
  - name: Flow Control
    description: Monitor flow control keys
  - name: Bulk Actions
    description: Track filter-based bulk operations
paths:
  /v2/messages/{messageId}/retry:
    post:
      summary: Retry a Message Now
      description: Deliver a delayed message, or a message waiting for its next retry,
        immediately
      tags:
        - Messages
      x-mint:
        content: >
          This endpoint skips the remaining wait of a waiting message and
          delivers it right away. It works for:


          - **Delayed messages**, published with `Upstash-Delay` or
          `Upstash-Not-Before`, including sleeping workflow steps.

          - **Retrying messages**, whose last delivery failed and which are
          waiting out the retry delay before the next attempt.


          Retrying now does not add an extra attempt. It moves the already
          scheduled retry forward, so the retry count and the remaining retries
          stay the same.


          You can find messages waiting for a retry by listing the
          [logs](/qstash/api-reference/logs/list-logs) with `state=RETRY`.


          With the TypeScript SDK, use `client.messages.runNow("<MESSAGE_ID>")`.


          See [Run a Delayed Message Now](/qstash/howto/retry-now) for more
          details.


          <Note>

          Messages published to a [queue](/qstash/features/queues) can not be
          rescheduled to retry now. The request returns `400` for them.

          </Note>
      parameters:
        - name: messageId
          in: path
          required: true
          schema:
            type: string
          description: The identifier of the message to deliver now.
      responses:
        "200":
          description: The message is rescheduled for immediate delivery.
        "400":
          description: The message id is invalid, or the message belongs to a queue.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Message not found, or the message is not waiting for a delay or a
            retry.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: QStash authentication token
    bearerAuthQuery:
      type: apiKey
      in: query
      name: qstash_token
      description: QStash authentication token passed as a query parameter
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message
````
