openapi: 3.1.0
info:
  title: CIP-service Indexing API
  description: CIP-service is a project of the US Environmental Protection Agency Office of Water providing containers, logic and data for the task of associating or _indexing_ hydrologic 
    features with NHDPlus features at multiple resolutions.  CIP-service supports a variety of purposes indexing to catchments, reaches or navigating the NHDPlus network for discovery or flow analysis.  
    The majority of logic occurs within a containerized PostgreSQL database with additional containers providing support products such as an API, Jupyter Notebooks and sample demo applications.  
    All components of the provided container stack are open source.
  termsOfService: https://www.epa.gov/web-policies-and-procedures/epa-disclaimers#geospatial
  contact:
    name: US EPA Office of Water
    url: https://www.epa.gov/aboutepa/about-office-water
    email: WATERS_SUPPORT@epa.gov
  license:
    name: Creative Commons Zero Public Domain Dedication
    url: https://edg.epa.gov/EPA_Data_License.html
  version: 1.0.0
servers:
- url: https://localhost:3000
paths:
  /rpc/cipsrv_index:
    post:
      tags:
      - 'CIP Indexing Services'
      summary: CIP-service Indexing
      description: CIP-service Indexing Endpoint
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/cipsrv_index_rb'
      responses:
        200:
          description: CIP-service Indexing Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/cipsrv_index_resp'
  /rpc/cipsrv_domains:
    get:
      tags:
      - 'CIP Indexing Services'
      summary: CIP-service Domains
      description: CIP-service Domains Endpoint
      responses:
        '200':
          description: states and tribes
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/cipsrv_domains'
  /rpc/navigate:
    post:
      tags:
      - 'Analysis Services'
      summary: CIP-service Navigation
      description: CIP-service Navigation Endpoint
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/navigate_rb'
      responses:
        200:
          description: CIP-service Navigation Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/navigate_resp'
  /rpc/delineate:
    post:
      tags:
      - 'Analysis Services'
      summary: CIP-service Delineation
      description: CIP-service Delineation Endpoint
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/delineate_rb'
      responses:
        200:
          description: CIP-service Delineation Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delineate_resp'
  /rpc/pointindexing:
    post:
      tags:
      - 'Analysis Services'
      summary: CIP-service Point Indexing
      description: CIP-service Point Indexing Endpoint
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/pointindexing_rb'
      responses:
        200:
          description: CIP-service Point Indexing Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pointindexing_resp'
  /rpc/upstreamdownstream:
    post:
      tags:
      - 'Analysis Services'
      summary: CIP-service Upstream Downstream
      description: CIP-service Upstream Downstream Endpoint
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/upstreamdownstream_rb'
      responses:
        200:
          description: CIP-service Upstream Downstream Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/upstreamdownstream_resp'
  /rpc/randomcatchment:
    post:
      tags:
      - 'Utility Services'
      summary: CIP-service Utility Random Catchment
      description: CIP-service Utility Random Catchment Endpoint
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/randomcatchment_rb'
      responses:
        200:
          description: CIP-service Utility Random Catchment Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/randomcatchment_resp'
  /rpc/randomhuc12:
    post:
      tags:
      - 'Utility Services'
      summary: CIP-service Utility Random HUC12
      description: CIP-service Utility Random HUC12 Endpoint
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/randomhuc12_rb'
      responses:
        200:
          description: CIP-service Utility Random HUC12 Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/randomhuc12_resp'
  /rpc/randomnav:
    post:
      tags:
      - 'Utility Services'
      summary: CIP-service Utility Random Nav Location
      description: CIP-service Utility Random Nav Location Endpoint
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/randomnav_rb'
      responses:
        200:
          description: CIP-service Utility Random Nav Location Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/randomnav_resp'
  /rpc/randomppnav:
    post:
      tags:
      - 'Utility Services'
      summary: CIP-service Utility Random PP Nav Locations
      description: CIP-service Utility Random PP Nav Locations Endpoint
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/randomppnav_rb'
      responses:
        200:
          description: CIP-service Utility Random PP Nav Locations Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/randomppnav_resp'
  /rpc/randompoint:
    post:
      tags:
      - 'Utility Services'
      summary: CIP-service Utility Random Point
      description: CIP-service Utility Random Point Endpoint
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/randompoint_rb'
      responses:
        200:
          description: CIP-service Utility Random Point Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/randompoint_resp'
