get__user_quota
GET /user/quota
Get Current User Quota and Usage
Retrieve the current organization's active subscription information and quota usage for all capabilities associated with that subscription.
TypeScript Client Library
public getUserQuota = async (): Promise<QuotaResponse> => {
return this.makeRequest<QuotaResponse>('user/quota', 'GET', null);
};Code Samples
# You can also use wget
curl -X GET https://backend.flashback.tech/user/quota \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'GET https://backend.flashback.tech/user/quota HTTP/1.1
Host: localhost:3000
Accept: application/json
Authorization: Bearer {access-token}const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://backend.flashback.tech/user/quota',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://backend.flashback.tech/user/quota',
params: {
}, headers: headers
p JSON.parse(result)import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://backend.flashback.tech/user/quota', headers = headers)
print(r.json())<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
try {
$response = $client->request('GET','https://backend.flashback.tech/user/quota', array(
'headers' => $headers,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...URL obj = new URL("https://backend.flashback.tech/user/quota");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("Authorization", "Bearer {access-token}");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{})
req, err := http.NewRequest("GET", "https://backend.flashback.tech/user/quota", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}Example responses
200 Response
{
"success": true,
"subscription": {
"id": "sub_123",
"name": "Pro",
"description": "Pro subscription"
},
"quotaUsage": [
{
"capability": {
"id": "cap_001",
"code": "STORAGE_TOTAL_BYTES",
"description": "Total storage available in bytes",
"type": "STORAGE",
"periodType": "ALL_TIME"
},
"usage": {
"current": 5368709120,
"max": 10737418240,
"percentage": 50
}
},
{
"capability": {
"id": "cap_002",
"code": "EGRESS_MONTHLY_BYTES",
"description": "Monthly egress in bytes",
"type": "TRAFFIC",
"periodType": "MONTHLY"
},
"usage": {
"current": 123456789,
"max": 2147483648,
"percentage": 6
}
}
]
}401 Response
{
"success": false,
"error_code": "NO_AUTH_USER"
}404 Response
{
"success": false,
"error_code": "NO_ACTIVE_SUBSCRIPTION"
}500 Response
{
"success": false,
"error_code": "INTERNAL_ERROR",
"message": "Database connection failed"
}Responses
Response Schema
Status Code 200
» success
boolean
false
none
Indicates if the request was successful
» subscription
object
false
none
Active subscription info
»» id
string
false
none
Subscription identifier
»» name
string
false
none
Subscription name
»» description
string
false
none
Subscription description
» quotaUsage
[object]
false
none
Array of capability usage entries
»» capability
object
false
none
Capability metadata
»»» id
string
false
none
Capability identifier
»»» code
string
false
none
Capability code
»»» description
string
false
none
Capability description
»»» type
string
false
none
Capability type (e.g., 'STORAGE', 'TRAFFIC')
»»» periodType
string
false
none
Period type for quota accounting
»» usage
object
false
none
Usage details
»»» current
number
false
none
Current usage value
»»» max
number
false
none
Maximum allowed usage
»»» percentage
number
false
none
Usage percentage (0-100)
Status Code 401
» success
boolean
false
none
Indicates if the request was successful
» error_code
string
false
none
Error code, e.g., NO_AUTH_USER
Status Code 404
» success
boolean
false
none
Indicates if the request was successful
» error_code
string
false
none
Error code, e.g., NO_ACTIVE_SUBSCRIPTION
Status Code 500
» success
boolean
false
none
Indicates if the request was successful
» error_code
string
false
none
Error code, e.g., INTERNAL_ERROR
» message
string
false
none
Detailed error information
Enumerated Values
» periodType
ALL_TIME
No reset; lifetime quota
» periodType
DAILY
Resets daily
» periodType
WEEKLY
Resets weekly
» periodType
MONTHLY
Resets monthly
» periodType
YEARLY
Resets yearly
Last updated
Was this helpful?