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

# Create pipeline

> Create a new video processing pipeline on an edge device



## OpenAPI

````yaml /api-spec.json post /core/devices/{device_id}/pipelines
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}/pipelines:
    post:
      tags:
        - Devices & provisioning
      summary: Create pipeline
      description: Create a new video processing pipeline on an edge device
      parameters:
        - description: Device ID
          in: path
          name: device_id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/types.PipelineCreateRequest'
        description: Pipeline creation payload
        required: true
      responses:
        '201':
          description: Created pipeline
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.Pipeline'
        '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.PipelineCreateRequest:
      properties:
        auto_assign_to:
          type: integer
        config:
          items:
            type: integer
          type: array
        description:
          type: string
        hls_port:
          type: integer
        name:
          type: string
        stream_path:
          type: string
        video_source_type:
          enum:
            - STREAM
            - FILE
            - CAMERA
          type: string
        video_source_url:
          type: string
        webrtc_port:
          type: integer
      required:
        - name
      type: object
    core.Pipeline:
      properties:
        auto_assign_to:
          description: >-
            Per-pipeline data tracking (moved from Device for multi-pipeline
            support)
          type: integer
        config:
          description: Full streamproc pipeline config
          items:
            type: integer
          type: array
        config_synced_at:
          type: string
        created_at:
          type: string
        current_config:
          description: >-
            Config sync (desired-state reconciliation, mirrors model deployment
            pattern)
          items:
            type: integer
          type: array
        current_topology:
          items:
            type: integer
          type: array
        description:
          type: string
        desired_config:
          items:
            type: integer
          type: array
        device:
          allOf:
            - $ref: '#/components/schemas/core.Device'
          description: Relationships
        device_id:
          description: FK to Device.DeviceID
          type: string
        hls_port:
          description: MediaMTX HLS port
          type: integer
        id:
          type: integer
        last_snapshot_at:
          description: Most recent snapshot upload
          type: string
        name:
          type: string
        organization_id:
          description: Denormalized from device for query perf
          type: string
        pipeline_id:
          type: string
        running_model_version_id:
          description: Actual state — reported by agent
          type: integer
        status:
          description: '"active", "stopped", "error"'
          type: string
        stream_path:
          description: Per-pipeline live streaming config
          type: string
        target_model_version_id:
          description: Desired state — set on deploy
          type: integer
        updated_at:
          type: string
        video_source_type:
          description: '"STREAM", "FILE", "CAMERA"'
          type: string
        video_source_url:
          description: Video source configuration
          type: string
        webrtc_port:
          description: MediaMTX WebRTC port
          type: integer
      type: object
    core.Device:
      properties:
        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
        device_id:
          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: Edge service configuration (auto-discovered or manual override)
          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
        organization_id:
          description: Multi-tenant fields
          type: string
        pipelines:
          items:
            $ref: '#/components/schemas/core.Pipeline'
          type: array
        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
        running_model:
          $ref: '#/components/schemas/ml.ModelVersion'
        running_model_version_id:
          description: Actual state — reported by agent
          type: integer
        status:
          description: pending, approved, deployed, rejected
          type: string
        stream_path:
          description: 'Stream path on MediaMTX (default: "sp")'
          type: string
        target_model:
          $ref: '#/components/schemas/ml.ModelVersion'
        target_model_version_id:
          description: Desired state — set on deploy
          type: integer
        updated_at:
          type: string
        virtual_device_config:
          allOf:
            - $ref: '#/components/schemas/core.VirtualDeviceConfig'
          description: Relationships
        webrtc_port:
          description: 'MediaMTX WebRTC port (default: 8889)'
          type: integer
      type: object
    ml.ModelVersion:
      properties:
        alias:
          description: Model metadata
          type: string
        archived_at:
          description: Soft archive
          type: string
        artifact_uri:
          description: >-
            Artifact Storage - Full S3 URI to the model file (e.g.,
            s3://acusight-data/ml-artifacts/.../best.pt)

            Stored at creation time to avoid external lookups during deployment
          type: string
        class_labels:
          description: >-
            ClassLabels: ordered class names for uploaded (dataset-less) models.

            Array index = model output class index. NULL for trained models

            (version_id > 0), whose labels come from data.version_classes.

            The chk_one_label_source CHECK enforces version_id = 0 OR
            class_labels IS NULL.
          items:
            type: integer
          type: array
        created_at:
          description: Timestamps
          type: string
        display_name:
          description: Human-readable identifiers
          type: string
        format:
          description: 'Format of the model artifact: pt, onnx, tflite, synap, bin'
          type: string
        framework:
          type: string
        id:
          type: integer
        is_reference:
          description: >-
            Reference Flag: If true, this is a link to a global model
            (ProjectID=0) used in this project
          type: boolean
        model_type:
          type: string
        project_id:
          description: Foreign keys
          type: integer
        source_model_version_id:
          description: >-
            Export provenance — NULL = original trained model, non-NULL =
            exported from another version.

            Used in handler query filter: WHERE source_model_version_id IS NULL
          type: integer
        updated_at:
          type: string
        version:
          description: Auto-increment version number per project
          type: integer
        version_id:
          description: |-
            VersionID: One model per dataset version (enforced by unique index)
            version_id=0 is reserved for versionless uploaded models and exports
          type: integer
      type: object
    core.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
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT access token. Paste the token only; the Bearer prefix is added
        automatically.

````