---
title: "Update a subnet"
method: PUT
path: "/api/v1/subnets/{id}"
tags: ["Subnets"]
---

# Update a subnet

`PUT /api/v1/subnets/{id}`

Updates subnet properties. If the CIDR is being changed, validates that
all existing ip_addresses on this subnet have IPs within the new CIDR range.

## Path parameters

- `id` string, uuid, required

## Request body

- Subnet
  - `cidr` string, required
  - `description` string, nullable
  - `name` string, required
  - `network_id` string, uuid, required
  - `source` union, required
    - object
      - `type` 'Manual', required
    - object
      - `type` 'System', required
    - object
      - `metadata` DiscoveryMetadata[], required
        - union
          - object
            - `host_id` string, uuid, required
            - `type` 'SelfReport', required
            - `daemon_id` string, uuid, required
            - `date` string, date-time, required
          - object
            - `host_naming_fallback` 'Ip' | 'BestService', required
            - `snmp_credentials` object — SNMP credentials for querying devices during discovery Server builds this mapping before initiating discovery
            - `subnet_ids` string[], nullable, required
            - `type` 'Network', required
            - `daemon_id` string, uuid, required
            - `date` string, date-time, required
          - object
            - `host_id` string, uuid, required
            - `host_naming_fallback` 'Ip' | 'BestService', required
            - `type` 'Docker', required
            - `daemon_id` string, uuid, required
            - `date` string, date-time, required
          - object
            - `host_id` string, uuid, required — ID of the host that the daemon is running on
            - `host_naming_fallback` 'Ip' | 'BestService', required
            - `scan_settings` ScanSettings — Scan performance settings. Lives on the discovery entity. Numeric fields are `Option<T>` — `None` means "use daemon default". The daemon unwraps with defaults at point of use.
              - …
            - `subnet_ids` string[], nullable, required — Subnets to scan. None = scan all interfaced subnets.
            - `type` 'Unified', required
            - `daemon_id` string, uuid, required
            - `date` string, date-time, required
      - `type` 'Discovery', required
    - object
      - `details` MatchDetails, required
        - `confidence` 'NotApplicable' | 'Low' | 'Medium' | 'High' | 'Certain', required
        - `reason` union, required — Match reason - either a simple reason string or a container with nested reasons
          - object
            - `data` string, required
            - `type` 'reason', required
          - object
            - `data` unknown[], required — Tuple of [name: string, children: MatchReason[]]
              - …
            - `type` 'container', required
      - `metadata` DiscoveryMetadata[], required
        - union
          - object
            - `host_id` string, uuid, required
            - `type` 'SelfReport', required
            - `daemon_id` string, uuid, required
            - `date` string, date-time, required
          - object
            - `host_naming_fallback` 'Ip' | 'BestService', required
            - `snmp_credentials` object — SNMP credentials for querying devices during discovery Server builds this mapping before initiating discovery
            - `subnet_ids` string[], nullable, required
            - `type` 'Network', required
            - `daemon_id` string, uuid, required
            - `date` string, date-time, required
          - object
            - `host_id` string, uuid, required
            - `host_naming_fallback` 'Ip' | 'BestService', required
            - `type` 'Docker', required
            - `daemon_id` string, uuid, required
            - `date` string, date-time, required
          - object
            - `host_id` string, uuid, required — ID of the host that the daemon is running on
            - `host_naming_fallback` 'Ip' | 'BestService', required
            - `scan_settings` ScanSettings — Scan performance settings. Lives on the discovery entity. Numeric fields are `Option<T>` — `None` means "use daemon default". The daemon unwraps with defaults at point of use.
              - …
            - `subnet_ids` string[], nullable, required — Subnets to scan. None = scan all interfaced subnets.
            - `type` 'Unified', required
            - `daemon_id` string, uuid, required
            - `date` string, date-time, required
      - `type` 'DiscoveryWithMatch', required
    - object
      - `type` 'Unknown', required
  - `subnet_type` 'Internet' | 'Remote' | 'Gateway' | 'VpnTunnel' | 'Dmz' | 'Lan' | 'WiFi' | 'IoT' | 'Guest' | 'DockerBridge' | 'MacVlan' | 'IpVlan' | 'Management' | 'Storage' | 'Loopback' | 'Unknown', required
  - `tags` string[], required
  - `virtualization` SubnetVirtualization — Docker bridge network — host-scoped, same CIDR on different hosts are distinct subnets.
    - `service_id` string, uuid, required — The Docker daemon service that owns this bridge network. Different Docker daemons on different hosts = distinct bridge subnets.
    - `type` 'Docker', required
  - `created_at` string, date-time, required
  - `id` string, uuid, required
  - `updated_at` string, date-time, required

