Azure Virtual Machines Capacity Reservations API

The CapacityReservations API from Azure Virtual Machines — 1 operation(s) for capacityreservations.

GitHub OpenAPI

Operations 4

GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName} Capacity reservations get #
PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName} Capacity reservations create or update #
PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName} Capacity reservations update #
DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName} Capacity reservations delete #

Documentation

Specifications

SDKs

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/microsoft-azure-virtual-machines:microsoft-azure-virtual-machines-capacityreservations-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

microsoft-azure-virtual-machines-capacityreservations-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Azure Compute resource management API.
  version: '2026-04-01'
  description: Compute Client
  x-typespec-generated:
  - emitter: '@azure-tools/typespec-autorest'
servers:
- url: https://management.azure.com
security:
- azure_auth:
  - user_impersonation
tags:
- name: CapacityReservations
paths:
  ? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}
  : get:
      operationId: CapacityReservations_Get
      tags:
      - CapacityReservations
      description: The operation that retrieves information about the capacity reservation.
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - name: capacityReservationGroupName
        in: path
        description: The name of the capacity reservation group.
        required: true
        schema:
          type: string
      - name: capacityReservationName
        in: path
        description: The name of the capacity reservation.
        required: true
        schema:
          type: string
      - name: $expand
        in: query
        description: The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the capacity reservation that is managed by the platform and can change outside of control plane operations.
        required: false
        x-ms-enum:
          name: CapacityReservationInstanceViewTypes
          modelAsString: true
          values:
          - name: instanceView
            value: instanceView
        schema:
          type: string
          enum:
          - instanceView
      responses:
        '200':
          description: Azure operation completed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CapacityReservation'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CloudError'
      summary: Capacity reservations get
      x-summary-source: derived
    put:
      operationId: CapacityReservations_CreateOrUpdate
      tags:
      - CapacityReservations
      description: The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details.
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - name: capacityReservationGroupName
        in: path
        description: The name of the capacity reservation group.
        required: true
        schema:
          type: string
      - name: capacityReservationName
        in: path
        description: The name of the capacity reservation.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Azure operation completed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CapacityReservation'
        '201':
          description: Resource 'CapacityReservation' create operation succeeded
          headers:
            Location:
              description: The Location header contains the URL where the status of the long running operation can be checked.
              schema:
                type: string
            Retry-After:
              description: The Retry-After header can indicate how long the client should wait before polling the operation status.
              schema:
                type: integer
                format: int32
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CapacityReservation'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CloudError'
      x-ms-long-running-operation-options:
        final-state-via: location
        final-state-schema: '#/definitions/CapacityReservation'
      x-ms-long-running-operation: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CapacityReservation'
        description: Parameters supplied to the Create capacity reservation.
        required: true
      summary: Capacity reservations create or update
      x-summary-source: derived
    patch:
      operationId: CapacityReservations_Update
      tags:
      - CapacityReservations
      description: The operation to update a capacity reservation.
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - name: capacityReservationGroupName
        in: path
        description: The name of the capacity reservation group.
        required: true
        schema:
          type: string
      - name: capacityReservationName
        in: path
        description: The name of the capacity reservation.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Azure operation completed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CapacityReservation'
        '202':
          description: Resource update request accepted.
          headers:
            Location:
              description: The Location header contains the URL where the status of the long running operation can be checked.
              schema:
                type: string
            Retry-After:
              description: The Retry-After header can indicate how long the client should wait before polling the operation status.
              schema:
                type: integer
                format: int32
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CloudError'
      x-ms-long-running-operation-options:
        final-state-via: location
        final-state-schema: '#/definitions/CapacityReservation'
      x-ms-long-running-operation: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CapacityReservationUpdate'
        description: Parameters supplied to the Update capacity reservation operation.
        required: true
      summary: Capacity reservations update
      x-summary-source: derived
    delete:
      operationId: CapacityReservations_Delete
      tags:
      - CapacityReservations
      description: 'The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after they have been successfully allocated until the schedule end time. Future capacity reservations (Minimum API version: 2026-04-01) can be deleted if their reservation state is one of: Pending, Declined, FulfillmentFailed, or Approved. Otherwise, Future capacity reservations in the Committed, Live, or PartiallyFulfilled state cannot be deleted until minimumCommitmentDays have elapsed since their scheduled start date.'
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - name: capacityReservationGroupName
        in: path
        description: The name of the capacity reservation group.
        required: true
        schema:
          type: string
      - name: capacityReservationName
        in: path
        description: The name of the capacity reservation.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Resource deleted successfully.
        '202':
          description: Resource deletion accepted.
          headers:
            Location:
              description: The Location header contains the URL where the status of the long running operation can be checked.
              schema:
                type: string
            Retry-After:
              description: The Retry-After header can indicate how long the client should wait before polling the operation status.
              schema:
                type: integer
                format: int32
        '204':
          description: Resource does not exist.
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CloudError'
      x-ms-long-running-operation-options:
        final-state-via: location
      x-ms-long-running-operation: true
      summary: Capacity reservations delete
      x-summary-source: derived
