Skip to content

KAZOO Support Channels

This documentation is curated by 2600Hz as part of the KAZOO open source project. Join our community forums here for peer support. Only features in the docs.2600hz.com/supported space are included as part of our 2600Hz Support Services plan.

Accounts

Accounts#

Introduction#

Below is all the information related to Account management via APIs in TOP.

Here are some important points to know: * You do not need to create an account before activating (or moving) a device, one will be automatically created with the defaults shown below. * When deleting an account, all the devices within that account will get deactivated. THIS OPERATION IS FINAL.

Account document structure#

Key Type Description
data object Settings for account-wide data usage. The caps below refer to the sum of data usage of all devices on the account.
data.throttling object Settings for account-wide throttling.
data.throttling.cap int Data cap, in bytes, which will trigger throttling on every device once it's reached.
data.throttlign.rate string Maximum bandwith restriction while account-wide throttling is active. Accepted values are "64k", "128k", "256k", and "512k".
data.blocking object Settings for account-wide data blocking.
data.blocking.cap int Data cap, in bytes, which will block data usage on every device once it's reached.
device_defaults object Settings used as default for any new device activated on the account.
device_defaults.data object Default settings for device-specific data usage.
device_defaults.data.throttling object Default settings for device-specific throttling.
device_defaults.data.throttling.cap int Data cap, in bytes, which will trigger throttling on that specific device once it's reached.
device_defaults.data.throttlign.rate string Maximum bandwith restriction while that specific device's throttling is active. Accepted values are "64k", "128k", "256k", and "512k".
device_defaults.data.blocking object Default settings for device-specific data blocking.
device_defaults.data.blocking.cap int Data cap, in bytes, which will block data usage on that specific device once it's reached.
device_defaults.features array Default features that will be active on that specific device in addition to the MVNO default features. This (as well as the MVNO default features) will be ignored if specific features are provided during the activation.

API Index#

APIs#

Create an Account#

Required Authentication Level: basic

PUT http://{SERVER}:{PORT}/v2/accounts/{ACCOUNT_ID}

curl -v -X PUT \
    -H "Content-Type:application/json" \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    -H "X-Kazoo-Cluster-ID: {CLUSTER_ID}" \
    http://{SERVER}:{PORT}/v2/accounts/{ACCOUNT_ID} \
    -d '{ "data": { \
        "data": { \
            "throttling": { \
                "cap": 0, \
                "rate": "64k" \
            }, \
            "blocking": { \
                "cap": 0 \
            } \
        }, \
        "device_defaults": { \
            "data": { \
                "throttling": { \
                    "cap": 0, \
                    "rate": "64k" \
                }, \
                "blocking": { \
                    "cap": 0 \
                } \
            }, \
            "features": [ \
                "tethering" \
            ] \
        }
    }}'
{
    "auth_token": "{AUTH_TOKEN}",
    "data": {
        "data": {
            "throttling": {
                "cap": 0,
                "rate": "64k"
            },
            "blocking": {
                "cap": 0
            }
        },
        "device_defaults": {
            "data": {
                "throttling": {
                    "cap": 0,
                    "rate": "64k"
                },
                "blocking": {
                    "cap": 0
                }
            },
            "features": [
                "tethering"
            ]
        }
    },
    "request_id": "{REQUEST_ID}",
    "status": "success"
}

Get an Account document#

Required Authentication Level: basic

GET http://{SERVER}:{PORT}/v2/accounts/{ACCOUNT_ID}

curl -v -X GET \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    -H "X-Kazoo-Cluster-ID: {CLUSTER_ID}" \
    http://{SERVER}:{PORT}/v2/accounts/{ACCOUNT_ID}
{
    "auth_token": "{AUTH_TOKEN}",
    "data": {
        "data": {
            "throttling": {
                "cap": 0,
                "rate": "64k"
            },
            "blocking": {
                "cap": 0
            }
        },
        "device_defaults": {
            "data": {
                "throttling": {
                    "cap": 0,
                    "rate": "64k"
                },
                "blocking": {
                    "cap": 0
                }
            },
            "features": [
                "tethering"
            ]
        }
    },
    "request_id": "{REQUEST_ID}",
    "status": "success"
}

