> ## 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.

# Create Inventory Assignment

> Assign nodes to a cluster for a window inside their contracted availability.



## OpenAPI

````yaml https://api.primeintellect.ai/openapi.json post /api/admin/inventory/clusters/{cluster_id}/assignments
openapi: 3.1.0
info:
  title: PI API
  version: 0.1.0
servers:
  - url: https://api.primeintellect.ai
security: []
paths:
  /api/admin/inventory/clusters/{cluster_id}/assignments:
    post:
      tags:
        - admin-inventory
      summary: Create Inventory Assignment
      description: >-
        Assign nodes to a cluster for a window inside their contracted
        availability.
      operationId: >-
        create_inventory_assignment_api_admin_inventory_clusters__cluster_id__assignments_post
      parameters:
        - name: cluster_id
          in: path
          required: true
          schema:
            type: string
            title: Cluster Id
        - name: dryRun
          in: query
          required: false
          schema:
            type: boolean
            title: Dryrun
            default: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssignmentCreateRequest'
      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:
    AssignmentCreateRequest:
      properties:
        nodeIds:
          items:
            type: string
          type: array
          maxItems: 1000
          title: Nodeids
        status:
          $ref: '#/components/schemas/InventoryNodeAssignmentStatusEnum'
          default: PLANNED
        type:
          $ref: '#/components/schemas/InventoryNodeAssignmentTypeEnum'
          default: STANDARD
        isController:
          type: boolean
          title: Iscontroller
          default: false
        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
      required:
        - nodeIds
      title: AssignmentCreateRequest
      description: Assign one or more nodes (`node_ids`) to a cluster with shared attrs.
    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
    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.
    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
    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

````