components:
  schemas:
    ApiError:
      type: object
      properties:
        details:
          type: array
          items:
            $ref: '#/components/schemas/ApiErrorBase'
          x-ms-identifiers:
          - message
          - target
          description: The Api error details
        innererror:
          $ref: '#/components/schemas/InnerError'
          description: The Api inner error
        code:
          type: string
          description: The error code.
        target:
          type: string
          description: The target of the particular error.
        message:
          type: string
          description: The error message.
      description: Api error.
    CapacityReservationStateInfo:
      type: object
      description: Details related to the current state for a Future capacity reservation.
      properties:
        reservationState:
          $ref: '#/components/schemas/ReservationState'
          description: The current state of the capacity reservation.
    CapacityReservationUtilization:
      type: object
      description: Represents the capacity reservation utilization in terms of resources allocated.
      properties:
        currentCapacity:
          type: integer
          format: int32
          description: 'The value provides the current capacity of the VM size which was reserved successfully and for which the customer is getting billed. Minimum api-version: 2022-08-01.'
          readOnly: true
        virtualMachinesAllocated:
          type: array
          description: A list of all virtual machines resource ids allocated against the capacity reservation.
          items:
            $ref: '#/components/schemas/SubResourceReadOnly'
          readOnly: true
        usedReservedCountBySubscription:
          type: object
          description: 'For open capacity reservations, this provides a map of the used reserved capacity count keyed by the subscription id (a GUID) that is consuming the capacity, i.e. each entry maps a consuming subscription id to the count of reserved capacity it is currently using. This is populated only for open capacity reservations and is not reported for targeted and block capacity reservations, which instead report allocation through virtualMachinesAllocated. Minimum api-version: 2026-04-01.'
          additionalProperties:
            format: int32
            type: integer
          readOnly: true
    ReservationState:
      type: string
      description: The current state of a Future capacity reservation.
      enum:
      - Pending
      - Declined
      - Approved
      - FulfillmentFailed
      - Committed
      - Live
      - PartiallyFulfilled
      x-ms-enum:
        name: ReservationState
        modelAsString: true
        values:
        - name: Pending
          value: Pending
          description: The capacity reservation request has been submitted and is awaiting evaluation.
        - name: Declined
          value: Declined
          description: The capacity reservation request was rejected, and will not change again without user action.
        - name: Approved
          value: Approved
          description: The capacity reservation request has been approved by Azure and is awaiting fulfillment.
        - name: FulfillmentFailed
          value: FulfillmentFailed
          description: A failure occurred while attempting to fulfill the capacity reservation request.
        - name: Committed
          value: Committed
          description: The capacity reservation is locked and cannot be updated or deleted prior to going live.
        - name: Live
          value: Live
          description: The capacity reservation is active and available for use, and cannot be modified or deleted until the minimum commitment period has elapsed.
        - name: PartiallyFulfilled
          value: PartiallyFulfilled
          description: Azure was only able to deliver a portion of the requested capacity. The capacity reservation cannot be modified or deleted until the minimum commitment period has elapsed. The portion of fulfilled capacity can be viewed by inspecting the capacity reservation's instance view, displayed as currentCapacity within the utilizationInfo.
    TrackedResource:
      type: object
      title: Tracked Resource
      description: The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'
      properties:
        tags:
          type: object
          description: Resource tags.
          additionalProperties:
            type: string
          x-ms-mutability:
          - read
          - create
          - update
        location:
          type: string
          description: The geo-location where the resource lives
          x-ms-mutability:
          - read
          - create
      required:
      - location
      allOf:
      - $ref: '#/components/schemas/Resource'
    InstanceViewStatus:
      type: object
      description: Instance view status.
      properties:
        code:
          type: string
          description: The status code.
        level:
          $ref: '#/components/schemas/StatusLevelTypes'
          description: The level code.
        displayStatus:
          type: string
          description: The short localizable label for the status.
        message:
          type: string
          description: The detailed status message, including for alerts and error messages.
        time:
          type: string
          format: date-time
          description: The time of the status.
    SubResourceReadOnly:
      type: object
      properties:
        id:
          readOnly: true
          type: string
          description: Resource Id
    StatusLevelTypes:
      type: string
      description: The level code.
      enum:
      - Info
      - Warning
      - Error
      x-ms-enum:
        name: StatusLevelTypes
        modelAsString: false
    CapacityReservation:
      type: object
      description: Specifies information about the capacity reservation.
      properties:
        properties:
          $ref: '#/components/schemas/CapacityReservationProperties'
          description: Properties of the Capacity reservation.
          x-ms-client-flatten: true
        sku:
          $ref: '#/components/schemas/Sku'
          description: SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set.  For Block capacity reservations, sku.capacity can only accept values 1, 2, 4, 8, 16, 32, 64. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. When 'CapacityReservationSupported' is true, the SKU capability also specifies the 'SupportedCapacityReservationTypes', which lists the types of capacity reservations (such as Targeted or Block) that the SKU supports. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values.
        zones:
          type: array
          description: The availability zones.
          items:
            type: string
      required:
      - sku
      allOf:
      - $ref: '#/components/schemas/TrackedResource'
    CapacityReservationProperties:
      type: object
      description: Properties of the Capacity reservation.
      properties:
        reservationId:
          type: string
          description: A unique id generated and assigned to the capacity reservation by the platform which does not change throughout the lifetime of the resource.
          readOnly: true
        platformFaultDomainCount:
          type: integer
          format: int32
          description: 'Specifies the value of fault domain count that Capacity Reservation supports for requested VM size. **Note:** The fault domain count specified for a resource (like virtual machines scale set) must be less than or equal to this value if it deploys using capacity reservation. Minimum api-version: 2022-08-01.'
          readOnly: true
        virtualMachinesAssociated:
          type: array
          description: A list of all virtual machine resource ids that are associated with the capacity reservation.
          items:
            $ref: '#/components/schemas/SubResourceReadOnly'
          readOnly: true
        provisioningTime:
          type: string
          format: date-time
          description: The date time when the capacity reservation was last updated.
          readOnly: true
        provisioningState:
          type: string
          description: The provisioning state, which only appears in the response.
          readOnly: true
        instanceView:
          $ref: '#/components/schemas/CapacityReservationInstanceView'
          description: The Capacity reservation instance view.
          readOnly: true
        timeCreated:
          type: string
          format: date-time
          description: 'Specifies the time at which the Capacity Reservation resource was created. Minimum api-version: 2021-11-01.'
          readOnly: true
        scheduleProfile:
          $ref: '#/components/schemas/ScheduleProfile'
          description: 'Defines the schedule for Block and Future capacity reservations. Specifies the schedule during which capacity reservation is active and VM or VMSS resource can be allocated using reservation. For Block capacity reservations, the scheduleProfile, start, and end fields are immutable after creation. Please refer to https://aka.ms/blockcapacityreservation for more details. Minimum API version for Block capacity reservations: 2025-04-01. Future capacity reservations must use this property with only a start time, which can be changed until the ‘modifiableUntil’ time. Please refer to https://aka.ms/futurecapacityreservation for more details. Minimum API version for Future capacity reservations: 2026-04-01.'
    CloudError:
      type: object
      x-ms-external: true
      properties:
        error:
          $ref: '#/components/schemas/ApiError'
      description: An error response from the Compute service.
    Sku:
      type: object
      description: 'Describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU name.'
      properties:
        name:
          type: string
          description: The sku name.
        tier:
          type: string
          description: Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic**
        capacity:
          type: integer
          format: int64
          description: Specifies the number of virtual machines in the scale set.
    CapacityReservationUpdate:
      type: object
      description: Specifies information about the capacity reservation. sku.capacity cannot be updated for Block Capacity Reservation. Tags can be update for all Capacity Reservation Types.
      properties:
        properties:
          $ref: '#/components/schemas/CapacityReservationProperties'
          description: Properties of the Capacity reservation.
          x-ms-client-flatten: true
        sku:
          $ref: '#/components/schemas/Sku'
          description: SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. When 'CapacityReservationSupported' is true, the SKU capability also specifies the 'SupportedCapacityReservationTypes', which lists the types of capacity reservations (such as Targeted or Block) that the SKU supports. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. **Note:** The SKU name and capacity cannot be updated for Block capacity reservations.
      allOf:
      - $ref: '#/components/schemas/UpdateResource'
    ScheduleProfile:
      type: object
      description: 'Defines the schedule for Block and Future capacity reservations. Specifies the schedule during which capacity reservation is active and VM or VMSS resource can be allocated using reservation. For Block capacity reservations, the scheduleProfile, start, and end fields are immutable after creation. Please refer to https://aka.ms/blockcapacityreservation for more details. Minimum API version for Block capacity reservations: 2025-04-01. Future capacity reservations must use this property with only a start time, which can be changed until the ‘modifiableUntil’ time. Please refer to https://aka.ms/futurecapacityreservation for more details. Minimum API version for Future capacity reservations: 2026-04-01.'
      properties:
        start:
          type: string
          description: 'The required start date for Block or Future capacity reservations. Block capacity reservations: Must be today or within 56 days in the future. For same-day scheduling, requests must be submitted before 11:30 AM UTC. Future capacity reservations: Must be at least 7 days in the future, and maximum 6 months in the future. Minimum API version for Future capacity reservations: 2026-04-01. Example: 2025-06-27, applicable for both Block and Future capacity reservations.'
        end:
          type: string
          description: 'The required end date for Block capacity reservations. Must be after the start date, with a duration of either 1–14 whole days or 3–26 whole weeks. Example: 2025-06-28.'
        minimumCommitmentDays:
          type: integer
          format: int32
          description: The minimum number of days that must pass after the start date before a Future capacity reservation can be updated or deleted once it has been committed. Will be populated with a default value if not provided.
        modifiableUntil:
          type: string
          format: date-time
          description: The date/time until which a Future capacity reservation can be updated or deleted. Read-only.
          readOnly: true
    CapacityReservationInstanceView:
      type: object
      description: The instance view of a capacity reservation that provides as snapshot of the runtime properties of the capacity reservation that is managed by the platform and can change outside of control plane operations.
      properties:
        utilizationInfo:
          $ref: '#/components/schemas/CapacityReservationUtilization'
          description: Unutilized capacity of the capacity reservation.
        statuses:
          type: array
          description: The resource status information.
          items:
            $ref: '#/components/schemas/InstanceViewStatus'
          x-ms-identifiers: []
        reservationStateInfo:
          $ref: '#/components/schemas/CapacityReservationStateInfo'
          description: 'The reservation state information for a capacity reservation, this detail is primarily provided for Future capacity reservations. Minimum API version: 2026-04-01.'
    UpdateResource:
      type: object
      description: The Update Resource model definition.
      properties:
        tags:
          type: object
          description: Resource tags
          additionalProperties:
            type: string
  parameters:
    SubscriptionIdParameter:
      name: subscriptionId
      in: path
      description: The ID of the target subscription.
      required: true
      schema:
        type: string
        minLength: 1
    ResourceGroupNameParameter:
      name: resourceGroupName
      in: path
      description: The name of the resource group. The name is case insensitive.
      required: true
      x-ms-parameter-location: method
      schema:
        type: string
        maxLength: 90
        minLength: 1
    ApiVersionParameter:
      name: api-version
      in: query
      description: The API version to use for this operation.
      required: true
      schema:
        type: string
        minLength: 1
  securitySchemes:
    azure_auth:
      type: oauth2
      flows:
        implicit:
          scopes:
            user_impersonation: impersonate your user account
          authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
      description: Azure Active Directory OAuth2 Flow.
x-ms-paths:
  ? /subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions?$expand=Properties
  : get:
      operationId: VirtualMachineImages_ListWithProperties
      tags:
      - VirtualMachineImages
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/LocationParameter'
      - name: publisherName
        in: path
        description: A valid image publisher.
        required: true
        type: string
      - name: offer
        in: path
        description: A valid image publisher offer.
        required: true
        type: string
      - name: skus
        in: path
        description: A valid image SKU.
        required: true
        type: string
      - name: $expand
        in: query
        description: The expand expression to apply on the operation.
        required: true
        type: string
      - name: $top
        in: query
        required: false
        type: integer
        format: int32
      - name: $orderby
        in: query
        required: false
        type: string
      responses:
        '200':
          description: Azure operation completed successfully.
          schema:
            type: array
            items:
              $ref: '#/components/schemas/VirtualMachineImage'
        default:
          description: An unexpected error response.
          schema:
            $ref: '#/components/schemas/CloudError'