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

# Search for Prefixes

> Returns a list of prefixes that match the given search parameters.



## OpenAPI

````yaml openapi/nethub-data.yaml post /{tenantUUID}/prefixes/search
openapi: 3.0.1
info:
  title: NetHub Data
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: '1.0'
servers:
  - url: https://apigw.ipxo.com/nethub-data
security:
  - bearerAuth: []
tags:
  - name: prefixes
  - name: prefixes-metadata
  - name: prefixes-metadata-notation
  - name: prefixes-metadata-array
  - name: prefixes-metadata-array-notation
paths:
  /{tenantUUID}/prefixes/search:
    post:
      tags:
        - prefixes
      summary: Search for Prefixes
      description: Returns a list of prefixes that match the given search parameters.
      operationId: post-tenantuuid-prefixes-search
      parameters:
        - name: tenantUUID
          in: path
          description: Tenant UUID
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PrefixSearch'
      responses:
        '200':
          description: A list of matching prefixes.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PrefixHolderGetResponse'
              example:
                data:
                  - notation: string
                    ipNet:
                      ip: string
                      mask: string
                    internalMetadata:
                      internal: true
                      readOnly: true
                      master: true
                      prefixLengthLimits:
                        min: 0
                        max: 0
                        exact:
                          - 0
                      holders:
                        - tenantUUID: string
                          projectID: string
                          organisation: string
                          type: 0
                          top: true
                    externalMetadata:
                      key1: value1
                      keyN: valueN
                    holderMetadata:
                      key1: value1
                      keyN: valueN
                    geodata:
                      - provider: string
                        countryName: string
                        countryCode: string
                        cityName: string
                        date: string
                        state: string
                    whois:
                      inetnum: string
                      registrar: string
                      source: string
                      recordActive: true
                      nets:
                        - organisation: string
                          netname: string
                          net_type: string
                          net_handle: string
                          origin_as: string
                          country:
                            - string
                          comment: string
                          created: string
                          last_modified: string
                          record_created: string
                          record_modified: string
                          mnt_by:
                            - string
                          mnt_irt:
                            - string
                          pocs:
                            - handle: string
                              kind: string
                          notify: string
                      domains:
                        - domain: string
                          nservers:
                            - string
                    bgp:
                      peerCount:
                        fullTable: 0
                        active: 0
                      asOrigins:
                        - asn: 0
                          peersSeeing: 0
                      asSetOrigins:
                        - asSet: string
                          peersSeeing: 0
                    rpki:
                      roas:
                        - maxLength: 0
                          asn: string
                          ta: string
                      suggestions:
                        - maxLength: 0
                          asn: string
                          ta: string
                          status: as0
                    routes:
                      - route: string
                        origin: string
                        descr:
                          - string
                        mnt_by:
                          - string
                        changed:
                          - string
                        source: string
                    routingHealth:
                      criticalityStatus: critical
                      bgpStatus: match
                      bgpActions:
                        - action: add
                          asns:
                            - 0
                      rpkiStatus: match
                      rpkiActions:
                        - action: add
                          asns:
                            - 0
                      irrStatus: match
                      irrActions:
                        - action: add
                          asns:
                            - origin: 0
                              target: string
                      irmActions:
                        - action: add
                          asns:
                            - 0
                    cacheDerrived:
                      registrar: string
                metadata:
                  limit: 0
                  offset: 0
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: string
                code: 0
                error: string
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: string
                code: 0
                error: string
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: string
                code: 0
                error: string
