Traffic Control API

The Traffic Control API is a RESTful API that provides access to real-time and historical queue size data for the Vonage Traffic Control service. The API allows you to retrieve the current queue size for a specific product, as well as historical queue size data for a specific product over a specified date range.

Download OpenAPI Specification

Retrieve the current queue size

gethttps://api.nexmo.com/v0.1/vtc/queues/product/:product_name/current

Authentication

KeyDescriptionWhereExample
Authorization

Base64 encoded API key and secret joined by a colon.
Read more

Headers

Basic <base64>

Path Parameters

product_name
string
Required

The name of the product to retrieve the queue size for. Must be sms.

Must be one of:sms

Responses
Content Type
application/json

OK.

_embedded
object
Required
data
object
queue_size
integer
example100
_links
object
Required
self
object
Required
href
string(URL)
Required
example/v0.1/vtc/queues/product/sms/current
templated
boolean
Required

Example Response

{
   "_embedded": {
      "data": {
         "queue_size": 100
      }
   },
   "_links": {
      "self": {
         "href": "/v0.1/vtc/queues/product/sms/current",
         "templated": false
      }
   }
}

Retrieve historical queue size data

gethttps://api.nexmo.com/v0.1/vtc/queues/product/:product_name/historical

Authentication

KeyDescriptionWhereExample
Authorization

Base64 encoded API key and secret joined by a colon.
Read more

Headers

Basic <base64>

Path Parameters

product_name
string
Required

The name of the product to retrieve the queue size for. Must be sms.

Must be one of:sms

Query Parameters

start_date
string

The date at which the returned dataset should start in ISO8601 format.

end_date
string

The date at which the returned dataset should end in ISO8601 format.

Responses
Content Type
application/json

OK.

_embedded
object
Required
historical_data
array
queue_size
integer
example30
timestamp
string(date-time)
example2024-06-12T15:59:22.870Z
_links
object
Required
self
object
Required
href
string(URL)
Required
example/v0.1/vtc/queues/product/sms/historical?start_date=2024-06-12T15:59:22.870Z&end_date=2024-06-12T15:59:42.870Z
templated
boolean
Required

Example Response

{
   "_embedded": {
      "historical_data": [
         {
            "queue_size": 30,
            "timestamp": "2024-06-12T15:59:22.870Z"
         }
      ]
   },
   "_links": {
      "self": {
         "href": "/v0.1/vtc/queues/product/sms/historical?start_date=2024-06-12T15:59:22.870Z&end_date=2024-06-12T15:59:42.870Z",
         "templated": false
      }
   }
}

Errors

The following is a non-exhaustive list of error codes that may occur while using this API.

These codes are in addition to any of our generic error codes.

CodeInformation
throttled

Your request rate exceeds the allowed limit for this account.

internal-error

An internal error occurred. Please try again later.

invalid-product

Path parameter product_name didn't validate. The given product is not supported.

invalid-provisioner-command

The path segment denoting the action to be performed is not valid. The only allowed actions are /activate and /deactivate.

invalid-date-format

Invalid date format. Please provide the start_date and end_date in ISO8601 format.

missing-query-param

One or more required query parameters was not specified.