---
title: "Create Company Call Handling Rule"
method: POST
path: "/restapi/v1.0/account/{accountId}/answering-rule"
tags: ["Call Handling Rules"]
---

# Create Company Call Handling Rule

`POST /restapi/v1.0/account/{accountId}/answering-rule`

Creates call handling rule on account level.

## Path parameters

- `accountId` string, required

## Request body

- CompanyAnsweringRuleRequest
  - `name` string — Name of an answering rule specified by user. Max number of symbols is 30. The default value is 'My Rule N' where 'N' is the first free number
  - `enabled` boolean — Specifies if the rule is active or inactive. The default value is `true`
  - `type` 'BusinessHours' | 'AfterHours' | 'Custom' — Type of an answering rule, the default value is 'Custom' = ['BusinessHours', 'AfterHours', 'Custom']
  - `callers` CompanyAnsweringRuleCallersInfoRequest[] — Answering rule will be applied when calls are received from the specified caller(s)
    - `callerId` string — Phone number of a caller
    - `name` string — Displayed name for a caller ID
  - `calledNumbers` CompanyAnsweringRuleCalledNumberInfo[] — Answering rule will be applied when calling the specified number(s)
    - `id` string — Internal identifier of an account phone number
    - `phoneNumber` string — Phone number of a callee
  - `schedule` CompanyAnsweringRuleScheduleInfoRequest — Schedule when an answering rule should be applied
    - `weeklyRanges` CompanyAnsweringRuleWeeklyScheduleInfoRequest — Weekly schedule. If specified, ranges cannot be specified
      - `monday` CompanyAnsweringRuleTimeIntervalRequest[] — Time interval for a particular day
        - `from` string — Time in format hh:mm
        - `to` string — Time in format hh:mm
      - `tuesday` CompanyAnsweringRuleTimeIntervalRequest[] — Time interval for a particular day
        - `from` string — Time in format hh:mm
        - `to` string — Time in format hh:mm
      - `wednesday` CompanyAnsweringRuleTimeIntervalRequest[] — Time interval for a particular day
        - `from` string — Time in format hh:mm
        - `to` string — Time in format hh:mm
      - `thursday` CompanyAnsweringRuleTimeIntervalRequest[] — Time interval for a particular day
        - `from` string — Time in format hh:mm
        - `to` string — Time in format hh:mm
      - `friday` CompanyAnsweringRuleTimeIntervalRequest[] — Time interval for a particular day
        - `from` string — Time in format hh:mm
        - `to` string — Time in format hh:mm
      - `saturday` CompanyAnsweringRuleTimeIntervalRequest[] — Time interval for a particular day
        - `from` string — Time in format hh:mm
        - `to` string — Time in format hh:mm
      - `sunday` CompanyAnsweringRuleTimeIntervalRequest[] — Time interval for a particular day
        - `from` string — Time in format hh:mm
        - `to` string — Time in format hh:mm
    - `ranges` RangesInfo[] — Specific data ranges. If specified, weeklyRanges cannot be specified
      - `from` string, date-time — Beginning timestamp of the range in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601), for example *2018-10-29T14:00:00*, *2018-10-29T14:00:00Z*, *2018-10-29T14:00:00+0100*
      - `to` string, date-time — Ending timestamp of the range in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601), for example *2018-10-29T14:00:00*, *2018-10-29T14:00:00Z*, *2018-10-29T14:00:00+0100*
    - `ref` 'BusinessHours' | 'AfterHours' — Reference to Business Hours or After Hours schedule
  - `callHandlingAction` 'Operator' | 'Disconnect' | 'Bypass' — Specifies how incoming calls are forwarded. The default value is 'Operator' 'Operator' - play company greeting and forward to operator extension 'Disconnect' - play company greeting and disconnect 'Bypass' - bypass greeting to go to selected extension = ['Operator', 'Disconnect', 'Bypass']
  - `extension` CompanyAnsweringRuleExtensionInfoRequest — Extension to which the call is forwarded in 'Bypass' mode
    - `id` string — Internal identifier of an extension
  - `greetings` GreetingInfo[] — Greetings applied for an answering rule; only predefined greetings can be applied, see Dictionary Greeting List
    - `type` 'Introductory' | 'Announcement' | 'AutomaticRecording' | 'BlockedCallersAll' | 'BlockedCallersSpecific' | 'BlockedNoCallerId' | 'BlockedPayPhones' | 'ConnectingMessage' | 'ConnectingAudio' | 'StartRecording' | 'StopRecording' | 'Voicemail' | 'Unavailable' | 'InterruptPrompt' | 'HoldMusic' | 'Company' — Type of greeting, specifying the case when the greeting is played.
    - `preset` PresetInfo
      - `uri` string, uri — Link to a greeting resource
      - `id` string — Internal identifier of a greeting
      - `name` string — Name of a greeting
    - `custom` CustomGreetingInfoRequest
      - `id` string — Internal identifier of a custom user greeting

## Response `200`

OK

