> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qubesync.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete a queued request

> Permanently deletes a queued request by ID. This operation is idempotent - deleting an already deleted request will return a successful response. Only requests that are in a terminal state (completed, error, or discarded) can be deleted. Active requests must be cancelled first.



## OpenAPI

````yaml /api-reference/v1/openapi.json delete /queued_requests/{request_id}
openapi: 3.0.0
info:
  title: QuBe Sync API
  description: Integrate with QuickBooks Desktop or QuickBooks Enterprise in a few steps.
  version: 1.0.0
  contact:
    email: support@qubesync.com
servers:
  - url: https://qubesync.com/api/v1
    description: v1 API
  - url: https://dev.qubesync.com/api/v1
    description: Local development server
security: []
tags:
  - name: Connections
    description: Endpoints for managing QuickBooks connections
  - name: Queued Requests
    description: Endpoints for managing queued API requests
  - name: Pre-built Queries
    description: >-
      Endpoints for executing pre-built queries against QuickBooks data. These
      endpoints simplify common data retrieval operations by providing a
      higher-level interface than the raw queued requests API. Each query is
      executed asynchronously and returns a queued request ID that can be used
      to check the status and retrieve results.
paths:
  /queued_requests/{request_id}:
    delete:
      tags:
        - Queued Requests
      summary: Delete a queued request
      description: >-
        Permanently deletes a queued request by ID. This operation is idempotent
        - deleting an already deleted request will return a successful response.
        Only requests that are in a terminal state (completed, error, or
        discarded) can be deleted. Active requests must be cancelled first.
      operationId: deleteQueuedRequest
      parameters:
        - name: request_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            example: 550e8400-e29b-41d4-a716-446655440000
          description: The unique identifier of the queued request to delete
        - name: force
          in: query
          required: false
          schema:
            type: boolean
            default: false
          description: >-
            If true, allows deletion of requests that are not in a terminal
            state. Use with caution as this may leave the connection in an
            inconsistent state.
      responses:
        '204':
          description: Queued request was successfully deleted or did not exist
        '400':
          description: Bad request - cannot delete request in current state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                activeRequest:
                  summary: Cannot delete active request
                  value:
                    error:
                      message: >-
                        Cannot delete request in state 'waiting'. Only
                        completed, failed, or discarded requests can be deleted.
                      code: invalid_state
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Queued request not found or already deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                errors:
                  detail: Not Found
        '409':
          description: Conflict - cannot delete request due to business rules
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                connectionActive:
                  summary: Cannot delete request with active connection
                  value:
                    error:
                      message: >-
                        Cannot delete request: Connection is currently active.
                        Please disconnect first.
                      code: connection_active
      security:
        - apiKey: []
components:
  schemas:
    Error:
      description: >-
        What a refused request answers with. The one key is errors, and its
        shape says what went wrong: a sentence when the endpoint explains the
        refusal in words (a parameter the operation does not take, a key already
        taken, a run that has already ended); an object with detail, and a code
        when there is one, when the request named nothing that exists or may not
        do what it asked (402, 403, 404, and a CLI session's 401), or an answer
        to a run's question was refused (the decisions endpoint's 400, 409 and
        422, which always carry a code to branch on); an object of fields, each
        a list of messages, when a record failed validation and nothing was
        saved; a list of {path, message} problems when a submitted document or
        input fails validation. A request without a usable API key gets a 401
        Basic challenge with the plain-text body Unauthorized, not JSON.
      properties:
        errors:
          oneOf:
            - example: 'unknown parameter: "emial"'
              title: A sentence
              type: string
            - properties:
                code:
                  example: read_only_session
                  type: string
                detail:
                  example: Not Found
                  type: string
              required:
                - detail
              title: Detail and code
              type: object
            - additionalProperties:
                items:
                  type: string
                type: array
              example:
                redirect_url:
                  - must be a valid URL
              title: Field by field
              type: object
            - items:
                properties:
                  message:
                    example: is required
                    type: string
                  path:
                    example: input.customer
                    type: string
                required:
                  - path
                  - message
                type: object
              title: Located problems
              type: array
      required:
        - errors
      type: object
  responses:
    Unauthorized:
      description: >-
        No usable API key. The key is Basic auth, so the answer is the
        challenge, with the plain-text body Unauthorized rather than JSON.
      headers:
        WWW-Authenticate:
          schema:
            type: string
            example: Basic realm="Application"
      content:
        text/plain:
          schema:
            type: string
          example: Unauthorized
  securitySchemes:
    apiKey:
      type: http
      scheme: basic
      description: Use your app's API_KEY as the username, and leave the password blank

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.