Skip to main content
GET
/
storage
/
buckets
/
{bucketName}
/
usage
/
api
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});

const response = await client.storage.buckets.usage.getAPIUsage('', {
  filter: { end_time: '2019-12-27T18:11:19.117Z', start_time: '2019-12-27T18:11:19.117Z' },
});

console.log(response.data);
{
  "data": [
    {
      "categories": [
        {
          "bytes_sent": 123456,
          "bytes_received": 123456,
          "ops": 123456,
          "successful_ops": 123456,
          "category": "put_obj"
        }
      ],
      "total": {
        "bytes_sent": 123456,
        "bytes_received": 123456,
        "ops": 123456,
        "successful_ops": 123456
      },
      "timestamp": "2020-01-01T00:00:00Z"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

bucketName
string
required

The name of the bucket

Query Parameters

filter
object
required

Consolidated filter parameter (deepObject style). Originally: filter[start_time], filter[end_time]

Response

Bucket Usage

data
object[]