---
title: networkPrefix query | Wartiva GraphQL API
description: Retrieves a NetworkPrefix by its graph object id: a host IP address with its subnet length, such as 192.168.1.23/24, on a specific Network.
url: https://wartiva.com/api-docs/queries/network-prefix.html
updated: 2026-10-07
---

Networks, devices, and sensors · GraphQL query

# `networkPrefix` query

Retrieves a [NetworkPrefix](https://wartiva.com/api-docs/types/network-prefix.html) by its graph object id: a host IP address with its subnet length, such as 192.168.1.23/24, on a specific [Network](https://wartiva.com/api-docs/types/network.html). It links to the endpoint interfaces and devices that used the address, and to the ARP entries, open ports, and services observed on it. A network lists its prefixes through `prefixes`; find them across the organization with [graphSearch](https://wartiva.com/api-docs/queries/graph-search.html) on the NETWORK_PREFIX object type. Returns a not-found error when no object has the id, and an error when the id belongs to another object type.

## Response

Returns a [`NetworkPrefixPayload!`](https://wartiva.com/api-docs/types/network-prefix-payload.html)

## Arguments

| Name | Description |
|---|---|
| `id` - [`ID!`](https://wartiva.com/api-docs/types/id.html) | The NetworkPrefix identifier. |
| `mockOptions` - [`MockDataInput`](https://wartiva.com/api-docs/types/mock-data-input.html) | Options for mock data generation. Options supported: none. |

## Example

### Query

```graphql
query networkPrefix(
  $id: ID!,
  $mockOptions: MockDataInput
) {
  networkPrefix(
    id: $id,
    mockOptions: $mockOptions
  ) {
    node {
      id
      orgId
      seen {
        ...SeenOnlineFragment
      }
      objectType
      objectTypeLabel
      displayName
      firstSeen
      lastSeen
      createdAt
      updatedAt
      snapshotInfo {
        ...GraphObjectSnapshotInfoFragment
      }
      prefix {
        ...IpNetworkFragment
      }
      isNetworkAddress
      isHostAddress
      network {
        ...NetworkFragment
      }
      arpTableEntries {
        ...ArpTableEntryConnectionFragment
      }
      interfaces {
        ...InterfaceConnectionFragment
      }
      ports {
        ...OpenPortConnectionFragment
      }
      seenOnDevices {
        ...DeviceConnectionFragment
      }
      seenOnInterfaces {
        ...InterfaceConnectionFragment
      }
      services {
        ...ServiceConnectionFragment
      }
      findings {
        ...FindingsPayloadFragment
      }
      issues {
        ...IssuesPayloadFragment
      }
      issuesSummary {
        ...IssuesSummaryFragment
      }
    }
  }
}

```

### Variables

```json
{
  "id": "4",
  "mockOptions": MockDataInput
}

```

### Response

```json
{"data": {"networkPrefix": {"node": NetworkPrefix}}}

```

---

Wartiva is in early access. Request access: https://wartiva.com/early-access.html  
All pages: https://wartiva.com/llms.txt
