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}'

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

Status
Meaning
Description
Schema

200

Quota and usage retrieved successfully

Inline

401

Authentication required or user not found

Inline

404

No active subscription

Inline

500

Internal server error

Inline

Response Schema

Status Code 200

Name
Type
Required
Restrictions
Description

» 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

Name
Type
Required
Restrictions
Description

» 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

Name
Type
Required
Restrictions
Description

» 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

Name
Type
Required
Restrictions
Description

» 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

Parameter
Value
Description

» 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?