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

# Patch reservation units

> Release and add reservation units.



## OpenAPI

````yaml /openapi/reservation-openapi.yaml patch /api/v2/reservations/{reservationID}/units
openapi: 3.0.3
info:
  title: Unikorn Reservation API
  description: |-
    Reservation service provides topology-aware bare metal GPU reservation and
    placement, sitting atop UNI Region service resources.
  version: 0.5.0
servers:
  - url: https://reservation.nks.europe-west4.nscale.com
    description: Production
  - url: https://reservation.nks-stg.europe-west2.nscale.com
    description: Staging
  - url: https://reservation.uni-dev.glo1.nscale.com
    description: Development
security: []
paths:
  /api/v2/reservations/{reservationID}/units:
    description: |-
      Synchronously releases and adds whole, named reservation units in one
      request. The request is atomic across both lists: either every requested
      release and add is applied to the Reservation's accepted claim, or the
      claim is unchanged. The release always applies before the add, whatever
      order the body names them in, so one request can move a Reservation onto
      different units, including onto another spine. Both lists identify units
      the same way: by the opaque unit node IDs the organization topology view
      gives them, whether the unit is free or already held by this
      Reservation. Release is limited to the Reservation's own claim, an
      occupied unit refuses the whole request, and every added unit must be
      free and pass the Reservation's claim policy, flavor scope and
      single-spine scope. Every patch reads current topology once, after
      the claim and If-Match checks pass: both lists name the unit node IDs
      that topology shows, and the release list resolves by the devices of
      the named unit that the Reservation's claim holds, so a release-only
      patch that cannot read Fleet Manager is refused with 503 and releases
      nothing.
    parameters:
      - $ref: '#/components/parameters/reservationIDParameter'
      - $ref: '#/components/parameters/ifMatchParameter'
    patch:
      tags:
        - Reservations
      summary: Patch reservation units
      description: Release and add reservation units.
      operationId: patchReservationUnits
      requestBody:
        $ref: '#/components/requestBodies/reservationUnitPatchRequestBody'
      responses:
        '200':
          $ref: '#/components/responses/reservationUnitPatchResponse'
        '400':
          $ref: '#/components/responses/badRequestResponse'
        '401':
          $ref: '#/components/responses/unauthorizedResponse'
        '403':
          $ref: '#/components/responses/forbiddenResponse'
        '404':
          $ref: '#/components/responses/notFoundResponse'
        '409':
          $ref: '#/components/responses/conflictResponse'
        '412':
          $ref: '#/components/responses/preconditionFailedResponse'
        '422':
          $ref: '#/components/responses/reservationUnitPatchRefusalResponse'
        '428':
          $ref: '#/components/responses/preconditionRequiredResponse'
        '500':
          $ref: '#/components/responses/internalServerErrorResponse'
        '503':
          $ref: '#/components/responses/serviceUnavailableResponse'
      security:
        - oauth2Authentication: []
