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

# Cancel a queued activity on a device

> Cancel ONE activity still queued on a device — a pending software install or uninstall, or a queued script — identified by the `uuid` returned by `getDeviceUpcomingActivities`. Use this to clear an install that is wedged (a package install Fleet leaves `in_progress` for up to an hour after the device went offline) and unblock the activities queued behind it. This does not undo work already done on the device: an activity that already started or finished cannot be cancelled and returns a 404. Cancelling is visible to the person waiting on that install, so confirm with the user before calling it. The software row keeps its `in_progress` state until the device state is resynced, so call `syncDeviceSoftware` afterwards before re-reading `getDeviceSoftware`. To queue the install again, use `installDeviceSoftware`.

<span className="badge-write">Key: Write</span><span className="badge-company">Scope: Company</span>


## OpenAPI

````yaml https://api.getprimo.com/openapi.json delete /devices/{deviceId}/activities/upcoming/{activityUuid}
openapi: 3.1.1
info:
  title: Public API - BETA
  description: Read docs on https://docs.getprimo.com/
  version: '1.0'
  contact: {}
servers:
  - url: https://api.getprimo.com
security:
  - apikey: []
tags: []
paths:
  /devices/{deviceId}/activities/upcoming/{activityUuid}:
    delete:
      tags:
        - Devices
      summary: Cancel a queued activity on a device
      description: >-
        Cancel ONE activity still queued on a device — a pending software
        install or uninstall, or a queued script — identified by the `uuid`
        returned by `getDeviceUpcomingActivities`. Use this to clear an install
        that is wedged (a package install Fleet leaves `in_progress` for up to
        an hour after the device went offline) and unblock the activities queued
        behind it. This does not undo work already done on the device: an
        activity that already started or finished cannot be cancelled and
        returns a 404. Cancelling is visible to the person waiting on that
        install, so confirm with the user before calling it. The software row
        keeps its `in_progress` state until the device state is resynced, so
        call `syncDeviceSoftware` afterwards before re-reading
        `getDeviceSoftware`. To queue the install again, use
        `installDeviceSoftware`.
      operationId: cancelDeviceUpcomingActivity
      parameters:
        - name: deviceId
          required: true
          in: path
          schema:
            type: string
        - name: activityUuid
          required: true
          in: path
          schema:
            type: string
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceActionResult_Output'
components:
  schemas:
    DeviceActionResult_Output:
      type: object
      properties:
        success:
          type: boolean
          const: true
        message:
          type: string
          description: A human-readable description of the action
      required:
        - success
        - message
      additionalProperties: false
  securitySchemes:
    apikey:
      scheme: bearer
      bearerFormat: API key
      type: http
      description: >-
        Use your Primo API key in the Authorization header as `Bearer
        <API_KEY>`.

````