Skip to content

Get storage and billing info

By , Head of IntegrationsUpdated

Open this page in a new chat

Short answer

This page has 2 commands: Get storage info (GET /v2/account/storage) and Get billing info (GET /v2/billing/plan). Use this to check the current storage usage of an account. Each call needs a bearer token and counts towards your hourly API limit.

After reading this you will know

  • How to get storage and billing info
  • Which parameters each of the 2 commands takes
  • Sample code in 9 languages and a sample answer

Every command on this page needs a bearer token and counts towards your hourly limit.

GEThttps://api.sirv.com/v2/account/storage

Use this to check the current storage usage of an account.

It will also return the total allowed storage; any extra storage provided; the temporary 30-day burstable storage allowance; the total files stored.

If the account has exceeded its storage allowance, it will state the when that happened.

If the account is one of a multi-account group, it will show the total storage used by all accounts.

Example request

// Your bearer token, from POST /v2/token, in the SIRV_TOKEN environment variable
const res = await fetch('https://api.sirv.com/v2/account/storage', {
method: 'GET',
headers: { authorization: `Bearer ${process.env.SIRV_TOKEN}` },
});
console.log(res.status, await res.text());

Example response

{
"plan": 100000000000,
"burstable": 500000000000,
"extra": 0,
"used": 51916252571,
"files": 73143,
"quotaExceededDate": null
}
GEThttps://api.sirv.com/v2/billing/plan

Use this API method to get all the billing plan information of an account, including price, storage and transfer allowances.

Example request

// Your bearer token, from POST /v2/token, in the SIRV_TOKEN environment variable
const res = await fetch('https://api.sirv.com/v2/billing/plan', {
method: 'GET',
headers: { authorization: `Bearer ${process.env.SIRV_TOKEN}` },
});
console.log(res.status, await res.text());

Example response

{
"dateActive": "2017-05-31T00:00:00.000Z",
"id": "Business_5_v2",
"period": "month",
"name": "Business 5",
"description": "The complete set of features, with large allowances and no branding",
"price": {
"month": 19,
"year": 209,
"quarter": 57
},
"storage": 1000000000,
"burstableStorage": 5000000000
}
Back to top