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

# List routing rules

> Lists your routing rules, newest first.



## OpenAPI

````yaml /api-reference/rest/openapi.yaml get /v2/sip/routing-rule
openapi: 3.1.0
info:
  title: Zero Runtime REST API
  version: '1.0'
  description: >-
    Create, configure, version and deploy agents, and wire SIP telephony to
    them.
servers:
  - url: https://api.zeroruntime.ai
security:
  - token: []
tags:
  - name: Agents
  - name: Versions
  - name: Deployment
  - name: Phone numbers
  - name: Routing rules
  - name: Calls
  - name: Batch calls
  - name: Knowledge bases
  - name: Knowledge base folders
paths:
  /v2/sip/routing-rule:
    get:
      tags:
        - Routing rules
      summary: List routing rules
      description: Lists your routing rules, newest first.
      parameters:
        - name: page
          in: query
          schema:
            type: integer
            default: 1
        - name: perPage
          in: query
          schema:
            type: integer
            default: 10
        - name: search
          in: query
          description: Case-insensitive match on name or on any attached number.
          schema:
            type: string
        - name: type
          in: query
          description: '`inbound` or `outbound`. Anything else is ignored.'
          schema:
            type: string
            enum:
              - inbound
              - outbound
        - name: ruleIds
          in: query
          description: Comma-separated or repeated, e.g. `rr_8k2m1x,rr_3b9d0c`.
          schema:
            type: string
        - name: roomType
          in: query
          description: '`static`, `dynamic`, or both comma-separated.'
          schema:
            type: string
      responses:
        '200':
          description: A page of rules.
          content:
            application/json:
              schema:
                type: object
                properties:
                  pageInfo:
                    $ref: '#/components/schemas/PageInfo'
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/RoutingRule'
components:
  schemas:
    PageInfo:
      type: object
      properties:
        currentPage:
          type: integer
          example: 1
        perPage:
          type: integer
          example: 20
        lastPage:
          type: integer
          example: 1
        total:
          type: integer
          example: 2
    RoutingRule:
      allOf:
        - type: object
          properties:
            id:
              type: string
              example: rr_8k2m1x
            type:
              type: string
              enum:
                - inbound
                - outbound
            numbers:
              type: array
              items:
                type: string
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
        - $ref: '#/components/schemas/RoutingRuleInput'
    RoutingRuleInput:
      type: object
      properties:
        name:
          type: string
        phoneNumbers:
          type: array
          items:
            type: string
          description: >-
            E.164 numbers already on your account. Leave it out to attach
            numbers later.
        apiKey:
          type: string
          description: >-
            Optional. On create, leave it out to use the API key of the token
            you call with.
        agentId:
          type: string
          description: Agent to dispatch. Omit to dispatch none.
        agentMetadata:
          type: object
          additionalProperties:
            type: string
          description: Flat string map handed to the agent.
        room:
          $ref: '#/components/schemas/Room'
        includeHeaders:
          type: string
          enum:
            - ALL
            - SIP_X_HEADERS
            - NONE
          default: NONE
        headers:
          type: object
          additionalProperties:
            type: string
          description: Outbound only. Extra SIP headers to send.
        headersToAttributes:
          type: object
          additionalProperties:
            type: string
          description: Inbound only. Maps an incoming header onto a call attribute.
        allowedNumbers:
          type: array
          items:
            type: string
          description: Empty means no restriction.
        allowedIpAddresses:
          type: array
          items:
            type: string
          description: Empty means no restriction.
        tags:
          type: array
          items:
            type: string
        recording:
          type: boolean
          default: false
        dtmf:
          type: boolean
          default: false
        noiseCancellation:
          type: boolean
          default: false
        hidePhoneNumber:
          type: boolean
          default: false
    Room:
      type: object
      default:
        type: dynamic
        prefix: blank
      properties:
        type:
          type: string
          enum:
            - dynamic
            - static
        prefix:
          type: string
          enum:
            - blank
            - participantNumber
            - sipNumber
            - random
        id:
          type: string
          description: Static rooms only.
        pin:
          type: string
          description: Static rooms only.
  securitySchemes:
    token:
      type: apiKey
      in: header
      name: Authorization
      description: Your API token, sent raw (no `Bearer` prefix).
      x-default: <auth-token>

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.