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

# Sync a device firmware policy cache (internal)

> Replace one Device's current NetBox firmware policy cache state.



## OpenAPI

````yaml /openapi/fleet-manager-openapi.yaml post /api/v1/devices/{id}/firmware-policy-cache/
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/devices/{id}/firmware-policy-cache/:
    post:
      tags:
        - Devices
      summary: Sync a device firmware policy cache (internal)
      description: Replace one Device's current NetBox firmware policy cache state.
      operationId: api_v1_devices_firmware_policy_cache_create
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          description: A UUID string identifying this device.
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeviceFirmwarePolicyCacheRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DeviceFirmwarePolicyCacheRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DeviceFirmwarePolicyCacheRequest'
        required: true
      responses:
        '204':
          description: No response body
        '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'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - oauth2:
            - firmware-policy-cache:write
components:
  schemas:
    DeviceFirmwarePolicyCacheRequest:
      type: object
      description: One flat command that replaces a device's current policy-cache state.
      properties:
        netbox_device_id:
          type: integer
          minimum: 1
        fetched_at:
          type: string
          format: date-time
        freshness_deadline:
          type: string
          format: date-time
        netbox_last_updated_marker:
          type: string
          maxLength: 128
        blob_size_bytes:
          type: integer
          maximum: 2147483647
          minimum: 0
        outcome:
          $ref: '#/components/schemas/FirmwarePolicyCacheOutcomeEnum'
        policy:
          allOf:
            - $ref: '#/components/schemas/FirmwarePolicyCachePolicy'
          nullable: true
        error_code:
          allOf:
            - $ref: '#/components/schemas/FirmwarePolicyValidationErrorCodeEnum'
          nullable: true
        error_detail:
          type: string
          nullable: true
          maxLength: 2048
        policy_id:
          type: string
          nullable: true
          maxLength: 128
        schema_version:
          type: string
          nullable: true
          maxLength: 32
      required:
        - blob_size_bytes
        - fetched_at
        - freshness_deadline
        - netbox_device_id
        - netbox_last_updated_marker
        - outcome
    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'
    FirmwarePolicyCacheOutcomeEnum:
      type: string
      enum:
        - valid
        - rejected
    FirmwarePolicyCachePolicy:
      type: object
      description: Typed valid-policy branch of a cache sync command.
      properties:
        digest_contract:
          $ref: '#/components/schemas/FirmwarePolicyDigestContractEnum'
        canonical_payload_digest:
          type: string
          pattern: ^[a-f0-9]{64}$
        raw_content_hash:
          type: string
          pattern: ^[a-f0-9]{64}$
        raw_payload:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
        policy_id:
          type: string
          maxLength: 128
        schema_version:
          type: string
          maxLength: 32
        rack_type:
          type: string
          nullable: true
          maxLength: 64
        topology_kind:
          $ref: '#/components/schemas/FirmwarePolicyTopologyKindEnum'
      required:
        - canonical_payload_digest
        - digest_contract
        - policy_id
        - raw_content_hash
        - raw_payload
        - schema_version
        - topology_kind
    FirmwarePolicyValidationErrorCodeEnum:
      type: string
      enum:
        - missing_policy
        - unsupported_schema
        - parse_error
        - oversized_blob
        - missing_source_metadata
        - applicability_conflict
        - stale_source
    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
    FirmwarePolicyDigestContractEnum:
      type: string
      enum:
        - jcs-sha256-v1
    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'
    FirmwarePolicyTopologyKindEnum:
      type: string
      enum:
        - nvlink_fabric_domain
        - standalone_node
        - cpu_node
  securitySchemes:
    oauth2:
      type: oauth2
      flows: {}

````

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