Limits

Limits

Configures limit on call consumed for your account.

About Limits

Schema

Limit an account’s ability to place concurrent calls using flat rate trunks

KeyDescriptionTypeDefaultRequiredSupport Level
allow_prepayDetermines if the account would like to allow per-minute calls if they have no available creditboolean()truefalsesupported
authz_resource_types.[]string()falsebeta
authz_resource_typesList of Resource-Types that will authorize the call; bypassing limit checks and billingarray(string())[]falsebeta
burst_trunksThe number of two-way, flat-rate trunks used only if no other trunks are availableinteger(-1..)falsebeta
callsA hard limit for the total number callsinteger(-1..)falsebeta
inbound_trunksThe number of inbound, flat-rate trunksinteger(-1..)falsesupported
outbound_trunksThe number of outbound, flat-rate trunksinteger(-1..)falsesupported
resource_consuming_callsA hard limit for the number of resource consuming callsinteger(-1..)falsebeta
twoway_trunksThe number of two-way, flat-rate trunksinteger(-1..)falsebeta

Fetch

GET /v2/accounts/{ACCOUNT_ID}/limits

curl -v -X GET \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/limits
{
    "data": {
        "twoway_trunks": 0,
        "inbound_trunks": 0,
        "id": "limits",
        "allow_prepay": true,
        "outbound_trunks": 5
    },
    "status": "success"
}

Update limits for a given account

Only allowed for Master, Reseller, and SuperDuperAdmin accounts.

POST /v2/accounts/{ACCOUNT_ID}/limits

curl -v -X POST \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    -d '{"data": {
        "twoway_trunks": 0,
        "inbound_trunks": 11,
        "id": "limits",
        "allow_prepay": true,
        "outbound_trunks": 5
    }}' \
    http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/limits

Reply warns that charges have to be accepted (402):

{
    "data": {
        "limits": {
            "inbound_trunks": {
                "category": "limits",
                "item": "inbound_trunks",
                "quantity": 11,
                "rate": 6.9900000000000002132,
                "single_discount": true,
                "single_discount_rate": 0.0,
                "cumulative_discount": 0,
                "cumulative_discount_rate": 0.0
            }
        }
    },
    "error": "402",
    "message": "accept charges",
    "status": "error",
}

Re-do the same request, setting accept_charges to true.

curl -v -X POST \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    -d '{"data": {
        "twoway_trunks": 0,
        "inbound_trunks": 11,
        "id": "limits",
        "allow_prepay": true,
        "outbound_trunks": 5,
        "accept_charges": true
    }}' \
    http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/limits
{
    "data": {
        "twoway_trunks": 0,
        "inbound_trunks": 11,
        "id": "limits",
        "allow_prepay": true,
        "outbound_trunks": 5
    },
    "status": "success",
}