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

# Update device

> Update device settings including name, auto-assignment, status, or Portainer configuration



## OpenAPI

````yaml /api-spec.json patch /core/devices/{device_id}
openapi: 3.0.0
info:
  contact:
    name: Acusight API Support
  description: >-
    Acusight platform API - custom endpoints + Portainer proxy routes for edge
    AI deployments
  title: Acusight API
  version: 1.0.0
servers:
  - url: https://acusight.io/api
    description: AcuSight Cloud (hosted)
security: []
tags:
  - name: Devices & provisioning
    description: Register, provision, and manage edge devices and their agents.
  - name: Virtual devices
    description: Create and drive simulated devices for testing and demos.
  - name: Alerts & telemetry
    description: Model alerts, alert rules, and product telemetry.
  - name: Organization
    description: Organization-level settings.
  - name: Datasets & data
    description: Projects, batches, datasets, images, annotations, and drift.
  - name: Models & training
    description: Model registry, training jobs, exports, and inference.
  - name: Pipeline data
    description: Detection time-series and aggregated pipeline analytics.
paths:
  /core/devices/{device_id}:
    patch:
      tags:
        - Devices & provisioning
      summary: Update device
      description: >-
        Update device settings including name, auto-assignment, status, or
        Portainer configuration
      parameters:
        - description: Device ID
          in: path
          name: device_id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/types.DeviceUpdateRequest'
        description: Device update payload
        required: true
      responses:
        '200':
          description: Updated device
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.Device'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
        '404':
          description: Device or project not found
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
      security:
        - BearerAuth: []
