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

# List access rules for this network

> Lists the access rules on a network. A network with no rules shows everything; the moment you add the first rule, the network switches to showing only what the rules allow. Filter by validity to see only rules that are currently in effect, scheduled to start in the future, or already expired.



## OpenAPI

````yaml /openapi/emsp-network/openapi.yaml get /emsp/v1/networks/{network_id}/rules
openapi: 3.0.0
info:
  title: Spirii EMSP - Network & Access Control API
  description: >-
    Manages network access and location visibility for secure multi-tenant
    operation.
  version: v1
  contact: {}
servers:
  - url: https://api.spirii.com
    description: Production
security:
  - OAuth2ClientCredentials: []
tags:
  - name: Networks
    description: Network lifecycle management
paths:
  /emsp/v1/networks/{network_id}/rules:
    get:
      tags:
        - Networks
      summary: List access rules for this network
      description: >-
        Lists the access rules on a network. A network with no rules shows
        everything; the moment you add the first rule, the network switches to
        showing only what the rules allow. Filter by validity to see only rules
        that are currently in effect, scheduled to start in the future, or
        already expired.
      operationId: NetworkController_listRules_v1
      parameters:
        - name: Idempotency-Key
          in: header
          description: >-
            Client-generated unique key per operation intent (UUID). Same key +
            identical body replays the original response; same key + different
            body returns 409.
          required: true
          schema:
            type: string
            format: uuid
        - name: network_id
          required: true
          in: path
          description: The unique ID of the network whose access rules to list.
          schema:
            type: string
            format: uuid
        - name: after
          required: false
          in: query
          description: >-
            Cursor to start fetching records after — the `pagination.end_cursor`
            of a previous response. Omit it to fetch the first page, and stop
            paging once `pagination.has_next` is false. Sending it empty is a
            400: an empty cursor is a broken cursor, not a request for the first
            page.
          schema:
            minLength: 1
            type: string
        - name: cursor
          required: false
          in: query
          deprecated: true
          description: 'Deprecated: use `after`.'
          schema:
            minLength: 1
            type: string
        - name: limit
          required: false
          in: query
          description: Results per page (1–200)
          schema:
            default: 50
            type: number
        - name: validity
          required: false
          in: query
          description: >-
            Filter by rule timing — EFFECTIVE for rules in effect now, FUTURE
            for rules not yet started, EXPIRED for rules that have already
            ended.
          schema:
            type: string
            enum:
              - EFFECTIVE
              - FUTURE
              - EXPIRED
      responses:
        '200':
          description: Paginated list of access rules on the network.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedEnvelope'
                  - type: object
                    required:
                      - data
                    properties:
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/AccessRuleResponse'
components:
  schemas:
    PaginatedEnvelope:
      type: object
      properties:
        pagination:
          description: Pagination state for this page.
          allOf:
            - $ref: '#/components/schemas/PaginationMetaResponse'
        next_cursor:
          type: string
          nullable: true
          example: null
          deprecated: true
          description: 'Deprecated: use `pagination.end_cursor`.'
        has_next:
          type: boolean
          example: false
          deprecated: true
          description: 'Deprecated: use `pagination.has_next`.'
      required:
        - pagination
        - next_cursor
        - has_next
    AccessRuleResponse:
      type: object
      properties:
        rule_id:
          type: string
          format: uuid
          description: Access rule identifier.
        emp_identity_id:
          type: string
          format: uuid
          description: emp_identity the rule belongs to.
        tenant_id:
          type: string
          format: uuid
          description: Owning tenant identifier.
        rule_type:
          description: Whether the rule includes or excludes.
          allOf:
            - $ref: '#/components/schemas/AccessRuleType'
        network_id:
          type: string
          format: uuid
          description: Network the rule applies to.
        location_ids:
          nullable: true
          description: >-
            Locations the rule targets; null when the rule is not
            location-scoped.
          type: array
          items:
            type: string
            format: uuid
        priority:
          type: number
          description: Evaluation priority (lower wins).
        effective_from:
          type: string
          format: date
          description: Date from which the rule is effective (UTC).
        effective_until:
          type: string
          format: date
          nullable: true
          description: Date the rule stops being effective (UTC); null means open-ended.
        created_at:
          type: string
          format: date-time
          description: Creation timestamp (UTC).
        updated_at:
          type: string
          format: date-time
          description: Last-update timestamp (UTC).
      required:
        - rule_id
        - emp_identity_id
        - tenant_id
        - rule_type
        - network_id
        - location_ids
        - priority
        - effective_from
        - effective_until
        - created_at
        - updated_at
    PaginationMetaResponse:
      type: object
      properties:
        end_cursor:
          type: string
          nullable: true
          example: null
          description: >-
            Cursor for the end of the current page. Pass it back as `after` to
            fetch the next page; null on the last page.
        has_next:
          type: boolean
          example: false
          description: Whether there are more records to fetch.
      required:
        - end_cursor
        - has_next
    AccessRuleType:
      type: string
      enum:
        - EXCLUDE_LOCATIONS
        - INCLUDE_LOCATIONS
      description: Whether the rule includes or excludes.
  securitySchemes:
    OAuth2ClientCredentials:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: /oauth/token
          scopes:
            emsp:networks:read: View network and access control configuration
            emsp:networks:write: Create/update/delete SUB networks, manage access rules
            emsp:networks:publish: Publish/drain networks (PATCH /networks/:id/publish-state)

````