Update an Account document#

Required Authentication Level: basic

POST http://{SERVER}:{PORT}/v2/accounts/{ACCOUNT_ID}

curl -v -X POST \
    -H "Content-Type:application/json" \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    -H "X-Kazoo-Cluster-ID: {CLUSTER_ID}" \
    http://{SERVER}:{PORT}/v2/accounts/{ACCOUNT_ID} \
    -d '{ "data": { \
        "data": { \
            "throttling": { \
                "cap": 0, \
                "rate": "64k" \
            }, \
            "blocking": { \
                "cap": 0 \
            } \
        }, \
        "device_defaults": { \
            "data": { \
                "throttling": { \
                    "cap": 2000000000, \
                    "rate": "256k" \
                }, \
                "blocking": { \
                    "cap": 4000000000 \
                } \
            }, \
            "features": [ \
                "tethering" \
            ] \
        }
    }}'
{
    "auth_token": "{AUTH_TOKEN}",
    "data": {
        "data": {
            "throttling": {
                "cap": 0,
                "rate": "64k"
            },
            "blocking": {
                "cap": 0
            }
        },
        "device_defaults": {
            "data": {
                "throttling": {
                    "cap": 2000000000,
                    "rate": "256k"
                },
                "blocking": {
                    "cap": 4000000000
                }
            },
            "features": [
                "tethering"
            ]
        }
    },
    "request_id": "{REQUEST_ID}",
    "status": "success"
}

Patch an Account document#

Required Authentication Level: basic

PATCH http://{SERVER}:{PORT}/v2/accounts/{ACCOUNT_ID}

curl -v -X PATCH \
    -H "Content-Type:application/json" \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    -H "X-Kazoo-Cluster-ID: {CLUSTER_ID}" \
    http://{SERVER}:{PORT}/v2/accounts/{ACCOUNT_ID} \
    -d '{ "data": { \
        "device_defaults": { \
            "data": { \
                "throttling": { \
                    "cap": 3000000000, \
                    "rate": "128k" \
                }, \
            }
        }
    }}'
{
    "auth_token": "{AUTH_TOKEN}",
    "data": {
        "data": {
            "throttling": {
                "cap": 0,
                "rate": "64k"
            },
            "blocking": {
                "cap": 0
            }
        },
        "device_defaults": {
            "data": {
                "throttling": {
                    "cap": 3000000000,
                    "rate": "128k"
                },
                "blocking": {
                    "cap": 4000000000
                }
            },
            "features": [
                "tethering"
            ]
        }
    },
    "request_id": "{REQUEST_ID}",
    "status": "success"
}

Delete an Account#

Required Authentication Level: parent_of

Important: Deleting an Account will deactivate every devices in it. Their MDNs will be lost. This operation is final.

DELETE http://{SERVER}:{PORT}/v2/accounts/{ACCOUNT_ID}

curl -v -X DELETE \
    -H "Content-Type:application/json" \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    -H "X-Kazoo-Cluster-ID: {CLUSTER_ID}" \
    http://{SERVER}:{PORT}/v2/accounts/{ACCOUNT_ID} \
{
    "auth_token": "{AUTH_TOKEN}",
    "data": {
        "data": {
            "throttling": {
                "cap": 0,
                "rate": "64k"
            },
            "blocking": {
                "cap": 0
            }
        },
        "device_defaults": {
            "data": {
                "throttling": {
                    "cap": 3000000000,
                    "rate": "128k"
                },
                "blocking": {
                    "cap": 4000000000
                }
            },
            "features": [
                "tethering"
            ]
        }
    },
    "request_id": "{REQUEST_ID}",
    "status": "success"
}