- CompanyAnsweringRuleInfo
  - `id` string — Internal identifier of an answering rule
  - `uri` string, uri — Canonical URI of an answering rule
  - `enabled` boolean — Specifies if the rule is active or inactive
  - `type` 'BusinessHours' | 'AfterHours' | 'Custom' — Type of an answering rule
  - `name` string — Name of an answering rule specified by user. Max number of symbols is 30. The default value is 'My Rule N' where 'N' is the first free number
  - `callers` CompanyAnsweringRuleCallersInfoRequest[] — Answering rule will be applied when calls are received from the specified caller(s)
    - `callerId` string — Phone number of a caller
    - `name` string — Displayed name for a caller ID
  - `calledNumbers` CompanyAnsweringRuleCalledNumberInfoRequest[] — Answering rule will be applied when calling the specified number(s)
    - `id` string — Internal identifier of an account phone number
    - `phoneNumber` string — Phone number of a callee
  - `schedule` CompanyAnsweringRuleScheduleInfo — Schedule when an answering rule should be applied
    - `weeklyRanges` CompanyAnsweringRuleWeeklyScheduleInfoRequest — Weekly schedule. If specified, ranges cannot be specified
      - `monday` CompanyAnsweringRuleTimeIntervalRequest[] — Time interval for a particular day
        - `from` string — Time in format hh:mm
        - `to` string — Time in format hh:mm
      - `tuesday` CompanyAnsweringRuleTimeIntervalRequest[] — Time interval for a particular day
        - `from` string — Time in format hh:mm
        - `to` string — Time in format hh:mm
      - `wednesday` CompanyAnsweringRuleTimeIntervalRequest[] — Time interval for a particular day
        - `from` string — Time in format hh:mm
        - `to` string — Time in format hh:mm
      - `thursday` CompanyAnsweringRuleTimeIntervalRequest[] — Time interval for a particular day
        - `from` string — Time in format hh:mm
        - `to` string — Time in format hh:mm
      - `friday` CompanyAnsweringRuleTimeIntervalRequest[] — Time interval for a particular day
        - `from` string — Time in format hh:mm
        - `to` string — Time in format hh:mm
      - `saturday` CompanyAnsweringRuleTimeIntervalRequest[] — Time interval for a particular day
        - `from` string — Time in format hh:mm
        - `to` string — Time in format hh:mm
      - `sunday` CompanyAnsweringRuleTimeIntervalRequest[] — Time interval for a particular day
        - `from` string — Time in format hh:mm
        - `to` string — Time in format hh:mm
    - `ranges` RangesInfo[] — Specific data ranges. If specified, weeklyRanges cannot be specified
      - `from` string, date-time — Beginning timestamp of the range in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601), for example *2018-10-29T14:00:00*, *2018-10-29T14:00:00Z*, *2018-10-29T14:00:00+0100*
      - `to` string, date-time — Ending timestamp of the range in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601), for example *2018-10-29T14:00:00*, *2018-10-29T14:00:00Z*, *2018-10-29T14:00:00+0100*
    - `ref` 'BusinessHours' | 'AfterHours' — Reference to Business Hours or After Hours schedule = ['BusinessHours', 'AfterHours']
  - `callHandlingAction` 'Operator' | 'Disconnect' | 'Bypass' — Specifies how incoming calls are forwarded. The default value is 'Operator' 'Operator' - play company greeting and forward to operator extension 'Disconnect' - play company greeting and disconnect 'Bypass' - bypass greeting to go to selected extension = ['Operator', 'Disconnect', 'Bypass']
  - `extension` CompanyAnsweringRuleExtensionInfoRequest — Extension to which the call is forwarded in 'Bypass' mode
    - `id` string — Internal identifier of an extension
  - `greetings` GreetingInfo[] — Greetings applied for an answering rule; only predefined greetings can be applied, see Dictionary Greeting List
    - `type` 'Introductory' | 'Announcement' | 'AutomaticRecording' | 'BlockedCallersAll' | 'BlockedCallersSpecific' | 'BlockedNoCallerId' | 'BlockedPayPhones' | 'ConnectingMessage' | 'ConnectingAudio' | 'StartRecording' | 'StopRecording' | 'Voicemail' | 'Unavailable' | 'InterruptPrompt' | 'HoldMusic' | 'Company' — Type of greeting, specifying the case when the greeting is played.
    - `preset` PresetInfo
      - `uri` string, uri — Link to a greeting resource
      - `id` string — Internal identifier of a greeting
      - `name` string — Name of a greeting
    - `custom` CustomGreetingInfoRequest
      - `id` string — Internal identifier of a custom user greeting

## Other responses

- `400` — General response with **HTTP 400 "Bad request"** status.<br> Reasons: unparsable request, path, query or body parameters are invalid. The error description may contain reference to particular parameter(s) which haven't passed the validation.
- `404` — General response with **HTTP 404 "Not found"** status.<br> Reasons: the entity with given ID (typically specified in a path parameter), is not found or inaccessible
- `500` — General response with **HTTP 500 "Internal Server Error"** status.<br> Reasons: general server-side error.
- `503` — General response with **HTTP 503 "Service not available"** status.<br> Reasons: server cannot process the request because of being overloaded, misconfiguration or other issues.

---

[API](https://skmtc.net/ringcentral/apis/ringcentral-api.md) · [All operations](https://skmtc.net/ringcentral/apis/ringcentral-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ringcentral/ringcentral-api/versions/8d602198ec97/schema)
