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

# List menu options

> Flattens the phone-menu tree of the line's published call flow. Each option carries a ready `MENU_BRANCH` condition. A line without a phone menu, or whose calls are not routed by the call-flow engine, returns an empty list. Menu conditions are only accepted on lines where this list is not empty.

> [!NOTE]
>
> **Required scope:** `INBOXES_READ`

## Behavior

Flattens the phone-menu tree of the line's **published** call flow. Drafts are ignored. Each option gives:

* `path`: the menu choices from the first menu down to this option.
* `digits`: the same path as keys, for example `1>2`.
* `label`: the option's name in the call flow.
* `condition`: a ready `MENU_BRANCH` condition for this option. It is always a `MENU_BRANCH`.

A line without a phone menu returns an empty list, and so does a line whose calls are not routed by the call-flow engine. Menu conditions are only accepted on lines where this list is not empty, and only with paths from it. On any other line, use a whole-line source with empty `conditions`.

Use it only to build a custom branch. For the common case, start from [Get inbox suggestions](https://help.withallo.com/en/v2/api-reference/inboxes/get-inbox-suggestions.md).

## Combine several options

A line appears once in `sources`, with at most one `MENU_BRANCH`. To cover several options of the same line, concatenate the `branches` of their conditions into one `MENU_BRANCH`:

```json theme={null}
{
  "allo_number": "+33612345678",
  "conditions": [
    {
      "type": "MENU_BRANCH",
      "branches": [
        [{"node_id": "node-1", "digit": "1"}, {"node_id": "node-3", "digit": "2"}],
        [{"node_id": "node-1", "digit": "2"}]
      ],
      "include_no_choice": false
    }
  ]
}
```

## Errors

| Status | Code | When |
| - | - | - |
| `403` | `ALLO_NUMBER_FORBIDDEN` | The caller cannot access this line |


## OpenAPI

````yaml GET /v2/api/numbers/{number}/menu_options
openapi: 3.0.3
info:
  title: Allo API
  description: >-
    Allo API provides programmatic access to your Allo account, allowing you to
    manage webhooks, retrieve calls and contacts, and send SMS messages.


    All requests to `/v1/api/**` endpoints automatically go through quota
    checking and scope validation.
  version: 1.0.0
  contact:
    name: Allo Support
servers:
  - url: https://api.withallo.com
    description: Production server
security: []
tags:
  - name: Summary Templates
    description: >-
      Manage call summary templates that control how AI-generated call summaries
      are structured for your team.
  - name: Webhooks
    description: >-
      Manage webhook endpoints to receive real-time notifications about events
      in your Allo account. Each endpoint subscribes to one or more event topics
      and is verified with a signing secret.
  - name: Calls
    description: >-
      Retrieve and search call records with filtering and pagination. Filter
      calls by your Allo phone number.
  - name: Contacts
    description: >-
      Search and retrieve contact information with sorting and pagination.
      Includes engagement level tracking.
  - name: SMS
    description: Send SMS messages to phone numbers using your Allo numbers.
  - name: Phone Numbers
    description: Retrieve information about your Allo phone numbers.
  - name: Analytics
    description: Pre-computed call metrics, team performance, and outbound dial funnel
  - name: CRM
    description: Manage people, companies, and deals in your CRM.
  - name: Notes
    description: >-
      Internal team notes on conversations and CRM people, with @mention
      support. Notes are never visible to the contact.
  - name: Threads
    description: >-
      Team discussion threads attached to a conversation item (call, SMS, or
      conversation note). One thread per item.
  - name: AI Receptionist
    description: >-
      Read and write the AI receptionist configuration of a phone line: business
      details, voice, prompt, capabilities, business hours, transfer rules,
      scheduling calendars and knowledge sources.
  - name: Inboxes
    description: >-
      Personal inboxes: saved views of one or more lines, optionally narrowed to
      phone-menu options, with their own filters and notification setting.
paths:
  /v2/api/numbers/{number}/menu_options:
    get:
      tags:
        - Inboxes
      summary: List menu options
      description: >-
        Flattens the phone-menu tree of the line's published call flow. Each
        option carries a ready `MENU_BRANCH` condition. A line without a phone
        menu, or whose calls are not routed by the call-flow engine, returns an
        empty list. Menu conditions are only accepted on lines where this list
        is not empty.
      operationId: listMenuOptions
      parameters:
        - name: number
          in: path
          required: true
          description: Allo line in E.164 format. URL-encode the `+` as `%2B`.
          schema:
            type: string
            example: '+33612345678'
      responses:
        '200':
          description: Menu options
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/MenuOption'
              example:
                data:
                  - node_id: node-1
                    path:
                      - node_id: node-1
                        digit: '1'
                    digits: '1'
                    label: Website FR
                    condition:
                      type: MENU_BRANCH
                      branches:
                        - - node_id: node-1
                            digit: '1'
                      include_no_choice: false
                  - node_id: node-3
                    path:
                      - node_id: node-1
                        digit: '1'
                      - node_id: node-3
                        digit: '2'
                    digits: 1>2
                    label: Sales
                    condition:
                      type: MENU_BRANCH
                      branches:
                        - - node_id: node-1
                            digit: '1'
                          - node_id: node-3
                            digit: '2'
                      include_no_choice: false
        '401':
          $ref: '#/components/responses/ApiUnauthorized'
        '403':
          $ref: '#/components/responses/ApiForbidden'
        '429':
          $ref: '#/components/responses/ApiRateLimited'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    MenuOption:
      type: object
      properties:
        node_id:
          type: string
          description: The menu node of the last step.
          example: node-7
        path:
          type: array
          items:
            $ref: '#/components/schemas/InboxMenuBranchStep'
          description: Menu choices from the first menu down to this option.
        digits:
          type: string
          description: The same path as keys, separated by `>`.
          example: 1>2
        label:
          type: string
          example: Sales
        condition:
          allOf:
            - $ref: '#/components/schemas/InboxCondition'
          description: A ready `MENU_BRANCH` condition for this option.
      required:
        - node_id
        - path
        - digits
        - label
        - condition
    InboxMenuBranchStep:
      type: object
      properties:
        node_id:
          type: string
          description: ID of the phone-menu node in the line's published call flow.
          example: node-3
        digit:
          type: string
          pattern: ^[0-9*#]$
          description: Key pressed at that menu.
          example: '2'
      required:
        - node_id
        - digit
    InboxCondition:
      description: >-
        Narrows a source to calls that went through part of the line's phone
        menu. A source holds at most 10 conditions, and an inbox at most 60 menu
        steps in all.
      oneOf:
        - $ref: '#/components/schemas/InboxMenuOptionCondition'
        - $ref: '#/components/schemas/InboxMenuBranchCondition'
      discriminator:
        propertyName: type
        mapping:
          MENU_OPTION: '#/components/schemas/InboxMenuOptionCondition'
          MENU_BRANCH: '#/components/schemas/InboxMenuBranchCondition'
    ApiError:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
            code:
              type: string
            message:
              type: string
            retryable:
              type: boolean
            request_id:
              type: string
            retry_after_seconds:
              type: integer
              nullable: true
    InboxMenuOptionCondition:
      type: object
      description: Matches keys of one phone menu.
      properties:
        type:
          type: string
          enum:
            - MENU_OPTION
        node_id:
          type: string
          description: The menu node.
          example: node-3
        digits:
          type: array
          items:
            type: string
            pattern: ^[0-9]$
          description: >-
            Keys that match, distinct. May be `[]` only when `include_no_choice`
            is `true`, to match calls that reached the menu without pressing a
            key.
          example:
            - '1'
        include_no_choice:
          type: boolean
          description: Also match calls that reached the menu without pressing a key.
          example: false
      required:
        - type
        - node_id
        - digits
        - include_no_choice
    InboxMenuBranchCondition:
      type: object
      description: >-
        Matches any of several paths through the line's phone menus. To combine
        several options of one line, put all their paths in `branches`.
      properties:
        type:
          type: string
          enum:
            - MENU_BRANCH
        branches:
          type: array
          minItems: 1
          maxItems: 20
          description: >-
            Each branch lists the menu choices from the first menu down to the
            option picked.
          items:
            type: array
            minItems: 1
            maxItems: 6
            items:
              $ref: '#/components/schemas/InboxMenuBranchStep'
        include_no_choice:
          type: boolean
          description: Also match calls that reached the menu without pressing a key.
          example: false
      required:
        - type
        - branches
        - include_no_choice
  responses:
    ApiUnauthorized:
      description: Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    ApiForbidden:
      description: API key lacks the required scope or access to the resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    ApiRateLimited:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````

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