components:
  schemas:
    cipsrv_index_rb:
      type: object
      properties:
        points:
          description: GeoJSON feature or feature collection of one or more points to index.
          oneOf:
          - $ref: '#/components/schemas/geojson_featurecollection'
          - $ref: '#/components/schemas/geojson_feature'
          - type: 'null'
        lines:
          description: GeoJSON feature or feature collection of one or more line strings to index.
          oneOf:
          - $ref: '#/components/schemas/geojson_featurecollection'
          - $ref: '#/components/schemas/geojson_feature'
          - type: 'null'
        areas:
          description: GeoJSON feature or feature collection of one or more polygons to index.
          oneOf:
          - $ref: '#/components/schemas/geojson_featurecollection'
          - $ref: '#/components/schemas/geojson_feature'
          - type: 'null'
        geometry:
          description: GeoJSON geometry, feature or feature collection of one or more geometries to index.
          oneOf:
          - $ref: '#/components/schemas/geojson_featurecollection'
          - $ref: '#/components/schemas/geojson_feature'
          - $ref: '#/components/schemas/geojson_geometry'
          - type: 'null'
        geometry_clip:
          description: array of clip items to apply to the incoming features.
          type: ['array','null']
          items:
            type: 'string'
        geometry_clip_stage:
          description: flag to control whether to clip features before or after indexing.
          type: ['string','null']
          enum:
          - BEFORE
          - AFTER
          default: BEFORE
        catchment_filter:
          description: >
             Array of filter items to apply to indexing results.  Filter values may include:
                * USPS codes for the 50 states plus DC, PR, VI, AS, GU and MP.
                * Tribal keywords: ALLTRIBAL, PARTTRIBAL, NOTRIBAL or TRIBAL < X.
             For the TRIBAL < X keyword X is a decimal percentage that tribal percentage of the catchment must meet to be included.
          type: ['array','null']
          items:
            type: string
        nhdplus_version:
          default: nhdplus_m
          $ref: '#/components/schemas/nhdplus_version'
        wbd_version:
          description: WBD version used in CIP indexing. Currently non-functional.
          type: ['string','null']
        default_point_indexing_method:
          description: Point indexing method to use when point features are received without expressly defining a point indexing method.
          type: ['string','null']
          enum:
          - point_simple
          default: point_simple
        default_line_indexing_method:
          description: Line indexing method to use when line features are received without expressly defining a line indexing method.
          type: ['string','null']
          enum:
          - line_simple
          - line_levelpath
          default: line_simple
        default_line_threshold:
          description: Linear threshold percentage (0 - 100) to use when linear features are received without expressly defining a linear threshold value.
          type: ['number','null']
          minimum: 0
          maximum: 100
        default_ring_indexing_method:
          description: Area indexing method to use when linear features that form a closed ring are received without expressly defining a ring indexing method.  To preclude ring processing, set this value to **treat_as_lines**.
          type: ['string','null']
          enum:
          - area_simple
          - area_centroid
          - area_artpath
          - treat_as_lines
          default: treat_as_lines
        default_ring_areacat_threshold:
          description: Area catchment threshold percentage (0 - 100) to use when ring features are received without expressly defining a ring area catchment threshold value.
          type: ['number','null']
          minimum: 0
          maximum: 100
        default_ring_areaevt_threshold:
          description: Area event threshold percentage (0 - 100) to use when ring features are received without expressly defining a ring area event threshold value.
          type: ['number','null']
          minimum: 0
          maximum: 100
        default_area_indexing_method:
          description: Area indexing method to use when polygon features are received without expressly defining an area indexing method.
          type: ['string','null']
          enum:
          - area_simple
          - area_centroid
          - area_artpath
          default: area_simple
        default_areacat_threshold:
          description: Area catchment threshold percentage (0 - 100) to use when area features are received without expressly defining an area catchment threshold value.
          type: ['number','null']
          minimum: 0
          maximum: 100
        default_areaevt_threshold:
          description: Area event threshold percentage (0 - 100) to use when area features are received without expressly defining an area event threshold value.
          type: ['number','null']
          minimum: 0
          maximum: 100
        known_region:
          oneOf:
          - $ref: '#/components/schemas/known_region'
          - type: 'null'
        return_indexing_summary:
          description: Flag as to whether to return a detailed summary of the indexing actions.  Setting this false will slightly improve performance and throughput.
          type: ['boolean','null']
          default: true
        return_indexed_features:
          description: >
            Flag as to whether to return indexed features in the results payload.
            Indexing may clip features creating a smaller, different geometry that users may wish to inspect.
            Setting this false will improve performance when large features are clipped to detailed political borders.
          type: ['boolean','null']
          default: true
        return_indexed_collection:
          description: >
            Flag as to whether to return all indexed features as a single geometry collection.
            This functionality is meant for users who just wish all the features back in a simple format for easy display purposes.
          type: ['boolean','null']
          default: false
        return_catchment_geometry:
          description: Flag as to whether to return the catchment geometry in the results payload.
          type: ['boolean','null']
          default: true
        return_flowlines:
          description: Flag as to whether to return a feature collection of flowlines associated with indexed catchments.
          type: ['boolean','null']
          default: true
        return_huc12s:
          description: Flag as to whether to return a feature collection of HUC12s associated with indexed catchments.  Currently non-functional.
          type: ['boolean','null']
          default: false
        return_flowline_geometry:
          description: Flag as to return the flowline geometry when flowlines are returned in the results payload.
          type: ['boolean','null']
          default: true
        return_huc12_geometry:
          description: Flag as to return the HUC12 geometry when HUC12s are returned in the results payload.  Currently non-functional.
          type: ['boolean','null']
          default: true
      required:
      - nhdplus_version
    cipsrv_index_resp:
      type: object
      properties:
        indexed_points:
          description: Feature collection of point event features processed through CIP indexing.
          $ref: '#/components/schemas/geojson_featurecollection'
        indexed_lines:
          description: Feature collection of line event features processed through CIP indexing.
          $ref: '#/components/schemas/geojson_featurecollection'
        indexed_areas:
          description: Feature collection of area event features processed through CIP indexing.
          $ref: '#/components/schemas/geojson_featurecollection'
        indexed_collection:
          description: Geometry of all event features processed through CIP indexing.
          $ref: '#/components/schemas/geojson_geometry'
        indexing_summary:
          $ref: '#/components/schemas/indexing_summary'
        catchment_count:
          type: integer
          format: int32
        catchment_areasqkm:
          type: number
        catchments:
          $ref: '#/components/schemas/geojson_featurecollection'
        flowlines:
          $ref: '#/components/schemas/geojson_featurecollection'
        huc12s:
          $ref: '#/components/schemas/geojson_featurecollection'
        return_code:
          $ref: '#/components/schemas/return_code'
        status_message:
          $ref: '#/components/schemas/status_message'
    navigate_rb:
      type: object
      properties:
        nhdplus_version:
          default: nhdplus_m
          $ref: '#/components/schemas/nhdplus_version'
        search_type:
          $ref: '#/components/schemas/search_type'
        start_nhdplusid:
          oneOf:
          - $ref: '#/components/schemas/start_nhdplusid'
          - type: 'null'
        start_permanent_identifier:
          oneOf:
          - $ref: '#/components/schemas/start_permanent_identifier'
          - type: 'null'
        start_reachcode:
          oneOf:
          - $ref: '#/components/schemas/start_reachcode'
          - type: 'null'
        start_hydroseq:
          oneOf:
          - $ref: '#/components/schemas/start_hydroseq'
          - type: 'null'
        start_measure:
          oneOf:
          - $ref: '#/components/schemas/start_measure'
          - type: 'null'
        stop_nhdplusid:
          oneOf:
          - $ref: '#/components/schemas/stop_nhdplusid'
          - type: 'null'
        stop_permanent_identifier:
          oneOf:
          - $ref: '#/components/schemas/stop_permanent_identifier'
          - type: 'null'
        stop_reachcode:
          oneOf:
          - $ref: '#/components/schemas/stop_reachcode'
          - type: 'null'
        stop_hydroseq:
          oneOf:
          - $ref: '#/components/schemas/stop_hydroseq'
          - type: 'null'
        stop_measure:
          oneOf:
          - $ref: '#/components/schemas/stop_measure'
          - type: 'null'
        max_distancekm:
          oneOf:
          - $ref: '#/components/schemas/max_distancekm'
          - type: 'null'
        max_flowtimeday:
          oneOf:
          - $ref: '#/components/schemas/max_flowtimeday'
          - type: 'null'
        return_flowline_details:
          oneOf:
          - $ref: '#/components/schemas/return_flowline_details'
          - type: 'null'
        return_flowline_geometry:
          oneOf:
          - $ref: '#/components/schemas/return_flowline_geometry'
          - type: 'null'
    navigate_resp:
      type: object
      properties:
        flowlines:
          $ref: '#/components/schemas/geojson_featurecollection'
        flowline_count:
          $ref: '#/components/schemas/flowline_count'
        nhdplus_version:
          $ref: '#/components/schemas/nhdplus_version'
        return_code:
          $ref: '#/components/schemas/return_code'
        status_message:
          $ref: '#/components/schemas/status_message'
    delineate_rb:
      type: object
      properties:
        nhdplus_version:
          default: nhdplus_m
          $ref: '#/components/schemas/nhdplus_version'
        search_type:
          $ref: '#/components/schemas/search_type'
        start_nhdplusid:
          oneOf:
          - $ref: '#/components/schemas/start_nhdplusid'
          - type: 'null'
        start_permanent_identifier:
          oneOf:
          - $ref: '#/components/schemas/start_permanent_identifier'
          - type: 'null'
        start_reachcode:
          oneOf:
          - $ref: '#/components/schemas/start_reachcode'
          - type: 'null'
        start_hydroseq:
          oneOf:
          - $ref: '#/components/schemas/start_hydroseq'
          - type: 'null'
        start_measure:
          oneOf:
          - $ref: '#/components/schemas/start_measure'
          - type: 'null'
        stop_nhdplusid:
          oneOf:
          - $ref: '#/components/schemas/stop_nhdplusid'
          - type: 'null'
        stop_permanent_identifier:
          oneOf:
          - $ref: '#/components/schemas/stop_permanent_identifier'
          - type: 'null'
        stop_reachcode:
          oneOf:
          - $ref: '#/components/schemas/stop_reachcode'
          - type: 'null'
        stop_hydroseq:
          oneOf:
          - $ref: '#/components/schemas/stop_hydroseq'
          - type: 'null'
        stop_measure:
          oneOf:
          - $ref: '#/components/schemas/stop_measure'
          - type: 'null'
        max_distancekm:
          oneOf:
          - $ref: '#/components/schemas/max_distancekm'
          - type: 'null'
        max_flowtimeday:
          oneOf:
          - $ref: '#/components/schemas/max_flowtimeday'
          - type: 'null'
        return_flowline_details:
          oneOf:
          - $ref: '#/components/schemas/return_flowline_details'
          - type: 'null'
        return_flowline_geometry:
          oneOf:
          - $ref: '#/components/schemas/return_flowline_geometry'
          - type: 'null'
    delineate_resp:
      type: object
      properties:
        flowlines:
          $ref: '#/components/schemas/geojson_featurecollection'
        flowline_count:
          $ref: '#/components/schemas/flowline_count'
        nhdplus_version:
          $ref: '#/components/schemas/nhdplus_version'
        return_code:
          $ref: '#/components/schemas/return_code'
        status_message:
          $ref: '#/components/schemas/status_message'
        delineated_area:
          $ref: '#/components/schemas/geojson_featurecollection'
        aggregation_used:
          description: aggregation logic used in delineation action.
          type: string
    pointindexing_rb:
      type: object
      properties:
        point:
          oneOf:
          - $ref: '#/components/schemas/geojson_featurecollection'
          - $ref: '#/components/schemas/geojson_feature'
          - $ref: '#/components/schemas/geojson_geometry'
        nhdplus_version:
          default: nhdplus_m
          $ref: '#/components/schemas/nhdplus_version'
        return_snap_path:
          oneOf:
          - type: boolean
          - type: 'null'
        known_region:
          oneOf:
          - $ref: '#/components/schemas/known_region'
          - type: 'null'
    pointindexing_resp:
      type: object
      properties:
        nhdplusid:
          oneOf:
          - $ref: '#/components/schemas/nhdplusid'
          - type: 'null'
        hydroseq:
          $ref: '#/components/schemas/hydroseq'
        permanent_identifier:
          type: ['integer','string']
          maxLength: 40
        reachcode:
          $ref: '#/components/schemas/reachcode'
        fcode:
          type: integer
          format: int32
        isnavigable:
          type: boolean
        snap_measure:
          $ref: '#/components/schemas/measure'
        snap_distancekm:
          type: ['number','null']
        snap_point:
          $ref: '#/components/schemas/geojson_feature'
        snap_path:
          $ref: '#/components/schemas/geojson_feature'
        return_code:
          $ref: '#/components/schemas/return_code'
        status_message:
          type: ['string','null']
    upstreamdownstream_rb:
      type: object
      properties:
        nhdplus_version:
          default: nhdplus_m
          $ref: '#/components/schemas/nhdplus_version'
        search_type:
          $ref: '#/components/schemas/search_type'
        start_nhdplusid:
          oneOf:
          - $ref: '#/components/schemas/start_nhdplusid'
          - type: 'null'
        start_permanent_identifier:
          oneOf:
          - $ref: '#/components/schemas/start_permanent_identifier'
          - type: 'null'
        start_reachcode:
          oneOf:
          - $ref: '#/components/schemas/start_reachcode'
          - type: 'null'
        start_hydroseq:
          oneOf:
          - $ref: '#/components/schemas/start_hydroseq'
          - type: 'null'
        start_measure:
          oneOf:
          - $ref: '#/components/schemas/start_measure'
          - type: 'null'
        start_source_featureid:
          oneOf:
          - type: string
          - type: 'null'
        start_source_featureid2:
          oneOf:
          - type: string
          - type: 'null'
        start_source_originator:
          oneOf:
          - type: string
          - type: 'null'
        start_source_series:
          oneOf:
          - type: string
          - type: 'null'
        start_start_date:
          oneOf:
          - type: string
            format: date
          - type: 'null'
        start_end_date:
          oneOf:
          - type: string
            format: date
          - type: 'null'
        start_permid_joinkey:
          oneOf:
          - type: string
          - type: 'null'
        start_source_joinkey:
          oneOf:
          - type: string
          - type: 'null'
        start_cat_joinkey:
          oneOf:
          - type: string
          - type: 'null'
        start_linked_data_program:
          oneOf:
          - type: string
          - type: 'null'
        start_search_precision:
          oneOf:
          - type: string
          - type: 'null'
        start_search_logic:
          oneOf:
          - type: string
          - type: 'null'
        stop_nhdplusid:
          oneOf:
          - $ref: '#/components/schemas/stop_nhdplusid'
          - type: 'null'
        stop_permanent_identifier:
          oneOf:
          - $ref: '#/components/schemas/stop_permanent_identifier'
          - type: 'null'
        stop_reachcode:
          oneOf:
          - $ref: '#/components/schemas/stop_reachcode'
          - type: 'null'
        stop_hydroseq:
          oneOf:
          - $ref: '#/components/schemas/stop_hydroseq'
          - type: 'null'
        stop_measure:
          oneOf:
          - $ref: '#/components/schemas/stop_measure'
          - type: 'null'
        stop_source_featureid:
          oneOf:
          - type: string
          - type: 'null'
        stop_source_featureid2:
          oneOf:
          - type: string
          - type: 'null'
        stop_source_originator:
          oneOf:
          - type: string
          - type: 'null'
        stop_source_series:
          oneOf:
          - type: string
          - type: 'null'
        stop_start_date:
          oneOf:
          - type: string
            format: date
          - type: 'null'
        stop_end_date:
          oneOf:
          - type: string
            format: date
          - type: 'null'
        stop_permid_joinkey:
          oneOf:
          - type: string
          - type: 'null'
        stop_source_joinkey:
          oneOf:
          - type: string
          - type: 'null'
        stop_cat_joinkey:
          oneOf:
          - type: string
          - type: 'null'
        stop_linked_data_program:
          oneOf:
          - type: string
          - type: 'null'
        stop_search_precision:
          oneOf:
          - type: string
          - type: 'null'
        stop_search_logic:
          oneOf:
          - type: string
          - type: 'null'
        max_distancekm:
          oneOf:
          - $ref: '#/components/schemas/max_distancekm'
          - type: 'null'
        max_flowtimeday:
          oneOf:
          - $ref: '#/components/schemas/max_flowtimeday'
          - type: 'null'
        linked_data_search_list:
          type: array
          items:
            type: string
        return_flowline_details:
          oneOf:
          - $ref: '#/components/schemas/return_flowline_details'
          - type: 'null'
        return_flowline_geometry:
          oneOf:
          - $ref: '#/components/schemas/return_flowline_geometry'
          - type: 'null'
        return_catchments:
          oneOf:
          - type: boolean
          - type: 'null'
        return_linked_data_cip:
          oneOf:
          - type: boolean
          - type: 'null'
        return_linked_data_huc12:
          oneOf:
          - type: boolean
          - type: 'null'
        return_linked_data_source:
          oneOf:
          - type: boolean
          - type: 'null'
        return_linked_data_rad:
          oneOf:
          - type: boolean
          - type: 'null'
        return_linked_data_attributes:
          oneOf:
          - type: boolean
          - type: 'null'
        remove_stop_start_sfids:
          oneOf:
          - type: boolean
          - type: 'null'
        push_source_geometry_as_rad:
          oneOf:
          - type: boolean
          - type: 'null'
    upstreamdownstream_resp:
      type: object
      properties:
        flowlines:
          $ref: '#/components/schemas/geojson_featurecollection'
        catchments:
          $ref: '#/components/schemas/geojson_featurecollection'
        linked_data_sfid_found:
          type: object
          properties:
            type: 
              type: string
            rows: 
              type: array
              items:
                type: object
                properties:
                  eventtype:
                    type: integer
                  source_originator:
                    type: string
                  source_featureid:
                    type: string
                  source_featureid2:
                    type: string
                  source_series:
                    type: string
                  source_subdivision:
                    type: string
                  source_joinkey:
                    type: string
                  start_date:
                    type: string
                    format: date
                  end_date:
                    type: string
                    format: date
                  sfiddetailurl:
                    type: string
                  src_event_count:
                    type: integer
                  rad_event_count:
                    type: integer
                  src_cat_joinkey_count:
                    type: integer
                  nearest_cip_distancekm_permid:
                    type: number
                  nearest_cip_distancekm_cat:
                    type: number
                  nearest_cip_network_distancekm:
                    type: number
                  nearest_rad_distancekm_permid:
                    type: string
                  nearest_rad_network_distancekm:
                    type: number
                  nearest_cip_flowtimeday_permid:
                    type: string
                  nearest_cip_flowtimeday_cat:
                    type: number
                  nearest_cip_network_flowtimeday:
                    type: number
                  nearest_rad_flowtimeday_permid:
                    type: string
                  nearest_rad_network_flowtimeday:
                    type: number
        linked_data_cip_found:
          type: object
          properties:
            type: 
              type: string
            rows: 
              type: array
              items:
                type: object
                properties:
                  eventtype:
                    type: integer
                  permid_joinkey:
                    type: string
                  source_originator:
                    type: string
                  source_featureid:
                    type: string
                  source_featureid2:
                    type: string
                  source_series:
                    type: string
                  source_subdivision:
                    type: string
                  source_joinkey:
                    type: string
                  start_date:
                    type: string
                    format: date
                  end_date:
                    type: string
                    format: date
                  cat_joinkey:
                    type: string
                  catchmentstatecode:
                    type: string
                  nhdplusid:
                    type: integer
                    format: int64
                  xwalk_huc12:
                    type: string
                  network_distancekm:
                    type: number
                  network_flowtimeday:
                    type: number
        linked_data_huc12_found:
          type: object
          properties:
            type: 
              type: string
            rows: 
              type: array
              items:
                type: object
                properties:
                  eventtype:
                    type: integer
                  permid_joinkey:
                    type: string
                  source_originator:
                    type: string
                  source_featureid:
                    type: string
                  source_featureid2:
                    type: string
                  source_series:
                    type: string
                  source_subdivision:
                    type: string
                  source_joinkey:
                    type: string
                  start_date:
                    type: string
                    format: date
                  end_date:
                    type: string
                    format: date
                  xwalk_huc12:
                    type: string
                  network_distancekm:
                    type: number
                  network_flowtimeday:
                    type: number
        linked_data_source_points:
          $ref: '#/components/schemas/geojson_feature'
        linked_data_source_lines:
          $ref: '#/components/schemas/geojson_feature'
        linked_data_source_areas:
          $ref: '#/components/schemas/geojson_feature'
        linked_data_reached_points:
          $ref: '#/components/schemas/geojson_feature'
        linked_data_reached_lines:
          $ref: '#/components/schemas/geojson_feature'
        linked_data_reached_areas:
          $ref: '#/components/schemas/geojson_feature'
        linked_data_attributes:
          type: object
          properties:
            type: 
              type: string
            rows: 
              type: array
              items:
                oneOf:
                - $ref: '#/components/schemas/linked_data_wqp'
        result_link_path:
          $ref: '#/components/schemas/geojson_feature'
        return_code:
          $ref: '#/components/schemas/return_code'
        status_message:
          $ref: '#/components/schemas/status_message'   
    linked_data_wqp:
      type: object
      properties:
        source_joinkey:
          type: string
        organizationidentifier:
          type: string
        organizationformalname:
          type: string
        monitoringlocationidentifier:
          type: string
        monitoringlocationname:
          type: string
        monitoringlocationtypename:
          type: string
        monitoringlocationdescription:
          type: string
        huceightdigitcode:
          type: string
        drainageareameasure_measureval:
          type: number
        drainageareameasure_measureunt:
          type: string
        contributingdrainageareameasva:
          type: string
        contributingdrainageareameasun:
          type: string
        latitudemeasure:
          type: number
        longitudemeasure:
          type: number
        sourcemapscalenumeric:
          type: number
        horizontalaccuracymeasureval:
          type: string
        horizontalaccuracymeasureunit:
          type: string
        horizontalcollectionmethodname:
          type: string
        horizontalcoordinatereferences:
          type: string
        verticalmeasure_measurevalue:
          type: string
        verticalmeasure_measureunit:
          type: string
        verticalaccuracymeasurevalue:
          type: string
        verticalaccuracymeasureunit:
          type: string
        verticalcollectionmethodname:
          type: string
        verticalcoordinatereferencesys:
          type: string
        countrycode:
          type: string
        statecode:
          type: string
        countycode:
          type: string
        aquifername:
          type: string
        formationtypetext:
          type: string
        aquifertypename:
          type: string
        constructiondatetext:
          type: string
        welldepthmeasure_measurevalue:
          type: string
        welldepthmeasure_measureunit:
          type: string
        wellholedepthmeasure_measureva:
          type: string
        wellholedepthmeasure_measureun:
          type: string
        providername:
          type: string
        nearest_cip_network_distancekm:
          type: number
        nearest_cip_network_flowtimeday:
          type: number
        nearest_rad_network_distancekm:
          type: number
        nearest_rad_network_flowtimeday:
          type: number
    randomcatchment_rb:
      type: object
      properties:
        nhdplus_version:
          default: nhdplus_m
          $ref: '#/components/schemas/nhdplus_version'
    randomcatchment_resp:
      type: object
      properties:
        catchment:
          $ref: '#/components/schemas/geojson_feature'
    randomhuc12_rb:
      type: object
      properties:
        nhdplus_version:
          default: nhdplus_m
          $ref: '#/components/schemas/nhdplus_version'
    randomhuc12_resp:
      type: object
      properties:
        huc12:
          $ref: '#/components/schemas/geojson_feature'
    randomnav_rb:
      type: object
      properties:
        nhdplus_version:
          default: nhdplus_m
          $ref: '#/components/schemas/nhdplus_version'
    randomnav_resp:
      type: object
      properties:
        navpoint:
          $ref: '#/components/schemas/geojson_feature'
    randomppnav_rb:
      type: object
      properties:
        nhdplus_version:
          default: nhdplus_m
          $ref: '#/components/schemas/nhdplus_version'
    randomppnav_resp:
      type: object
      properties:
        navpoint1:
          $ref: '#/components/schemas/geojson_feature'
        navpoint2:
          $ref: '#/components/schemas/geojson_feature'
    randompoint_rb:
      type: object
      properties:
        nhdplus_version:
          default: nhdplus_m
          $ref: '#/components/schemas/nhdplus_version'
    randompoint_resp:
      type: object
      properties:
        point:
          $ref: '#/components/schemas/geojson_feature'
    cipsrv_domains:
      type: object
      properties:
         states:
           $ref: '#/components/schemas/cipsrv_domains_states'
         tribes:
           $ref: '#/components/schemas/cipsrv_domains_tribes'
    cipsrv_domains_states:
      type: array
      items:
        $ref: '#/components/schemas/cipsrv_domains_state'
    cipsrv_domains_state:
      type: object
      properties:
         geoid:
           type: string
         stusps:
           type: string
         name:
           type: string
    cipsrv_domains_tribes:
      type: array
      items:
        $ref: '#/components/schemas/cipsrv_domains_tribe'
    cipsrv_domains_tribe:
      type: object
      properties:
         aiannhns_stem:
           type: string
         aiannhns_namelsad:
           type: string
         has_reservation_lands:
           type: boolean
         has_trust_lands:
           type: boolean
    ordinate:
      type: number
      title: GeoJSON Ordinate
      examples:
      - -89.5327
    coordinates1:
      type: array
      title: GeoJSON Coordinates 1
      items:
        "$ref": "#/components/schemas/ordinate"
    coordinates2:
      type: array
      title: GeoJSON Coordinates 2
      items:
        "$ref": "#/components/schemas/coordinates1"
    coordinates3:
      type: array
      title: GeoJSON Coordinates 3
      items:
        "$ref": "#/components/schemas/coordinates2"
    geojson_geometry:
      type: ['object','null']
      title: GeoJSON Geometry
      externalDocs:
        url: http://geojson.org/geojson-spec.html#geometry-objects
      properties:
        coordinates:
          oneOf:
          - "$ref": "#/components/schemas/coordinates1"
          - "$ref": "#/components/schemas/coordinates2"
          - "$ref": "#/components/schemas/coordinates3"
          - type: array
            title: GeoJSON Coordinates 4
            items:
              "$ref": "#/components/schemas/coordinates3"
        type:
          type: string
          enum:
          - Point
          - LineString
          - Polygon
          - MultiPoint
          - MultiLineString
          - MultiPolygon
          description: the geometry type
    geojson_bbox:
      type: array
      title: GeoJSON BBox
      maxItems: 4
      minItems: 4
      items:
        $ref: '#/components/schemas/ordinate'
    geojson_feature:
      type: ['object','null']
      title: GeoJSON Feature
      required:
      - type
      - geometry
      - properties
      externalDocs:
        url: https://tools.ietf.org/html/rfc7946#section-3.2
      properties:
        bbox:
          "$ref": "#/components/schemas/geojson_bbox"
        geometry:
          "$ref": "#/components/schemas/geojson_geometry"
        obj_type:
          type: string
        properties:
          discriminator:
            propertyName: obj_type
            mapping:
              event_feature_properties: '#/components/schemas/event_feature_properties'
              indexed_catchment_properties: '#/components/schemas/indexed_catchment_properties'
              indexed_flowline_properties: '#/components/schemas/indexed_flowline_properties'
              navigated_flowline_properties: '#/components/schemas/navigated_flowline_properties'
              delineated_area_properties: '#/components/schemas/delineated_area_properties'
              snap_point_properties: '#/components/schemas/snap_point_properties'
              snap_path_properties: '#/components/schemas/snap_path_properties'
          oneOf:
          - "$ref": "#/components/schemas/event_feature_properties"
          - "$ref": "#/components/schemas/indexed_catchment_properties"
          - "$ref": "#/components/schemas/indexed_flowline_properties"
          - "$ref": "#/components/schemas/navigated_flowline_properties"
          - "$ref": "#/components/schemas/delineated_area_properties"
          - "$ref": "#/components/schemas/snap_point_properties"
          - "$ref": "#/components/schemas/snap_path_properties"
        type:
          type: string
          enum:
            - Feature
    event_feature_properties:
      type: object
      properties:
        globalid:
          $ref: '#/components/schemas/globalid'
        lengthkm:
          type: number
        areasqkm:
          type: number
        converted_to_ring:
          type: boolean
        indexing_method_used:
          type: string
        line_threshold_used:
          type: number
        areacat_threshold_used:
          type: number
        areaevt_threshold_used:
          type: number
    indexed_catchment_properties:
      type: object
      properties:
        nhdplusid:
          $ref: '#/components/schemas/nhdplusid'
        catchmentstatecode:
          type: string
        xwalk_huc12:
          type: ['string','null']
          minLength: 12
          maxLength: 12
        areasqkm:
          type: number
    indexed_flowline_properties:
      type: object
      properties:
        nhdplusid:
          $ref: '#/components/schemas/nhdplusid'
        gnis_id:
          description: NHD GNIS identifier
          type: string
        gnis_name:
          description: NHD GNIS name
          type: string
        reachcode:
          $ref: '#/components/schemas/reachcode'
        fmeasure:
          description: NHD flowline from measure.
          $ref: '#/components/schemas/measure'
        tmeasure:
          description: NHD flowline to measure.
          $ref: '#/components/schemas/measure'
    navigated_flowline_properties:
      type: object
      properties:
        nhdplusid:
          $ref: '#/components/schemas/nhdplusid'
        hydroseq:
          $ref: '#/components/schemas/hydroseq'
        fmeasure:
          description: NHD flowline from measure.
          $ref: '#/components/schemas/measure'
        tmeasure:
          description: NHD flowline to measure.
          $ref: '#/components/schemas/measure'
        levelpathi:
          description: NHDPlus int64 level path identifier.
          type: integer
          format: int64
        terminalpa:
          description: NHDPlus int64 terminal path identifier.
          type: integer
          format: int64
        uphydroseq:
          description: NHDPlus int64 upstream flowline hydro sequence identifier.
          type: integer
          format: int64
        dnhydroseq:
          description: NHDPlus int64 downstream flowline hydro sequence identifier.
          type: integer
          format: int64
        lengthkm:
          description: length of the navigated flowline in kilometers.
          type: number
        flowtimeday:
          description: flow time in days of the navigated flowline.
          type: number
        network_distancekm:
          description: total length from start to the navigated flowline in kilometers.
          type: number
        network_flowtimeday:
          description: total flow time in days from start to the navigated flowline.
          type: number
        permanent_identifier:
          description: NHD permanent identifier of the navigated flowline.
          type: ['string','null']
        reachcode:
          description: NHD reach code of the navigated flowline
          $ref: '#/components/schemas/reachcode'
        fcode:
          description: NHD feature type code of the navigated flowline.
          type: integer
          format: int32
        gnis_id:
          description: NHD GNIS identifier of the navigated flowline.
          type: string
        gnis_name:
          description: NHD GNIS name of the navigated flowline.
          type: string
        wbarea_permanent_identifier:
          description: NHD permanent identifier of the NHD waterbody feature associated with a flowline artificial path.
          type: string
        navtermination_flag:
          description: >
            Integer code providing information about the navigated flowline within the context of the navigation.
            Valid codes are:
            0. no termination
            1. full termination
            2. partial termination
            3. coastal termination
            4. headwater termination
            5. network end termination (non-coastal)
          type: integer
          format: int32
          enum:
          - 0
          - 1
          - 2
          - 3
          - 4
          - 5
        nav_order:
          description: rough ordering key placing flowlines in navigated order
          type: integer
          format: int32
    delineated_area_properties:
      type: object
      properties:
        areasqkm:
          type: number
        hydroseq:
          $ref: '#/components/schemas/hydroseq'
        sourcefc:
          description: identifier of the delineation area source.
          type: string
        nhdplusid:
          $ref: '#/components/schemas/nhdplusid'
    geojson_featurecollection:
      type: object
      title: GeoJSON Feature Collection
      description: GeoJSon Feature collection
      required:
       - type
       - features
      externalDocs:
        url: https://tools.ietf.org/html/rfc7946#section-3.3
      properties:
        type:
          type: string
          enum:
          - FeatureCollection
        features:
          type: array
          items:
            $ref: '#/components/schemas/geojson_feature'
    indexing_summary:
      description: short summary report of indexing results.
      type: object
      properties:
        input_features:
          type: object
          properties:
            point_count:
              type: integer
            line_count:
              type: integer
            area_count:
              type: integer
    snap_point_properties:
      type: object
      properties:
        nhdplus:
          description: NHDPlus int64 flowline identifier.
          type: integer
          format: int64
        reachcode:
          $ref: '#/components/schemas/reachcode'
        measure:
          $ref: '#/components/schemas/measure'
    snap_path_properties:
      type: object
      properties:
        nhdplus:
          description: NHDPlus int64 flowline identifier.
          type: integer
          format: int64
    reachcode:
      type: string
      minLength: 14
      maxLength: 14
    nhdplus_version:
      description: NHDPlus version used in CIP indexing.
      type: string
      enum:
      - nhdplus_m
      - nhdplus_h
      examples:
      - nhdplus_h
    search_type:
      description: |
        Navigation methodolody for network discovery of events:
        - UT = upstream with tributaries navigation
        - UM = upstream mainstem navigation
        - DM = downstream mainstem navigation
        - DD = downstream with divergences navigation
        - PP = point-to-point mainstem navigation
        - PPALL = point-to-point mainstem navigation with all streams between
      type: string
      enum:
      - UM
      - UT
      - DM
      - DD
      - PP
      - PPALL
      examples:
      - UT
    start_nhdplusid:
      description: NHDPlus flowline NHDPlusID bigint value from which to begin the navigation.
      type: integer
      format: int64
      examples:
      - 5000100000184
    start_permanent_identifier:
      description: NHD flowline permanent identifier string value from which to begin the navigation.  Permanent Identifiers may manifest as text forms of the NHDPlusID or as 40-byte guid values.
      type: string
      maxLength: 40
      examples:
      - '{5DC9D377-46F7-41FB-A258-7A9AF8307610}'
    start_reachcode:
      description: NHD flowline 14-byte reach code value from which to begin the navigation.  Provide a start measure to indicate a specific position on the reach.
      type: string
      minLength: 14
      maxLength: 14
      examples:
      - '01010007002110'
    start_hydroseq:
      description: NHDPlus flowline hydro sequence bigint value from which to begin the navigation.
      type: integer
      format: int64
      examples:
      - 5000100019676
    start_measure:
      description: NHD flowline measure from which to begin the navigation.
      type: number
      minimum: 0
      maximum: 100
      examples:
      - 50.0
    stop_nhdplusid:
      description: NHDPlus flowline NHDPlusID bigint value at which navigation will cease.  Only used in point-to-point navigation.
      type: integer
      format: int64
      examples:
      - 5000100000184
    stop_permanent_identifier:
      description: NHD flowline permanent identifier string value from which navigation will cease.  Only used in point-to-point navigation.
      type: string
      maxLength: 40
      examples:
      - '{46D7557F-A83A-4414-AE56-105167EE3502}'
    stop_reachcode:
      description: NHD flowline 14-byte reach code value from which navigation will cease.  Only used in point-to-point navigation.
      type: string
      minLength: 14
      maxLength: 14
      examples:
      - 188744699622
    stop_hydroseq:
      description: NHDPlus flowline hydro sequence bigint value at which navigation will cease.  Only used in point-to-point navigation.
      type: integer
      format: int64
      examples:
      - 5000100000184
    stop_measure:
      description: NHD flowline measure at which navigation will cease.  Only used in point-to-point navigation.
      type: number
      examples:
      - 45.23
    max_distancekm:
      description: Maximum distance traversed in kilometers for selecting features.
      type: number
      examples:
      - 15
    max_flowtimeday:
      description: Maximum flow time traversed in hours for selecting features.  May not apply with all NHDPlus versions.
      type: number
      examples:
      - 1.2567
    return_flowline_details:
      description: Switch whether to return flowline details with results.
      type: boolean
      default: true
      examples:
      - true
    return_flowline_geometry:
      description: Switch whether to return flowline geometry information with results.
      type: boolean
      default: true
      examples:
      - true
    return_code:
      description: Status code for results.  Zero indicates success.
      type: integer
      format: int32
      examples:
      - 0
    measure:
      type: number
      minimum: 0
      maximum: 100
    status_message:
      description: Status message describing the results of processing.  Null indicates success.
      type: ['string','null']
    flowline_count:
      description: Total count of flowlines returned from analysis.
      type: integer
      format: int32
    nhdplusid:
      description: NHDPlus int64 nhdplus identifier.
      type: integer
      format: int64
    hydroseq:
      description: NHDPlus int64 hydro sequence identifier.
      type: integer
      format: int64
    permanent_identifier:
      description: NHD permanent identifier of the navigated flowline.
      type: string
    globalid:
      type: string
      examples:
      - '{E374E06D-3A16-662D-E053-42DE4386FFB0}'
    known_region:
      description: >
          Provided value to use to determine the proper spatial reference system to use in geometric analysis.
          Providing an SRID value such as 5070 or a US state code such as MN will skip the sometimes expensive determination of the correct SRID for the feature.
          However, if the feature does not actually apply to the provide known_region hint, then indexing may fail or return incorrect results.
          If in doubt, leave this parameter blank.
      type: string