components:
  schemas:
    types.DeviceUpdateRequest:
      properties:
        auto_assign_to:
          type: integer
        compose_file_path:
          description: Path to docker-compose.yml
          type: string
        edge_key:
          type: string
        hls_port:
          description: 'MediaMTX HLS port (default: 8888)'
          type: integer
        ip_address:
          description: Network configuration for live streaming (WebRTC)
          type: string
        name:
          type: string
        portainer_endpoint_id:
          type: integer
        status:
          type: string
        stream_path:
          description: 'Stream path on MediaMTX (default: "sp")'
          type: string
        watchman_port:
          description: Edge service configuration (auto-discovered or manual override)
          type: integer
        webrtc_port:
          description: 'MediaMTX WebRTC port (default: 8889)'
          type: integer
      type: object
    models.Device:
      properties:
        auto_assign_project:
          $ref: '#/components/schemas/models.Project'
        auto_assign_to:
          description: Auto-assign to ProjectID
          type: integer
        compose_file_path:
          description: Path to docker-compose.yml on device
          type: string
        config_last_sync:
          description: When config was last extracted
          type: string
        created_at:
          type: string
        deployed_model_version_id:
          description: Currently deployed model (FK to ml_model_versions)
          type: integer
        deployed_via_alias:
          description: >-
            How this device was deployed: "champion", "canary", "challenger", or
            NULL
          type: string
        device_id:
          description: Docker daemon ID from 'docker system info'
          type: string
        device_type:
          description: '"physical" | "virtual"'
          type: string
        edge_key:
          description: Temporary storage for Portainer edge key (cleared after deployment)
          type: string
        hls_port:
          description: 'MediaMTX HLS port (default: 8888)'
          type: integer
        id:
          type: integer
        ip_address:
          description: Network configuration for live streaming (WebRTC)
          type: string
        last_seen:
          description: Heartbeat and model tracking
          type: string
        last_snapshot_at:
          description: Timestamp of most recent snapshot upload
          type: string
        name:
          type: string
        next_batch_number:
          description: Sequential numbering
          type: integer
        organization:
          allOf:
            - $ref: '#/components/schemas/models.Organization'
          description: Relationships
        organization_id:
          description: Multi-tenant fields
          type: string
        portainer_endpoint_id:
          description: Links to Portainer endpoint
          type: integer
        provisioned_at:
          description: When device was provisioned via token
          type: string
        provisioned_by:
          description: Token ID that provisioned this device
          type: string
        status:
          description: pending, approved, deployed, rejected
          type: string
        stream_path:
          description: 'Stream path on MediaMTX (default: "sp")'
          type: string
        updated_at:
          type: string
        virtual_device_config:
          $ref: '#/components/schemas/models.VirtualDeviceConfig'
        watchman_port:
          description: Edge service configuration (auto-discovered or manual override)
          type: integer
        webrtc_port:
          description: 'MediaMTX WebRTC port (default: 8889)'
          type: integer
      type: object
    models.Project:
      properties:
        batches:
          description: Relationships
          items:
            $ref: '#/components/schemas/models.Batch'
          type: array
        classes:
          items:
            $ref: '#/components/schemas/models.Class'
          type: array
        created_at:
          type: string
        description:
          type: string
        id:
          type: integer
        name:
          type: string
        organization_id:
          type: string
        project_type:
          description: '"object_detection", "instance_segmentation"'
          type: string
        updated_at:
          type: string
        versions:
          items:
            $ref: '#/components/schemas/models.DatasetVersion'
          type: array
      type: object
    models.Organization:
      properties:
        created_at:
          type: string
        external_id:
          description: Zitadel organization ID
          type: string
        id:
          type: string
        name:
          type: string
        settings:
          description: Org-level config
          type: string
        slug:
          description: URL-safe identifier
          type: string
        updated_at:
          type: string
      type: object
    models.VirtualDeviceConfig:
      properties:
        active_track_count:
          description: Current active tracks (event mode)
          type: integer
        batch_size:
          description: Images per batch (image mode)
          type: integer
        created_at:
          type: string
        current_image_index:
          description: Current position in dataset
          type: integer
        dataset_format:
          description: '"yolo" | "coco" | "voc"'
          type: string
        dataset_path:
          description: Path to YOLO dataset directory (filesystem)
          type: string
        dataset_version_id:
          description: >-
            Image upload parameters (for "image" and "hybrid" modes)

            Either DatasetVersionID (for API-based) or DatasetPath (for
            filesystem-based)
          type: integer
        device_id:
          description: FK to Device.DeviceID
          type: string
        event_frequency:
          description: Event generation parameters (for "event" and "hybrid" modes)
          type: integer
        event_types:
          description: JSON array of event type configs
          type: string
        id:
          type: integer
        loop:
          description: Loop when dataset ends
          type: boolean
        max_concurrent_tracks:
          description: Max simultaneous tracks
          type: integer
        random_order:
          description: Randomize image order (image mode)
          type: boolean
        simulation_mode:
          description: Mode configuration - "event", "image", or "hybrid"
          type: string
        simulation_status:
          description: Simulation state
          type: string
        total_events_sent:
          description: Total events generated (event mode)
          type: integer
        total_images:
          description: Total images in dataset
          type: integer
        total_images_uploaded:
          description: Total images uploaded (image mode)
          type: integer
        track_max_duration:
          description: Max track duration in seconds
          type: integer
        track_min_duration:
          description: Min track duration in seconds
          type: integer
        updated_at:
          type: string
        upload_frequency:
          description: Simulation parameters (shared)
          type: integer
      type: object
    models.Batch:
      properties:
        created_at:
          type: string
        device_id:
          description: Docker daemon ID from edge device
          type: string
        id:
          type: integer
        images:
          items:
            $ref: '#/components/schemas/models.Image'
          type: array
        last_image_received_at:
          type: string
        name:
          type: string
        organization_id:
          type: string
        project:
          allOf:
            - $ref: '#/components/schemas/models.Project'
          description: Relationships
        project_id:
          description: NULL = raw pool, assigned = in project
          type: integer
        source:
          description: '"edge", "upload"'
          type: string
        stage:
          description: '"unassigned", "annotating", "dataset"'
          type: string
        status:
          description: Batch completion tracking
          type: string
        tags:
          items:
            type: string
          type: array
        updated_at:
          type: string
      type: object
    models.Class:
      properties:
        color:
          type: string
        created_at:
          type: string
        id:
          type: integer
        name:
          description: Human-readable name from data.yaml or defaults to raw_value
          type: string
        project:
          allOf:
            - $ref: '#/components/schemas/models.Project'
          description: Relationships
        project_id:
          type: integer
        raw_value:
          description: Original YOLO index ("0", "1", "2")
          type: string
        updated_at:
          type: string
      type: object
    models.DatasetVersion:
      properties:
        created_at:
          type: string
        id:
          type: integer
        name:
          type: string
        pipeline_config:
          description: >-
            PipelineConfig captures the preprocessing/augmentation pipeline that
            produced this version.
          items:
            type: integer
          type: array
        project:
          allOf:
            - $ref: '#/components/schemas/models.Project'
          description: Relationships
        project_id:
          type: integer
        updated_at:
          type: string
        version:
          type: integer
        version_annotations:
          items:
            $ref: '#/components/schemas/models.VersionAnnotation'
          type: array
        version_batches:
          items:
            $ref: '#/components/schemas/models.VersionBatch'
          type: array
        version_classes:
          items:
            $ref: '#/components/schemas/models.VersionClass'
          type: array
        version_images:
          items:
            $ref: '#/components/schemas/models.VersionImage'
          type: array
      type: object
    models.Image:
      properties:
        annotation_status:
          description: '"pending", "completed"'
          type: string
        annotations:
          items:
            $ref: '#/components/schemas/models.Annotation'
          type: array
        batch:
          allOf:
            - $ref: '#/components/schemas/models.Batch'
          description: Relationships
        batch_id:
          type: integer
        created_at:
          type: string
        device_id:
          description: Source device (inherited from batch)
          type: string
        filename:
          type: string
        height:
          type: integer
        id:
          type: integer
        split:
          description: >-
            Working dataset split assignment (nullable until assigned): "train",
            "val", "test"
          type: string
        split_locked:
          type: boolean
        storage_key:
          description: MinIO path
          type: string
        updated_at:
          type: string
        width:
          type: integer
      type: object
    models.VersionAnnotation:
      properties:
        geometry:
          items:
            type: integer
          type: array
        height:
          type: number
        id:
          type: integer
        original_annotation:
          $ref: '#/components/schemas/models.Annotation'
        original_annotation_id:
          type: integer
        type:
          type: string
        version:
          $ref: '#/components/schemas/models.DatasetVersion'
        version_class_value:
          type: string
        version_id:
          type: integer
        version_image:
          $ref: '#/components/schemas/models.VersionImage'
        version_image_id:
          type: integer
        width:
          type: number
        x_center:
          type: number
        y_center:
          type: number
      type: object
    models.VersionBatch:
      properties:
        id:
          type: integer
        images:
          items:
            $ref: '#/components/schemas/models.VersionImage'
          type: array
        name:
          type: string
        original_batch:
          $ref: '#/components/schemas/models.Batch'
        original_batch_id:
          description: Nullable for provenance only
          type: integer
        project_id:
          type: integer
        version:
          $ref: '#/components/schemas/models.DatasetVersion'
        version_id:
          type: integer
      type: object
    models.VersionClass:
      properties:
        color:
          type: string
        id:
          type: integer
        name:
          description: Effective name (possibly renamed)
          type: string
        original_class:
          $ref: '#/components/schemas/models.Class'
        original_class_id:
          type: integer
        raw_value:
          description: Preserved YOLO index
          type: string
        version:
          $ref: '#/components/schemas/models.DatasetVersion'
        version_id:
          type: integer
      type: object
    models.VersionImage:
      properties:
        annotations:
          items:
            $ref: '#/components/schemas/models.VersionAnnotation'
          type: array
        filename:
          type: string
        height:
          type: integer
        id:
          type: integer
        original_image:
          $ref: '#/components/schemas/models.Image'
        original_image_id:
          description: Nullable for provenance only
          type: integer
        split:
          type: string
        storage_key:
          type: string
        version:
          $ref: '#/components/schemas/models.DatasetVersion'
        version_batch:
          $ref: '#/components/schemas/models.VersionBatch'
        version_batch_id:
          type: integer
        version_id:
          type: integer
        width:
          type: integer
      type: object
    models.Annotation:
      properties:
        class_value:
          description: Store class value (no project binding)
          type: string
        confidence:
          description: Optional confidence score (0.0-1.0)
          type: number
        created_at:
          type: string
        geometry:
          description: For polygon/point
          items:
            type: integer
          type: array
        height:
          type: number
        id:
          type: integer
        image_id:
          type: integer
        model_id:
          description: Model provenance tracking (for edge/auto annotations)
          type: string
        model_name:
          description: Name of model (e.g., "yolov8n-v2")
          type: string
        model_version:
          description: Version of model (e.g., "2.1.0")
          type: string
        source:
          description: Source and verification tracking
          type: string
        type:
          description: Always "bbox" (unified type)
          type: string
        updated_at:
          type: string
        width:
          type: number
        x_center:
          description: YOLO format coordinates (all stored as normalized values 0.0-1.0)
          type: number
        y_center:
          type: number
        z_order:
          description: >-
            ZOrder controls rendering order (0 = back, higher = front). Nullable
            for legacy rows.
          type: integer
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT access token. Paste the token only; the Bearer prefix is added
        automatically.

````