Configure Outbound Call Minute Restrictions for a Cloud PBX

Configure the outbound call minute restriction for a specific Cloud PBX.

Request URL

PUT {base_url}/dm/open_api/v1/cloud_pbx/instances/{cloudPbxId}/change_call_restriction

Request parameters

Path parameter
Parameter Required Type Description
cloudPbxId Yes Long The ID of the Cloud PBX.
Note: You can query the Cloud PBX ID using Query All the Cloud PBXs.
Headers
Parameter Required Type Description
Authorization Yes String Pass the access token in the header.

Format: Bearer {access_token}.

Body
Parameter Required Type Description
callRestrictionType No String The call type to be restricted.

Valid value: outbound_call

callMinutesRestriction No Integer The maximum number of outbound call minutes allowed on the PBX within the time cycle.
Valid value:
  • 0: Unlimited.
  • A value greater than 0.
timeCycle No String The time cycle for calculating outbound call minutes.
Valid value:
  • monthly: The system calculates outbound call minutes for the current month and resets the used minutes to 0 at the beginning of the next month.
callMinutesExceedAction No String Specify whether the PBX can initiate outbound calls when the outbound call minutes exceed the value of callMinutesRestriction within the time cycle.
Valid value:
  • allow: The PBX can initiate outbound calls.
  • restrict: The PBX cannot initiate outbound calls.
Note: This parameter must be set to allow when callMinutesRestriction is set to 0.
callMinutesWarningPercent No String The thresholds at which a Call Minutes Alert event notification is triggered.
Valid value:
  • 50
  • 60
  • 70
  • 80
  • 90
  • 100
Note: Use a comma to separate multiple values.

Response parameters

Parameter Type Description
requestId String The unique ID of the request, which can be used to quickly locate the request.
status String Request result:
  • Success
  • Failed
time Long The response time.
Note: The YCM API response returns a timestamp, you can convert the timestamp to detailed date and time as needed. For more information, see Convert Timestamp to Local Date and Time.

Example

Request example

PUT /dm/open_api/v1/cloud_pbx/instances/42100/change_call_restriction HTTP/1.1
Host: ycm.yeastar.com
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21Kd3RQYXlsb2FkSW5mbyI6eyJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJ5c0lkIjoxNzg5NjM2MDM5MDg1MDI1NjY0NSwidmVyc2lvbiI6MTY2Mzc0MTEyNSwicmVmcmVzaFZlcnNpb24iOjE2NjQ1MTY5MjJ9LCJzY29wZSI6WyJhbGwiXSwiZXhwIjoxNjY0NTE4NzIyLCJhdXRob3JpdGllcyI6WyJST0xFX0NMSUVOVCJdLCJqdGkiOiI1NmZhYTE0Ni0wZjUyLTRhYjEtYjkyNy1jNDZiMjRkNjc1MTYiLCJjbGllbnRfaWQiOiJ5QXN4ZzdITkRFczNxSHprQk1aUU5Pblo2NTBPRUNNWSJ9.jOfSRWoL0lXUd3_xRsVpvymkqu7FuLyrAGIIoNbsh_U
Content-Type: application/json
{
    "callRestrictionType": "outbound_call",
    "callMinutesRestriction": 9000,
    "timeCycle": "monthly",
    "callMinutesExceedAction": "allow",
    "callMinutesWarningPercent": "80,90,100"
}
Response example
HTTP/1.1 200 OK
{
  "requestId": "8b4491aab168766a3c44bc3683bc75c2",
  "status": "Success",
  "time": 1664517231
}