components:
  parameters:
    reservationIDParameter:
      name: reservationID
      in: path
      description: The reservation ID.
      required: true
      schema:
        type: string
        minLength: 1
        maxLength: 63
    ifMatchParameter:
      name: If-Match
      in: header
      description: >
        The entity tag of the current state the caller expects to mutate, quoted
        as a strong entity tag (for example the value of a prior response's ETag
        header). The endpoint requires it and rejects a request that omits it
        with 428, and one whose tag no longer matches the resource's current
        entity tag with 412. It is declared optional at the schema level
        deliberately: request validation runs before the handler, and a
        schema-level requirement would reject an absent header with a generic
        400 before the endpoint could return the precise 428. The endpoint owns
        the precondition instead.
      required: false
      schema:
        type: string
  requestBodies:
    reservationUnitPatchRequestBody:
      description: A request to release and add reservation units.
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/reservationUnitPatchRequest'
          example:
            spec:
              releaseUnitIds:
                - >-
                  3f9c2b1a7e4d5f60918273645afbecd0192837465fabcde0123456789abcdef
              addUnitIds:
                - >-
                  7d1e4c9a2b6f8012345678901234567890abcdef1234567890abcdef12345678
  responses:
    reservationUnitPatchResponse:
      description: A reservation unit patch result.
      headers:
        ETag:
          description: >
            The Reservation's new accepted topology hash after this request,
            quoted as a strong entity tag, for use as the next add, release or
            patch request's If-Match precondition.
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/reservationUnitPatchResult'
          example:
            reservation:
              metadata:
                id: a64f9269-36e0-4312-b8d1-52d93d569b7b
                name: gb300-nvl72
                organizationId: 9a8c6370-4065-4d4a-9da0-7678df40cd9d
                projectId: e36c058a-8eba-4f5b-91f4-f6ffb983795c
                creationTime: '2026-04-28T10:45:45.000Z'
                createdBy: john.doe@example.com
                provisioningStatus: provisioned
                healthStatus: healthy
              spec:
                regionId: c7568e2d-f9ab-453d-9a3a-51375f78426b
                accelerator: GB300
                unit: NVL72
                count: 2
              status:
                machineFlavorId: g.72.gb300.pinned
                claimedUnitCount: 2
                topologyHash: >-
                  sha256:9a1f9b6b4b9b0b4e7d9c6a5f3e2d1c0b8a7f6e5d4c3b2a1908f7e6d5c4b3a291
                topologyObservedAt: '2026-05-14T10:05:00.000Z'
            releasedUnits:
              - id: >-
                  3f9c2b1a7e4d5f60918273645afbecd0192837465fabcde0123456789abcdef
                infrastructureRefs:
                  - 00000000-0000-0000-0000-000000000003
            addedUnits:
              - id: >-
                  7d1e4c9a2b6f8012345678901234567890abcdef1234567890abcdef12345678
                infrastructureRefs:
                  - 00000000-0000-0000-0000-000000000005
    badRequestResponse:
      description: |-
        Request body failed schema validation, or the request does not contain
        all the required fields.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error: invalid_request
            error_description: request body invalid
            trace_id: 57bc14d9bd461f0b5a72db830149b67a
    unauthorizedResponse:
      description: Authentication failed or the access token has expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error: access_denied
            error_description: authentication failed
            trace_id: 57bc14d9bd461f0b5a72db830149b67a
    forbiddenResponse:
      description: >-
        Request was denied by authorization, this may be caused by the
        authorization

        token not having the required scope for an API, or the user doesn't have
        the

        necessary privileges on the provider platform.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error: forbidden
            error_description: user credentials do not have the required privileges
            trace_id: 57bc14d9bd461f0b5a72db830149b67a
    notFoundResponse:
      description: Unable to find a resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error: not_found
            error_description: the requested resource does not exist
            trace_id: 57bc14d9bd461f0b5a72db830149b67a
    conflictResponse:
      description: >-
        Resource conflicts with another, usually this means they have the same
        name.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error: conflict
            error_description: a resource with the same name already exists
            trace_id: 57bc14d9bd461f0b5a72db830149b67a
    preconditionFailedResponse:
      description: |-
        The If-Match precondition no longer matches the resource's current
        entity tag; the request was not applied. Re-read the resource,
        obtain its current entity tag, and retry.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
    reservationUnitPatchRefusalResponse:
      description: |-
        The patch request could not proceed because one of its lists refused
        it. The body names that list: blockers for a release the request could
        not make, ineligible units for an add it could not make. Nothing was
        released and nothing was added.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/reservationUnitPatchRefusalV2'
          examples:
            releaseBlocked:
              value:
                list: release
                blockers:
                  - unitId: >-
                      3f9c2b1a7e4d5f60918273645afbecd0192837465fabcde0123456789abcdef
                    consumers:
                      - type: placement
                        placementId: b8ce034e-fccb-4d6c-a0e0-af3e3f346715
                        serverIds:
                          - psrv-950ab3259a1443da
                units: []
            addIneligible:
              value:
                list: add
                blockers: []
                units:
                  - unitId: >-
                      7d1e4c9a2b6f8012345678901234567890abcdef1234567890abcdef12345678
                    reason: spine
    preconditionRequiredResponse:
      description: |-
        The request requires an If-Match precondition header, which was
        missing.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
    internalServerErrorResponse:
      description: >-
        An unexpected or unhandled error occurred. This may be a transient error
        and

        may succeed on a retry.  If this isn't the case, please report it as an
        issue.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error: server_error
            error_description: failed to token claim
            trace_id: 57bc14d9bd461f0b5a72db830149b67a
    serviceUnavailableResponse:
      description: |-
        A dependency the request needs cannot currently be read, so the
        request cannot be evaluated against current state. Nothing was
        changed; retry later.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
  schemas:
    reservationUnitPatchRequest:
      description: A request to release and add reservation units.
      type: object
      required:
        - spec
      properties:
        spec:
          $ref: '#/components/schemas/reservationUnitPatchSpec'
    reservationUnitPatchResult:
      description: The result of a reservation unit patch request.
      type: object
      required:
        - reservation
        - releasedUnits
        - addedUnits
      properties:
        reservation:
          $ref: '#/components/schemas/reservationV2Read'
        releasedUnits:
          description: Units released by this request; empty when it named none.
          type: array
          items:
            $ref: '#/components/schemas/patchedUnitV2'
        addedUnits:
          description: Units added by this request; empty when it named none.
          type: array
          items:
            $ref: '#/components/schemas/patchedUnitV2'
    error:
      description: Generic error message, compatible with oauth2.
      type: object
      required:
        - error
        - error_description
      properties:
        error:
          description: >-
            A terse error string expanding on the HTTP error code. Errors are
            based on the OAuth 2.02 specification, but are expanded with
            proprietary status codes for APIs other than those specified by
            OAuth 2.02.
          type: string
          enum:
            - invalid_request
            - server_error
            - access_denied
            - not_found
            - conflict
            - method_not_allowed
            - unsupported_media_type
            - request_entity_too_large
            - unprocessable_content
            - forbidden
        error_description:
          description: Verbose message describing the error.
          type: string
        trace_id:
          description: Unique trace identifier for the request.
          type: string
    reservationUnitPatchRefusalV2:
      description: |-
        Structured reasons a patch request could not proceed, naming the one
        list it failed on. Nothing was applied: the other list, if any, was
        not touched either.
      type: object
      required:
        - list
        - blockers
        - units
      properties:
        list:
          description: >
            The list that refused the request. release: the release list, with
            its blockers. add: the add list, with its ineligible units.
          type: string
          enum:
            - release
            - add
        blockers:
          description: >
            Blocking units when list is release; empty otherwise. One entry per
            occupied requested unit.
          type: array
          items:
            $ref: '#/components/schemas/reservationUnitBlockerV2'
        units:
          description: >
            Ineligible units when list is add; empty otherwise. One entry per
            refused unit.
          type: array
          items:
            $ref: '#/components/schemas/reservationUnitIneligibilityV2'
    reservationUnitPatchSpec:
      description: Reservation units to release and to add, in one request.
      type: object
      properties:
        releaseUnitIds:
          description: >
            Opaque unit node IDs to release: the id of each domain node the
            organization topology view marks as this Reservation's. Released
            before the added units are applied, whatever order they are named
            in. Not the Reservation-scoped handles POST units/release takes,
            provider inventory identifiers, device IDs, or path labels.
          type: array
          uniqueItems: true
          items:
            type: string
        addUnitIds:
          description: >
            Opaque unit node IDs to add, from the free unit nodes of the
            organization topology view in the Reservation's scope. The same ID
            kind as releaseUnitIds; no ID may appear in both lists.
          type: array
          uniqueItems: true
          items:
            type: string
    reservationV2Read:
      description: A reservation.
      type: object
      required:
        - metadata
        - spec
        - status
      properties:
        metadata:
          $ref: '#/components/schemas/projectScopedResourceReadMetadata'
        spec:
          $ref: '#/components/schemas/reservationV2Spec'
        status:
          $ref: '#/components/schemas/reservationV2Status'
    patchedUnitV2:
      description: A reservation unit released or added by a patch request.
      type: object
      required:
        - id
        - infrastructureRefs
      properties:
        id:
          description: >
            Opaque unit node ID the request named, so the caller can correlate
            the response with its request without another topology read.
          type: string
        infrastructureRefs:
          description: Ironic node UUIDs of the hosts the request released or added.
          type: array
          items:
            type: string
    reservationUnitBlockerV2:
      description: A requested reservation unit that could not be released.
      type: object
      required:
        - unitId
        - consumers
      properties:
        unitId:
          description: >
            The unit ID the request named for the blocked unit: a
            Reservation-scoped handle for POST units/release, a unit node ID for
            a unit patch.
          type: string
        consumers:
          description: >
            Blocking consumers visible to the caller. Empty when the unit is
            occupied but no blocking Placement details are readable.
          type: array
          items:
            $ref: '#/components/schemas/reservationUnitConsumerV2'
    reservationUnitIneligibilityV2:
      description: A requested reservation unit that cannot join the claim.
      type: object
      required:
        - unitId
        - reason
      properties:
        unitId:
          description: The opaque, free reservation unit ID that was refused.
          type: string
        reason:
          description: >
            claim_policy: the unit has a host that fails the Reservation's claim
            policy. flavor_scope: the unit's hosts do not match the
            Reservation's device type. spine: the unit is outside the single
            spine the Reservation's claim must occupy.
          type: string
          enum:
            - claim_policy
            - flavor_scope
            - spine
    projectScopedResourceReadMetadata:
      description: Metadata required by project scoped resource reads.
      allOf:
        - $ref: '#/components/schemas/organizationScopedResourceReadMetadata'
        - type: object
          required:
            - projectId
          properties:
            projectId:
              description: The project identifier the resource belongs to.
              type: string
    reservationV2Spec:
      description: A reservation's specification.
      type: object
      required:
        - regionId
        - accelerator
        - unit
        - count
      properties:
        regionId:
          description: The region to reserve capacity in.
          type: string
        accelerator:
          description: Public accelerator model or family to reserve.
          type: string
        unit:
          description: Public reservation granularity to reserve.
          type: string
        count:
          description: Number of reservation units to reserve.
          type: integer
          minimum: 1
    reservationV2Status:
      description: Read only status information about a reservation.
      type: object
      required:
        - machineFlavorId
        - claimedUnitCount
        - host
      properties:
        machineFlavorId:
          description: Resolved Region machine flavor used for pinned servers.
          type: string
        claimedUnitCount:
          description: Number of reservation units successfully claimed.
          type: integer
          minimum: 0
        host:
          $ref: '#/components/schemas/reservationUnitHostV2'
        topologyHash:
          description: Hash of the claimed topology projection accepted by the reservation.
          type: string
        topologyObservedAt:
          description: Time when the claimed topology projection was last observed.
          type: string
          format: date-time
    reservationUnitConsumerV2:
      description: |
        A readable Placement still holding hosts from a blocked release unit.
      type: object
      required:
        - type
        - placementId
        - serverIds
      properties:
        type:
          description: The kind of consumer holding the unit's hosts.
          type: string
          enum:
            - placement
        placementId:
          description: The Placement ID holding hosts in this unit.
          type: string
        serverIds:
          description: >
            Public Placement server IDs occupying this unit. Empty when the
            caller can read the Placement but cannot read its servers.
          type: array
          items:
            type: string
        managedBy:
          description: >
            Present when the consumer Placement is owned by another controller;
            omitted for directly-created Placements.
          type: object
          required:
            - kind
            - id
          properties:
            kind:
              type: string
            id:
              type: string
    organizationScopedResourceReadMetadata:
      description: Metadata required by organization scoped resource reads.
      allOf:
        - $ref: '#/components/schemas/resourceReadMetadata'
        - type: object
          required:
            - organizationId
          properties:
            organizationId:
              description: The organization identifier the resource belongs to.
              type: string
    reservationUnitHostV2:
      description: Region flavor capacity for one host in a reservation unit.
      type: object
      required:
        - cpus
        - memory
        - disk
        - gpu
        - architecture
      properties:
        cpus:
          description: The number of CPUs on one host.
          type: integer
          minimum: 0
        memory:
          description: The amount of memory in GiB on one host.
          type: integer
          minimum: 0
        disk:
          description: The amount of ephemeral disk in GB on one host.
          type: integer
          minimum: 0
        gpu:
          $ref: '#/components/schemas/reservationUnitGpuV2'
        architecture:
          $ref: '#/components/schemas/architectureV2'
    resourceReadMetadata:
      description: Metadata required by all resource reads.
      allOf:
        - $ref: '#/components/schemas/staticResourceMetadata'
        - type: object
          required:
            - provisioningStatus
            - healthStatus
          properties:
            deletionTime:
              description: The time the resource was deleted.
              type: string
              format: date-time
            provisioningStatus:
              $ref: '#/components/schemas/resourceProvisioningStatus'
            provisioningStatusDetail:
              $ref: '#/components/schemas/provisioningStatusDetail'
            healthStatus:
              $ref: '#/components/schemas/resourceHealthStatus'
            healthStatusDetail:
              $ref: '#/components/schemas/healthStatusDetail'
    reservationUnitGpuV2:
      description: GPU specification for one host in a reservation unit.
      type: object
      required:
        - vendor
        - model
        - physicalCount
        - logicalCount
        - memory
      properties:
        vendor:
          $ref: '#/components/schemas/gpuVendorV2'
        model:
          description: A GPU model.
          type: string
        physicalCount:
          description: The physical number of GPUs available on one host.
          type: integer
          minimum: 0
        logicalCount:
          description: The logical number of GPUs available on one host.
          type: integer
          minimum: 0
        memory:
          description: GPU memory in GiB for one GPU.
          type: integer
          minimum: 0
    architectureV2:
      description: A CPU architecture.
      type: string
      enum:
        - UNKNOWN
        - x86_64
        - aarch64
    staticResourceMetadata:
      description: |
        This metadata is for resources that just exist, and don't require
        any provisioning and health status, but benefit from a standardized
        metadata format.
      type: object
      allOf:
        - $ref: '#/components/schemas/resourceMetadata'
        - type: object
          required:
            - id
            - creationTime
          properties:
            id:
              description: The unique resource ID.
              type: string
            creationTime:
              description: The time the resource was created.
              type: string
              format: date-time
            createdBy:
              description: The user who created the resource.
              type: string
            modifiedTime:
              description: The time a resource was updated.
              type: string
              format: date-time
            modifiedBy:
              description: The user who updated the resource.
              type: string
    resourceProvisioningStatus:
      description: The provisioning state of a resource.
      type: string
      enum:
        - pending
        - provisioning
        - provisioned
        - deprovisioning
        - error
    provisioningStatusDetail:
      description: |-
        Human-facing detail about the current provisioning state: a
        machine-classifiable reason drawn from a closed vocabulary, and a
        user-safe human-readable message. Derived from the resource's status and
        supplements the coarse provisioningStatus; never stored.
      type: object
      required:
        - reason
        - message
      properties:
        reason:
          $ref: '#/components/schemas/provisioningStatusReason'
        message:
          description: A user-safe, human-readable description of the provisioning state.
          type: string
    resourceHealthStatus:
      description: The health state of a resource.
      type: string
      enum:
        - unknown
        - healthy
        - degraded
        - error
    healthStatusDetail:
      description: >-
        Human-facing detail about the current health state: a
        machine-classifiable

        reason drawn from a closed vocabulary, and a user-safe human-readable

        message (e.g. "2/12 nodes are down"). Derived from the resource's status
        and

        supplements the coarse healthStatus; never stored.
      type: object
      required:
        - reason
        - message
      properties:
        reason:
          $ref: '#/components/schemas/healthStatusReason'
        message:
          description: A user-safe, human-readable description of the health state.
          type: string
    gpuVendorV2:
      description: The GPU vendor.
      type: string
      enum:
        - UNKNOWN
        - NVIDIA
        - AMD
    resourceMetadata:
      description: Metadata required for all API resource reads and writes.
      required:
        - name
      properties:
        name:
          $ref: '#/components/schemas/kubernetesLabelValue'
        description:
          description: >-
            The resource description, this optionally augments the name with
            more context.
          type: string
        tags:
          $ref: '#/components/schemas/tagList'
    provisioningStatusReason:
      description: |-
        A closed, generic classification of a resource's provisioning state,
        finer-grained than provisioningStatus. This vocabulary is owned by the
        platform and is the same across all resources; domain-specific state
        (e.g. an instance's lifecycle phase) is carried on other mechanisms and
        never appears here.
      type: string
      enum:
        - Provisioning
        - Provisioned
        - Errored
        - Deprovisioning
        - Deprovisioned
        - DependencyNotReady
        - DependencyFailed
        - DependencyNotFound
    healthStatusReason:
      description: >-
        A closed, generic classification of a resource's health — the raw health

        condition reason, finer-grained than the coarse healthStatus. Owned by
        the

        platform and the same across all resources.
      type: string
      enum:
        - Healthy
        - Degraded
        - Unknown
    kubernetesLabelValue:
      description: >-
        A valid Kubernetes label value, typically used for resource names that
        can be

        indexed in the database.
      type: string
      pattern: ^[0-9A-Za-z](?:[0-9A-Za-z-_.]{0,61}[0-9A-Za-z])?$
    tagList:
      description: A list of tags.
      type: array
      items:
        $ref: '#/components/schemas/tag'
    tag:
      description: >-
        A tag mapping arbitrary names to values.  These have no special meaning

        for any component are are intended for use by end users to add
        additional

        context to a resource, for example to categorize it.
      type: object
      required:
        - name
        - value
      properties:
        name:
          description: A unique tag name.
          type: string
        value:
          description: The value of the tag.
          type: string
  securitySchemes:
    oauth2Authentication:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: /oauth2/v2/authorization
          tokenUrl: /oauth2/v2/token
          scopes: {}

````