> ## 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.
> Page rating: `GET https://upstash.com/docs/feedback?path=/docs/workflow/api-reference/dlq/delete/delete-pagination-api&helpful=true` (or `false`) records whether this page helped. An optional `comment` (URL-encoded, at most 500 characters) says what was missing or wrong. It is anonymous and needs no key. Comments hold no code, secrets or personal data.

# Sync Bulk

> Delete Failed Workflow Runs with Pagination

`DELETE /v2/workflows/dlq`

<Warning>
  The synchronous pagination API is deprecated. It’s recommended to use Async Bulk endpoint to process all matching entries in a bulk action.
</Warning>

## OpenAPI

````yaml workflow/openapi.yaml delete /v2/workflows/dlq
openapi: 3.1.0
info:
  title: Upstash Workflow REST API
  description: >
    Upstash Workflow is a serverless workflow orchestration service built on top
    of Upstash QStash and 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: []
paths:
  /v2/workflows/dlq:
    delete:
      tags:
        - DLQ
      summary: Delete Sync Bulk
      description: >
        Delete multiple failed workflow runs from the DLQ.


        When a workflow run fails, it is moved to the DLQ. You can manually
        remove a failed workflow run from the DLQ using this endpoint. This is
        useful for cleaning up failed runs that you no longer wish to retry or
        analyze.
      x-mint:
        href: /workflow/api-reference/dlq/delete/delete-pagination-api
        metadata:
          title: Sync Bulk
          sidebarTitle: Sync Bulk
          description: Delete Failed Workflow Runs with Pagination
        content: >
          <Warning>
            The synchronous pagination API is deprecated. It’s recommended to use Async Bulk endpoint to process all matching entries in a bulk action.
          </Warning>
      parameters:
        - in: query
          name: cursor
          required: false
          schema:
            type: string
          description: Pagination cursor for deleting in batches.
        - in: query
          name: count
          required: false
          schema:
            type: integer
          description: Maximum number of workflows to delete per request.
        - in: query
          name: fromDate
          required: false
          schema:
            type: integer
            format: int64
          description: Filter by starting date in milliseconds (Unix timestamp). This is
            inclusive.
        - in: query
          name: toDate
          required: false
          schema:
            type: integer
            format: int64
          description: Filter by ending date in milliseconds (Unix timestamp). This is
            inclusive.
        - in: query
          name: workflowUrl
          required: false
          schema:
            type: array
            items:
              type: string
          description: Filter by workflow URL. Supports multiple values.
        - in: query
          name: workflowRunId
          required: false
          schema:
            type: string
          description: Filter by workflow run ID.
        - in: query
          name: workflowCreatedAt
          required: false
          schema:
            type: integer
            format: int64
          description: Filter by workflow creation timestamp in milliseconds (Unix
            timestamp).
        - in: query
          name: label
          required: false
          schema:
            type: array
            items:
              type: string
          description: >
            Filter by label assigned to the workflow run. Supports multiple
            values.
        - in: query
          name: failureFunctionState
          required: false
          schema:
            type: array
            items:
              type: string
          description: |
            Filter by failure function state. Supports multiple values.

            | State | Description |
            |--------|--------------|
            | CALLBACK_INPROGRESS | The failure function is in progress. |
            | CALLBACK_SUCCESS | The failure function run successfully. |
            | CALLBACK_FAIL | The failure function failed to run. |
            | CALLBACK_CANCELED | The failure function was manually canceled |
        - in: query
          name: callerIp
          required: false
          schema:
            type: array
            items:
              type: string
          description: Filter by IP address of the publisher. Supports multiple values.
        - in: query
          name: flowControlKey
          required: false
          schema:
            type: array
            items:
              type: string
          description: Filter by Flow Control Key. Supports multiple values.
      responses:
        "200":
          description: Workflows deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  deleted:
                    type: integer
                    format: int64
                    description: The number of workflow runs that were deleted.
                  cursor:
                    type: string
                    description: Pagination cursor for the next batch, when more results remain.
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "500":
          description: Internal Server Error
          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
````
