---
title: "POST /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesCancelOperations"
method: POST
path: "/subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesCancelOperations"
---

# POST /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesCancelOperations

`POST /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesCancelOperations`

VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) request

## Path parameters

- `locationparameter` string, required

## Parameters

- `../../../../../common-types/resource-management/v6/types.json#/components/parameters/ApiVersionParameter` — unresolved $ref
- `../../../../../common-types/resource-management/v6/types.json#/components/parameters/SubscriptionIdParameter` — unresolved $ref

## Request body

- CancelOperationsRequest — This is the request to cancel running operations in scheduled actions using the operation ids
  - `operationIds` string[], required — The list of operation ids to cancel operations on
  - `correlationid` string, required — CorrelationId item

## Response `200`

Azure operation completed successfully.

- CancelOperationsResponse — This is the response from a cancel operations request
  - `results` ResourceOperation[], required — An array of resource operations that were successfully cancelled
    - `resourceId` string, arm-id — Unique identifier for the resource involved in the operation, eg ArmId
    - `errorCode` string — Resource level error code if it exists
    - `errorDetails` string — Resource level error details if they exist
    - `operation` ResourceOperationDetails — The details of a response from an operation on a resource
      - `operationId` string, required — Operation identifier for the unique operation
      - `resourceId` string, arm-id — Unique identifier for the resource involved in the operation, eg ArmId
      - `opType` 'Unknown' | 'Start' | 'Deallocate' | 'Hibernate' | 'Create' | 'Delete' — Type of operation performed on the resources
      - `subscriptionId` string — Subscription id attached to the request
      - `deadline` string, date-time — Deadline for the operation
      - `deadlineType` 'Unknown' | 'InitiateAt' | 'CompleteBy' — Type of deadline of the operation
      - `state` 'Unknown' | 'PendingScheduling' | 'Scheduled' | 'PendingExecution' | 'Executing' | 'Succeeded' | 'Failed' | 'Cancelled' | 'Blocked' — Current state of the operation
      - `timezone` string — Timezone for the operation
      - `timeZone` string — Timezone for the operation
      - `resourceOperationError` ResourceOperationError — These describe errors that occur at the resource level
        - `errorCode` string, required — Code for the error eg 404, 500
        - `errorDetails` string, required — Detailed message about the error
      - `fallbackOperationInfo` FallbackOperationInfo — Describes the fallback operation that was performed
        - `lastOpType` 'Unknown' | 'Start' | 'Deallocate' | 'Hibernate' | 'Create' | 'Delete', required — The kind of operation types that can be performed on resources using ScheduledActions
        - `status` string, required — The status of the fallback operation
        - `error` ResourceOperationError — These describe errors that occur at the resource level
          - `errorCode` string, required — Code for the error eg 404, 500
          - `errorDetails` string, required — Detailed message about the error
      - `completedAt` string, date-time — Time the operation was complete if errors are null
      - `retryPolicy` RetryPolicy — The retry policy for the user request
        - `retryCount` integer — Retry count for user request
        - `retryWindowInMinutes` integer — Retry window in minutes for user request
        - `onFailureAction` 'Unknown' | 'Start' | 'Deallocate' | 'Hibernate' | 'Create' | 'Delete' — The kind of operation types that can be performed on resources using ScheduledActions

## Other responses

- `default` — An unexpected error response.

---

[API](https://skmtc.net/azure/apis/computeschedule-microsoft-computeschedule.md) · [All operations](https://skmtc.net/azure/apis/computeschedule-microsoft-computeschedule/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/computeschedule-microsoft-computeschedule/revisions/5ea978da3356/schema)
