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

# Update Assignments

> Apply the same partial update to every assignment in `assignmentIds`.



## OpenAPI

````yaml https://api.primeintellect.ai/openapi.json patch /api/admin/inventory/assignments
openapi: 3.1.0
info:
  title: PI API
  version: 0.1.0
servers:
  - url: https://api.primeintellect.ai
security: []
paths:
  /api/admin/inventory/assignments:
    patch:
      tags:
        - admin-inventory
      summary: Update Assignments
      description: Apply the same partial update to every assignment in `assignmentIds`.
      operationId: update_assignments_api_admin_inventory_assignments_patch
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkAssignmentUpdateRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericResponse_MutationResult_'
        '401':
          description: Authorization failed
        '403':
          description: Insufficient permissions
        '422':
          description: Invalid request data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    BulkAssignmentUpdateRequest:
      properties:
        assignmentIds:
          items:
            type: string
          type: array
          maxItems: 1000
          title: Assignmentids
        values:
          $ref: '#/components/schemas/AssignmentUpdateRequest'
      type: object
      required:
        - assignmentIds
        - values
      title: BulkAssignmentUpdateRequest
      description: |-
        Apply the same partial `values` to every assignment in `assignment_ids`
        (globally unique, so a selection may span clusters).
    GenericResponse_MutationResult_:
      properties:
        data:
          anyOf:
            - $ref: '#/components/schemas/MutationResult'
            - type: 'null'
          description: Response data
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: Response status
      type: object
      title: GenericResponse[MutationResult]
    ErrorResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Errors
      type: object
      required:
        - errors
      title: ErrorResponse
    AssignmentUpdateRequest:
      properties:
        status:
          anyOf:
            - $ref: '#/components/schemas/InventoryNodeAssignmentStatusEnum'
            - type: 'null'
        type:
          anyOf:
            - $ref: '#/components/schemas/InventoryNodeAssignmentTypeEnum'
            - type: 'null'
        isController:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Iscontroller
        priceHr:
          anyOf:
            - type: number
            - type: 'null'
          title: Pricehr
        startDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Startdate
        endDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Enddate
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
        metadata:
          anyOf:
            - $ref: '#/components/schemas/AssignmentMetadata'
            - type: 'null'
      type: object
      title: AssignmentUpdateRequest
      description: >-
        Attributes only — never `node_id`/`cluster_id` (reassign = delete +
        create).
    MutationResult:
      properties:
        operationId:
          type: string
          title: Operationid
        targetId:
          anyOf:
            - type: string
            - type: 'null'
          title: Targetid
        targetName:
          anyOf:
            - type: string
            - type: 'null'
          title: Targetname
        message:
          type: string
          title: Message
        created:
          anyOf:
            - type: integer
            - type: 'null'
          title: Created
        updated:
          anyOf:
            - type: integer
            - type: 'null'
          title: Updated
        assigned:
          anyOf:
            - type: integer
            - type: 'null'
          title: Assigned
        detached:
          anyOf:
            - type: integer
            - type: 'null'
          title: Detached
        retired:
          anyOf:
            - type: integer
            - type: 'null'
          title: Retired
      type: object
      required:
        - operationId
        - message
      title: MutationResult
    ErrorDetail:
      properties:
        param:
          type: string
          title: Param
        details:
          type: string
          title: Details
      type: object
      required:
        - param
        - details
      title: ErrorDetail
    InventoryNodeAssignmentStatusEnum:
      type: string
      enum:
        - PLANNED
        - ACTIVE
        - ENDED
        - CANCELLED
      title: InventoryNodeAssignmentStatusEnum
    InventoryNodeAssignmentTypeEnum:
      type: string
      enum:
        - STANDARD
        - FAILOVER
      title: InventoryNodeAssignmentTypeEnum
    AssignmentMetadata:
      properties:
        playbooks:
          anyOf:
            - $ref: '#/components/schemas/AssignmentPlaybooksMetadata'
            - type: 'null'
      additionalProperties: true
      type: object
      title: AssignmentMetadata
      description: >-
        The assignment's `metadata` JSON. Only `playbooks` is validated; other
        keys

        (e.g. the NetBox migration's `source`) pass through untouched.
    AssignmentPlaybooksMetadata:
      properties:
        hostVars:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: integer
                  - type: number
                  - type: boolean
              type: object
            - type: 'null'
          title: Hostvars
        dropHostVars:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Drophostvars
        groups:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Groups
        dropGroups:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Dropgroups
        hostAlias:
          anyOf:
            - type: string
            - type: 'null'
          title: Hostalias
        inlineNote:
          anyOf:
            - type: string
            - type: 'null'
          title: Inlinenote
      additionalProperties: false
      type: object
      title: AssignmentPlaybooksMetadata
      description: >-
        Per-assignment overrides applied when rendering the cluster's
        inventory.ini.


        Cluster-scoped on purpose: the same node can need a different

        `private_interface` or topology zone in the next cluster it joins, so
        these

        win over the node's own columns.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````