---
title: "Create a new subnet"
method: POST
path: "/api/v1/subnets"
tags: ["Subnets"]
---

# Create a new subnet

`POST /api/v1/subnets`

## 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
      - `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
      - `type` 'DiscoveryWithMatch', required
    - object
      - `type` 'Unknown', required
  - `subnet_type` 'Internet' | 'Remote' | 'Gateway' | 'VpnTunnel' | 'Dmz' | 'Lan' | 'WiFi' | 'IoT' | 'Guest' | 'DockerBridge' | 'PodmanBridge' | 'MacVlan' | 'IpVlan' | 'Management' | 'Storage' | 'Loopback' | 'Unknown', required
  - `tags` string[], required
  - `virtualization` union — Virtualization metadata for subnets that belong to a virtual infrastructure. Consistent with HostVirtualization and ServiceVirtualization patterns. Points to the service that provides the virtualization (e.g., Docker daemon).
    - object — 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
    - object — Podman bridge network — host-scoped like Docker; same CIDR on different daemons are distinct subnets.
      - `service_id` string, uuid, required — The Podman daemon service that owns this bridge network. Different Podman daemons on different hosts = distinct bridge subnets.
      - `type` 'Podman', required
  - `created_at` string, date-time, required
  - `first_discovery_id` string, uuid, nullable
  - `id` string, uuid, required
  - `last_discovery_id` string, uuid, nullable
  - `last_seen_at` string, date-time
  - `lineage_id` string, uuid, nullable
  - `updated_at` string, date-time, required
  - `valid_from` string, date-time
  - `valid_to` string, date-time, nullable

## Response `200`

Subnet created successfully

- 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
        - `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
              - …
        - `type` 'DiscoveryWithMatch', required
      - object
        - `type` 'Unknown', required
    - `subnet_type` 'Internet' | 'Remote' | 'Gateway' | 'VpnTunnel' | 'Dmz' | 'Lan' | 'WiFi' | 'IoT' | 'Guest' | 'DockerBridge' | 'PodmanBridge' | 'MacVlan' | 'IpVlan' | 'Management' | 'Storage' | 'Loopback' | 'Unknown', required
    - `tags` string[], required
    - `virtualization` union — Virtualization metadata for subnets that belong to a virtual infrastructure. Consistent with HostVirtualization and ServiceVirtualization patterns. Points to the service that provides the virtualization (e.g., Docker daemon).
      - object — 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
      - object — Podman bridge network — host-scoped like Docker; same CIDR on different daemons are distinct subnets.
        - `service_id` string, uuid, required — The Podman daemon service that owns this bridge network. Different Podman daemons on different hosts = distinct bridge subnets.
        - `type` 'Podman', required
    - `created_at` string, date-time, required
    - `first_discovery_id` string, uuid, nullable
    - `id` string, uuid, required
    - `last_discovery_id` string, uuid, nullable
    - `last_seen_at` string, date-time
    - `lineage_id` string, uuid, nullable
    - `updated_at` string, date-time, required
    - `valid_from` string, date-time
    - `valid_to` string, date-time, nullable
  - `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` — Invalid request

## Changes

- **2026-06-26** `027b5ba88c2b` — 1 breaking, 1 warning, 2 info
  - added `subschema #2: Podman` to the `data/allOf[#/components/schemas/SubnetBase]/virtualization/oneOf[#/components/schemas/SubnetVirtualization]/` response property `oneOf` list for the response status `200`
  - added the new `PodmanBridge` enum value to the `data/allOf[#/components/schemas/SubnetBase]/subnet_type` response property for the response status `200`
  - added the new `PodmanBridge` enum value to the request property `allOf[#/components/schemas/SubnetBase]/subnet_type`
  - added `subschema #2: Podman` to the `allOf[#/components/schemas/SubnetBase]/virtualization/oneOf[#/components/schemas/SubnetVirtualization]/` request property `oneOf` list
- **2026-05-03** `d38c20597ec1` — 2 breaking, 2 warning, 6 info
  - removed the required property `data/allOf[#/components/schemas/SubnetBase]/source/oneOf[subschema #3: Discovery]/metadata` from the response with the `200` status
  - removed the required property `data/allOf[#/components/schemas/SubnetBase]/source/oneOf[subschema #4: DiscoveryWithMatch]/metadata` from the response with the `200` status
  - removed the request property `allOf[#/components/schemas/SubnetBase]/source/oneOf[subschema #3: Discovery]/metadata`
  - removed the request property `allOf[#/components/schemas/SubnetBase]/source/oneOf[subschema #4: DiscoveryWithMatch]/metadata`
  - …6 more
- …earlier changes not shown

[Full history](https://skmtc.dev/scanopy/apis/scanopy-api/changes/api/v1/subnets/post.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/c037832cd07f/schema)