## Response `200`

Subnet updated

- ApiResponseSubnet
  - `data` object
    - `cidr` string, required
    - `description` string, nullable
    - `name` string, required
    - `network_id` string, uuid, required
    - `source` union, required
      - object
        - `type` 'Manual', required
      - object
        - `type` 'System', required
      - object
        - `metadata` DiscoveryMetadata[], required
          - union
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
        - `type` 'Discovery', required
      - object
        - `details` MatchDetails, required
          - `confidence` 'NotApplicable' | 'Low' | 'Medium' | 'High' | 'Certain', required
          - `reason` union, required — Match reason - either a simple reason string or a container with nested reasons
            - object
              - …
            - object
              - …
        - `metadata` DiscoveryMetadata[], required
          - union
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
        - `type` 'DiscoveryWithMatch', required
      - object
        - `type` 'Unknown', required
    - `subnet_type` 'Internet' | 'Remote' | 'Gateway' | 'VpnTunnel' | 'Dmz' | 'Lan' | 'WiFi' | 'IoT' | 'Guest' | 'DockerBridge' | 'MacVlan' | 'IpVlan' | 'Management' | 'Storage' | 'Loopback' | 'Unknown', required
    - `tags` string[], required
    - `virtualization` SubnetVirtualization — Docker bridge network — host-scoped, same CIDR on different hosts are distinct subnets.
      - `service_id` string, uuid, required — The Docker daemon service that owns this bridge network. Different Docker daemons on different hosts = distinct bridge subnets.
      - `type` 'Docker', required
    - `created_at` string, date-time, required
    - `id` string, uuid, required
    - `updated_at` string, date-time, required
  - `error` string, nullable
  - `meta` ApiMeta, required — API metadata included in all responses
    - `api_version` integer, required — API version (integer, increments on breaking changes)
    - `server_version` string, required — Server version (semver)
  - `success` boolean, required

## Other responses

- `400` — CIDR change would orphan existing ip_addresses
- `404` — Subnet not found

## Changes

- **2026-04-20** `f04499e2280f` — 4 breaking, 6 warning, 4 info
  - added the new required request property `allOf[#/components/schemas/SubnetBase]/source/oneOf[subschema #3: Discovery]/metadata`
  - added the new required request property `allOf[#/components/schemas/SubnetBase]/source/oneOf[subschema #4: DiscoveryWithMatch]/metadata`
  - removed the enum value `PodmanBridge` of the request property `allOf[#/components/schemas/SubnetBase]/subnet_type`
  - removed `subschema #2: Podman` from the `allOf[#/components/schemas/SubnetBase]/virtualization/oneOf[#/components/schemas/SubnetVirtualization]/` request property `oneOf` list
  - …10 more

[Change history](https://skmtc.dev/scanopy/apis/scanopy-api/changes/api/v1/subnets/:id/put.md)

---

[API](https://skmtc.dev/scanopy/apis/scanopy-api.md) · [All operations](https://skmtc.dev/scanopy/apis/scanopy-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/scanopy/scanopy-api/revisions/f04499e2280f/schema)
