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

# Upsert device inventory projection (internal)

> Internal upsert and replay endpoint for inventory device projections.



## OpenAPI

````yaml /openapi/fleet-manager-openapi.yaml post /api/v1/inventory/device-projections/
openapi: 3.0.3
info:
  title: Fleet Manager API
  version: 1.0.0
  description: API for the Nscale Fleet Manager
servers: []
security: []
paths:
  /api/v1/inventory/device-projections/:
    post:
      tags:
        - Inventory
      summary: Upsert device inventory projection (internal)
      description: Internal upsert and replay endpoint for inventory device projections.
      operationId: api_v1_inventory_device_projections_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InventoryProjectionUpsert'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/InventoryProjectionUpsert'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/InventoryProjectionUpsert'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InventoryProjectionUpsertResponse'
          description: ''
        '400':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication credentials were not provided or are invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: You do not have permission to perform this action.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: The NetBox device matches more than one device.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: The device kind is not supported.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - oauth2:
            - inventory:write
        - cookieAuth: []
components:
  schemas:
    InventoryProjectionUpsert:
      type: object
      description: >-
        Write contract for the inventory projection upsert endpoint.


        ``netbox_id`` is the lookup key the server resolves to a Fleet Manager

        device. ``custom_fields`` carries raw NetBox custom-field values (the
        read

        API stringifies them); the write contract preserves them as-is.
      properties:
        netbox_id:
          type: integer
          minimum: 1
        bmc_ip:
          type: string
          nullable: true
        asset_tag:
          type: string
          default: ''
        description:
          type: string
          default: ''
        custom_fields:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
        site_netbox_id:
          type: integer
          minimum: 1
          nullable: true
        primary_ip:
          type: string
          nullable: true
        device_type_part_number:
          type: string
          nullable: true
        device_type_u_height:
          type: number
          format: double
          nullable: true
        site_description:
          type: string
          nullable: true
        site_region:
          type: string
          nullable: true
        site_syslog_server:
          type: string
          nullable: true
        fru:
          type: array
          items:
            $ref: '#/components/schemas/FruComponent'
        interfaces:
          type: array
          items:
            $ref: '#/components/schemas/Interface'
          nullable: true
        source_updated_at:
          type: string
          format: date-time
      required:
        - netbox_id
        - source_updated_at
    InventoryProjectionUpsertResponse:
      type: object
      description: Response contract for a projection upsert.
      properties:
        device_id:
          type: string
          format: uuid
        changed:
          type: boolean
        content_hash:
          type: string
        last_synced_at:
          type: string
          format: date-time
        device_updated_at:
          type: string
          format: date-time
      required:
        - changed
        - content_hash
        - device_id
        - device_updated_at
        - last_synced_at
    ErrorResponse:
      type: object
      description: >-
        Uniform error body for every 4xx/5xx response. `detail` is a
        human-readable message, always present, safe to display to end users.
        `code` is the machine-readable identifier. `field_errors` lists
        per-input-field validation messages and is empty for non-field errors
        (auth, permission, not-found, conflict, server).
      required:
        - detail
        - code
        - field_errors
      properties:
        detail:
          type: string
        code:
          $ref: '#/components/schemas/ErrorCodeEnum'
        field_errors:
          type: array
          items:
            $ref: '#/components/schemas/FieldError'
    JsonValue:
      description: Any JSON value.
      nullable: true
      anyOf:
        - type: string
        - type: number
        - type: integer
        - type: boolean
        - type: array
          items:
            $ref: '#/components/schemas/JsonValue'
        - type: object
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
    FruComponent:
      type: object
      description: >-
        One field-replaceable-unit component sourced from a NetBox module.


        ``serial_number`` is the FRU identity (always present — the ingest
        categorizer

        drops modules with no serial). ``part_number`` feeds Borneo memory FRU
        and

        ``model_number`` feeds Borneo disk FRU; both are null for categories
        that do

        not carry them.
      properties:
        category:
          $ref: '#/components/schemas/FruComponentCategoryEnum'
        serial_number:
          type: string
        part_number:
          type: string
          nullable: true
        model_number:
          type: string
          nullable: true
      required:
        - category
        - serial_number
    Interface:
      type: object
      description: Serializer for Interface model.
      properties:
        ip_addresses:
          type: array
          items:
            type: string
        name:
          type: string
          maxLength: 50
        type:
          type: string
          maxLength: 50
        type_display:
          type: string
          maxLength: 50
        mac_address:
          type: string
          nullable: true
          maxLength: 17
        ib_device_guid:
          type: string
          nullable: true
          maxLength: 16
      required:
        - name
        - type
        - type_display
    ErrorCodeEnum:
      type: string
      description: >-
        Stable machine-readable error identifier. New members may be added
        within this API version; clients must tolerate unknown values.
      enum:
        - error
        - invalid
        - parse_error
        - authentication_failed
        - not_authenticated
        - permission_denied
        - not_found
        - method_not_allowed
        - not_acceptable
        - unsupported_media_type
        - conflict
        - enrollment_infrastructure_reference_pending
        - enrollment_infrastructure_reference_changed
        - unprocessable_entity
        - throttled
        - service_unavailable
    FieldError:
      type: object
      description: One input field's validation messages.
      required:
        - field
        - messages
      properties:
        field:
          type: string
          description: >-
            Dotted path to the offending input field, or to the collection row
            when the whole row is invalid (e.g. `filters.end_date`,
            `memberships.0.role`, `memberships.0`).
        messages:
          type: array
          minItems: 1
          items:
            type: string
    FruComponentCategoryEnum:
      enum:
        - cpu
        - gpu
        - disk
        - nic
        - memory
      type: string
      description: |-
        * `cpu` - cpu
        * `gpu` - gpu
        * `disk` - disk
        * `nic` - nic
        * `memory` - memory
  securitySchemes:
    oauth2:
      type: oauth2
      flows: {}
    cookieAuth:
      type: apiKey
      in: cookie
      name: sessionid

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.