components:
  schemas:
    PrefixSearch:
      type: object
      properties:
        notation:
          $ref: '#/components/schemas/Filter'
        internalMetadata:
          $ref: '#/components/schemas/Filter'
        externalMetadata:
          $ref: '#/components/schemas/Filter'
        holderMetadata:
          $ref: '#/components/schemas/Filter'
        geodata:
          $ref: '#/components/schemas/Filter'
        whois:
          $ref: '#/components/schemas/Filter'
        bgp:
          $ref: '#/components/schemas/Filter'
        rpki:
          $ref: '#/components/schemas/Filter'
        routes:
          $ref: '#/components/schemas/Filter'
        routingHealth:
          $ref: '#/components/schemas/Filter'
        cacheDerrived:
          $ref: '#/components/schemas/Filter'
        offset:
          type: integer
          format: int64
        limit:
          type: integer
          format: int64
        sort:
          type: string
          description: >-
            Sort order for the returned items. Keys must be provided in a single
            string, separated by `,`. Order determines sorting priority. Adding
            `-` in front of the key enables DESCENDING sort. Supported keys:
            [`notation`, `ipNet`]. To achieve correct "IP sort" use `ipNet`.
        fields:
          type: array
          items:
            type: string
          description: >-
            array of prefix object fields to return in response. Supports
            sub-object projection by using `.`, i.e.: `geodata.provider`.
            **NOTE**: `internalMetadata` does not fully support sub-object field
            projection and will always return entire structure, with
            non-requested fields initialized with default type values (i.e.
            booleans will be equal to `FALSE` and strings to `""`), so it is
            advised to always request entire `internalMetadata` to avoid data
            analysis inconsistencies.
    PrefixHolderGetResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/PrefixHolder'
        metadata:
          $ref: '#/components/schemas/Metadata'
    Error:
      type: object
      properties:
        status:
          type: string
        code:
          type: integer
          format: int64
        error:
          type: string
    Filter:
      required:
        - op
        - vals
      type: object
      properties:
        field:
          type: string
          description: The field to be searched.
        op:
          type: string
          description: >-
            The operation to be performed. Possible values include 'or', 'and',
            'eq', 'ne', 'lt', 'lte', 'gt', 'gte'.
        vals:
          type: array
          items:
            type: string
          description: The values to be used for the operation.
        children:
          type: array
          items:
            $ref: '#/components/schemas/Filter'
          description: An array of child filters, if any.
    PrefixHolder:
      type: object
      properties:
        notation:
          type: string
        ipNet:
          $ref: '#/components/schemas/IPNet'
        internalMetadata:
          $ref: '#/components/schemas/PrefixMetadata'
        externalMetadata:
          $ref: '#/components/schemas/PrefixComponentExternalMetadata'
        holderMetadata:
          $ref: '#/components/schemas/PrefixComponentHolderMetadata'
        geodata:
          type: array
          items:
            $ref: '#/components/schemas/GeolocationData'
        whois:
          $ref: '#/components/schemas/WHOISCache'
        bgp:
          $ref: '#/components/schemas/BGPCache'
        rpki:
          $ref: '#/components/schemas/RPKICache'
        routes:
          type: array
          items:
            $ref: '#/components/schemas/RouteCache'
        routingHealth:
          $ref: '#/components/schemas/RoutingHealthItem'
        cacheDerrived:
          $ref: '#/components/schemas/CacheDerrived'
    Metadata:
      type: object
      properties:
        limit:
          type: integer
        offset:
          type: integer
    IPNet:
      type: object
      properties:
        ip:
          type: string
        mask:
          type: string
    PrefixMetadata:
      type: object
      properties:
        internal:
          type: boolean
        readOnly:
          type: boolean
        master:
          type: boolean
        prefixLengthLimits:
          $ref: '#/components/schemas/PMPrefixLengthLimits'
        holders:
          type: array
          items:
            $ref: '#/components/schemas/PMHolder'
    PrefixComponentExternalMetadata:
      type: object
      additionalProperties:
        type: string
      example:
        key1: value1
        keyN: valueN
    PrefixComponentHolderMetadata:
      type: object
      additionalProperties:
        type: string
      example:
        key1: value1
        keyN: valueN
    GeolocationData:
      type: object
      properties:
        provider:
          type: string
        countryName:
          type: string
        countryCode:
          type: string
        cityName:
          type: string
        date:
          type: string
        state:
          type: string
    WHOISCache:
      required:
        - domains
        - inetnum
        - nets
        - registrar
        - source
      type: object
      properties:
        inetnum:
          type: string
        registrar:
          type: string
        source:
          type: string
        recordActive:
          type: boolean
        nets:
          type: array
          items:
            $ref: '#/components/schemas/WHOISCacheNet'
        domains:
          type: array
          items:
            $ref: '#/components/schemas/WHOISCacheDomain'
    BGPCache:
      type: object
      properties:
        peerCount:
          $ref: '#/components/schemas/BGPCachePeerCountIP'
        asOrigins:
          type: array
          items:
            $ref: '#/components/schemas/BGPCacheASOrigin'
        asSetOrigins:
          type: array
          items:
            $ref: '#/components/schemas/BGPCacheASSetOrigin'
    RPKICache:
      type: object
      properties:
        roas:
          type: array
          items:
            $ref: '#/components/schemas/ROACache'
        suggestions:
          type: array
          items:
            $ref: '#/components/schemas/RPKISuggestion'
    RouteCache:
      type: object
      properties:
        route:
          type: string
        origin:
          type: string
        descr:
          type: array
          items:
            type: string
        mnt_by:
          type: array
          items:
            type: string
        changed:
          type: array
          items:
            type: string
        source:
          type: string
    RoutingHealthItem:
      type: object
      properties:
        criticalityStatus:
          enum:
            - critical
            - good
            - high
            - low
          type: string
        bgpStatus:
          $ref: '#/components/schemas/RoutingHealthStatus'
        bgpActions:
          type: array
          items:
            $ref: '#/components/schemas/RoutingHealthAction'
        rpkiStatus:
          $ref: '#/components/schemas/RoutingHealthStatus'
        rpkiActions:
          type: array
          items:
            $ref: '#/components/schemas/RoutingHealthAction'
        irrStatus:
          $ref: '#/components/schemas/RoutingHealthStatus'
        irrActions:
          type: array
          items:
            $ref: '#/components/schemas/RoutingHealthActionIRR'
        irmActions:
          type: array
          items:
            $ref: '#/components/schemas/RoutingHealthAction'
    CacheDerrived:
      type: object
      properties:
        registrar:
          type: string
    PMPrefixLengthLimits:
      type: object
      properties:
        min:
          type: integer
        max:
          type: integer
        exact:
          type: array
          items:
            type: integer
    PMHolder:
      type: object
      properties:
        tenantUUID:
          type: string
        projectID:
          type: string
        organisation:
          type: string
        type:
          enum:
            - 0
            - 1
          type: integer
          description: >
            `0` indicates `discovery` type, which puts holder and its owned
            prefixes into full automation loop. 

            `1` indicates `analytics` type, which excludes holder and its owned
            prefixes (as long as holder owns them) from automation loop.
        top:
          type: boolean
    WHOISCacheNet:
      required:
        - net_type
        - netname
      type: object
      properties:
        organisation:
          type: string
        netname:
          type: string
        net_type:
          type: string
        net_handle:
          type: string
        origin_as:
          type: string
        country:
          type: array
          items:
            type: string
        comment:
          type: string
        created:
          type: string
          format: date-time
        last_modified:
          type: string
          format: date-time
        record_created:
          type: string
          format: date-time
        record_modified:
          type: string
          format: date-time
        mnt_by:
          type: array
          items:
            type: string
        mnt_irt:
          type: array
          items:
            type: string
        pocs:
          type: array
          items:
            $ref: '#/components/schemas/WHOISCachePoc'
        notify:
          type: string
    WHOISCacheDomain:
      type: object
      properties:
        domain:
          type: string
        nservers:
          type: array
          items:
            type: string
    BGPCachePeerCountIP:
      type: object
      properties:
        fullTable:
          type: integer
          format: int64
        active:
          type: integer
          format: int64
    BGPCacheASOrigin:
      type: object
      properties:
        asn:
          type: integer
          format: uint32
        peersSeeing:
          type: integer
    BGPCacheASSetOrigin:
      type: object
      properties:
        asSet:
          type: string
        peersSeeing:
          type: integer
    ROACache:
      type: object
      properties:
        maxLength:
          type: integer
          format: int64
        asn:
          type: string
          description: Autonomous System Number (ASN) for the ROA
        ta:
          type: string
          description: Trust Anchor (TA) for the ROA
    RPKISuggestion:
      type: object
      properties:
        maxLength:
          type: integer
          format: int64
        asn:
          type: string
          description: Autonomous System Number (ASN) for the ROA
        ta:
          type: string
          description: Trust Anchor (TA) for the ROA
        status:
          enum:
            - as0
            - as0_redundant
            - not_found
            - invalid_asn
            - invalid_length
            - too_permissive
            - redundant
            - not_seen
          type: string
    RoutingHealthStatus:
      enum:
        - match
        - no_match
        - partial
        - 'null'
      type: string
    RoutingHealthAction:
      type: object
      properties:
        action:
          enum:
            - add
            - delete
            - inform
          type: string
        asns:
          type: array
          items:
            type: integer
    RoutingHealthActionIRR:
      type: object
      properties:
        action:
          enum:
            - add
            - delete
            - inform
          type: string
        asns:
          type: array
          items:
            $ref: '#/components/schemas/RoutingHealthASNIRR'
    WHOISCachePoc:
      type: object
      properties:
        handle:
          type: string
        kind:
          type: string
    RoutingHealthASNIRR:
      type: object
      properties:
        origin:
          type: integer
        target:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````