---
title: "Update a outbound rule"
method: POST
path: "/outbound_rules/{id}"
tags: ["Outbound Rule"]
---

# Update a outbound rule

`POST /outbound_rules/{id}`

## Request

- Base URL: `https://HOSTNAME:8887/api`
- URL: `https://HOSTNAME:8887/api/outbound_rules/{id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/portsip/apis/portsip-pbx-rest-api/docs/outbound_rules/:id/post.ts> (a function with typed inputs; its response is checked against the schema)

Update properties of outbound rule by it's unique ID.

## Path parameters

- `id` string, required: The unique ID of the resource.

## Request body

- object
  - `id` string: The unique ID of the resource.
  - `name` string: The name of outbound rule.
  - `number_prefix` string: Prefix of callee ID. Calls started with this prefix will be applied this outbound rule.
  - `number_length` string: The length of number prefix. A semicolon-separated list of integer. For example by specifying "1;2", calls with a caller ID of 1 or 2 digits will be applied this rule.
  - `number_mask` string: Extension who starts the call. A semicolon-separated list of extensions allowed. For example by specifying "101-110;199", extensions from 101 to 110 and 199 will be applied this rule.
  - `enabled` boolean: Whether to enable outbound rule.
  - `priority` integer: The priority of outbound rule.
  - `office_hours` object
    - `mode` 'GLOBAL' | 'CUSTOM': The office hours mode can be either: - `GLOBAL`: Use global office hours. - `CUSTOM`: Use specific office hours.
    - `monday` object
      - `enabled` boolean: When enabled, all day is working time, when disabled, all day is vacation time.
      - `ranges` object[]: Multiple start and end time periods make up the working time.
        - `from` string: The start time for office hour with format `HH:MM` in 24 hour clock, such as "09:00". Must be earlier than `to`.
        - `to` string: The start time for office hour with format `HH:MM` in 24 hour clock, such as "17:00". Must be later than `from`.
    - `tuesday` object
      - `enabled` boolean: When enabled, all day is working time, when disabled, all day is vacation time.
      - `ranges` object[]: Multiple start and end time periods make up the working time.
        - `from` string: The start time for office hour with format `HH:MM` in 24 hour clock, such as "09:00". Must be earlier than `to`.
        - `to` string: The start time for office hour with format `HH:MM` in 24 hour clock, such as "17:00". Must be later than `from`.
    - `wednesday` object
      - `enabled` boolean: When enabled, all day is working time, when disabled, all day is vacation time.
      - `ranges` object[]: Multiple start and end time periods make up the working time.
        - `from` string: The start time for office hour with format `HH:MM` in 24 hour clock, such as "09:00". Must be earlier than `to`.
        - `to` string: The start time for office hour with format `HH:MM` in 24 hour clock, such as "17:00". Must be later than `from`.
    - `thursday` object
      - `enabled` boolean: When enabled, all day is working time, when disabled, all day is vacation time.
      - `ranges` object[]: Multiple start and end time periods make up the working time.
        - `from` string: The start time for office hour with format `HH:MM` in 24 hour clock, such as "09:00". Must be earlier than `to`.
        - `to` string: The start time for office hour with format `HH:MM` in 24 hour clock, such as "17:00". Must be later than `from`.
    - `friday` object
      - `enabled` boolean: When enabled, all day is working time, when disabled, all day is vacation time.
      - `ranges` object[]: Multiple start and end time periods make up the working time.
        - `from` string: The start time for office hour with format `HH:MM` in 24 hour clock, such as "09:00". Must be earlier than `to`.
        - `to` string: The start time for office hour with format `HH:MM` in 24 hour clock, such as "17:00". Must be later than `from`.
    - `saturday` object
      - `enabled` boolean: When enabled, all day is working time, when disabled, all day is vacation time.
      - `ranges` object[]: Multiple start and end time periods make up the working time.
        - `from` string: The start time for office hour with format `HH:MM` in 24 hour clock, such as "09:00". Must be earlier than `to`.
        - `to` string: The start time for office hour with format `HH:MM` in 24 hour clock, such as "17:00". Must be later than `from`.
    - `sunday` object
      - `enabled` boolean: When enabled, all day is working time, when disabled, all day is vacation time.
      - `ranges` object[]: Multiple start and end time periods make up the working time.
        - `from` string: The start time for office hour with format `HH:MM` in 24 hour clock, such as "09:00". Must be earlier than `to`.
        - `to` string: The start time for office hour with format `HH:MM` in 24 hour clock, such as "17:00". Must be later than `from`.
  - `holidays` string[]: A collection ID of tenant's holidays.
  - `routing_strategy` 'PRIORITIZED' | 'RANDOMLY': Routing strategy: Can be either: - `PRIORITIZED`: Selected according to the priority order of the route list. - `RANDOMLY`: Randomly select one of the route list.
  - `routes` object[]
    - `enabled` boolean: Enable this route or not.
    - `provider_id` string: The unique ID of the resource.
    - `strip_digits` integer: Digits for striping number. Values: 0-9. For example if it is set to 2, the first two digits for caller ID of calling from route_provider_1 will be removed.
    - `prepend` string: Prefix number. If it is set to "0086", call ID for calling from route_provider_1 will be prefixed with "0086".
    - `outbound_caller_id` string: Outbound caller id.

## Response `200`

OK

## Other responses

- `4XX`: Error

---

[API](https://skmtc.dev/portsip/apis/portsip-pbx-rest-api.md) - [All operations](https://skmtc.dev/portsip/apis/portsip-pbx-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/portsip/apis/portsip-pbx-rest-api/revisions/577415d4a3d5?raw)
