---
title: "Create Route for extension"
method: POST
path: "/v4/accounts/{voip_id}/extensions/{extension_id}/routes"
tags: ["Routes"]
---

# Create Route for extension

`POST /v4/accounts/{voip_id}/extensions/{extension_id}/routes`

## Request

- Base URL: `https://api.phone.com`
- URL: `https://api.phone.com/v4/accounts/{voip_id}/extensions/{extension_id}/routes`
- Auth: HTTP bearer

Add a new route to the extension

## Path parameters

- `voip_id` integer, required
- `extension_id` integer, required

## Request body

- Route
  - `name` string, nullable: Route Name
  - `rules` object[], required: Array of Rule Set Objects
    - `filter` object, nullable: Rule filter (apply rule only if it matches the filter)
      - `type` string, nullable: Filter type
      - `schedule` object, nullable: Schedule object for being used as a filter
        - `id` integer, nullable: Schedule ID
        - `name` string, nullable: Schedule name
      - `group` object, nullable: Contacts group object for being used as a filter
        - `id` integer, nullable: Contacts group ID
        - `name` string, nullable: Contacts group name
      - `contact` object, nullable: Contact object for being used as a filter
        - `id` integer, nullable: Contact ID
        - `name` string, nullable: Contact name
    - `actions` object[], required: Array of Action Objects
      - `action` 'abcn_queue' | 'directory' | 'disconnect' | 'fax' | 'forward' | 'greeting' | 'hold' | 'menu' | 'queue' | 'trunk' | 'voicemail' | 'live_answer', required: Routing action
      - `timeout` integer, nullable: Timeout for the action
      - `items` object[], nullable: Array of Forward Item Objects
        - `type` 'phone_number' | 'extension', nullable: Must equal phone_number or extension
        - `number` string, nullable: Required if type = 'phone_number'. Phone number that callers should be directed to
        - `extension` object, nullable: Required if type = 'extension'. Extension that callers should be directed to
          - `id` integer, nullable: ID of the extension
          - `extension` integer, nullable: Extension number that callers may dial
          - `name` string, nullable: User-supplied name for the extension
        - `caller_id` string, nullable: Must equal calling_number or called_number. Defines which phone number should be used for Caller ID
        - `voice_tag` string, nullable: Optional string. If screening = TRUE, this value will be passed into our Text-To-Speech engine and used to inform the caller of who they have reached
        - `distinctive_ring` string, nullable: Must equal one of: DEFAULT, STYLE_2, STYLE_3, STYLE_4, STYLE_5, STYLE_6, STYLE_7, STYLE_8, or STYLE_9. Identifies the style of ring tone you will hear when an incoming call is waiting
      - `queue` object, nullable: Queue that this action refers to. Input must be a Queue Lookup Object.
        - `id` integer, nullable: Queue ID
      - `menu` object, nullable: Menu that this action refers to. Input must be a Menu Lookup Object.
        - `id` integer, nullable: Menu ID
      - `greeting` object, nullable: Greeting that this action refers to. Input must be a Media Lookup Object. Must refer to a media recording that has is_hold_music set to FALSE
        - `id` integer, nullable: Media ID
      - `hold_music` object, nullable: Hold Music to be played while callers are waiting. Input must be a Media Lookup Object. Must refer to a media recording that has is_hold_music set to TRUE. Default is to play a standard ring tone
        - `id` integer, nullable: Media ID
        - `duration` integer, nullable: Duration
      - `trunk` object, nullable: Trunk that this action refers to. Input must be a Trunk Lookup Object.
        - `id` integer, nullable: Trunk ID
      - `extension` object, nullable: Extension that this action refers to. Input must be an Extension Lookup Object
        - `id` integer, nullable: Extension ID
      - `voice_tag` string, nullable: Voice tag
      - `script` object, nullable: Live receptionist script
        - `id` integer, nullable: ID of live receptionist script
  - `extension` object, nullable: Extension to which this route belongs
    - `id` integer, nullable: Extension ID
    - `extension` integer, nullable: Extension number
    - `name` string, nullable: Extension name

## Response `201`

Created

- object

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `402`: Payment Required
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `422`: Validation failed
- `429`: Too Many Requests
- `500`: Internal Server Error

---

[API](https://skmtc.dev/phone/apis/phoenix-api-by-phone-com.md) · [All operations](https://skmtc.dev/phone/apis/phoenix-api-by-phone-com/llms.txt) · [OpenAPI document](https://skmtc.dev/phone/apis/phoenix-api-by-phone-com/revisions/a6274ad4319c?raw)
